mantidimaging.core.operations.sum_stack_intensities.sum_intensities module#

class mantidimaging.core.operations.sum_stack_intensities.sum_intensities.SumIntensitiesFilter[source]#

Bases: BaseFilter

Sum stack intensities as a new stack to emulate longer exposure times for Tomography and Time of Flight (ToF) datasets.

Use cases:
  • The stacks to be summed have exactly the same shape (x,y) and number of slices (z).

The z-axis could be either rotation angle or ToF bin. - Stacks where values on the z-axis are identical, e.g. 2 tomography scans taken at the same rotation angles.

The new stack will be saved either in-place or as a new stack within a new dataset, depending on the user’s choice.

static compute_function(i: int, array: ndarray, params: dict)[source]#

Function to compute the sum of stack intensities

static execute_wrapper(stack_type_widget: QComboBox, stack_to_sum_widget: DatasetSelectorWidgetView) 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, stack_type: str | None = None, secondary_stack: ImageStack | None = None, progress: Any = None) ImageStack[source]#

Validate and prepare stacks for summing intensities.

filter_name = 'Sum Stack Intensities'#
static group_name() FilterGroup[source]#
static register_gui(form: QFormLayout, on_change: Callable, view: Any) 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

valid_types = ['Tomography', 'Time of Flight (ToF)']#