mantidimaging.core.operations.divide.divide module

class mantidimaging.core.operations.divide.divide.DivideFilter[source]

Bases: BaseFilter

Divides a stack of images by a value. That value can be the pixel size, and can be specified in either microns or cms, to obtain attenuation values.

Intended to be used on: Reconstructed slices

When: To calculate attenuation values by dividing by the pixel size in microns

Caution: Check preview values before applying divide

static execute_wrapper(value_widget: QDoubleSpinBox, unit_widget: QComboBox) partial[source]

Should construct a partial call to _filter_func using values taken from the widgets passed to this function as kwargs. :param kwargs: widgets which contain values required for _filter_func. :return: a partial call to _filter_func using parameters taken from the input widgets.

static filter_func(images: ImageStack, value: int | float = 0, unit='micron', progress=None) ImageStack[source]
Parameters:
  • value – The division value.

  • unit – The unit of the divisor.

Returns:

The ImageStack object which has been divided by a value.

filter_name = 'Divide'
static register_gui(form: QFormLayout, on_change: Callable, view: BasePresenter) Dict[str, Any][source]

Adds any required input widgets to the given form and returns references to them.

The return values should be in a dict which can be unpacked as kwargs for a call to the operations execute_wrapper.

Parameters:
  • view

  • form – the layout to create input widgets in

  • on_change – the filter view action to be bound to all created inputs

Returns:

the widgets bound as kwargs which are needed to call execute_wrapper

static validate_execute_kwargs(kwargs: Dict[str, Any]) bool[source]