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 to emulate longer exposure times.

Intended to be used on: Tomography or Time of Flight (ToF) datasets.

When: Combining repeated acquisitions of the same dataset to improves signal-to-noise ratio.

Note:

  • Both stacks must have identical shape (x, y, z).

  • The z-axis typically represents projection angle or ToF bin.

  • Projection angles are not required. If present, projections are sorted into angle order on load (see loader.load). If matched angles between stacks to be summed together differ, a warning is raised.

  • The primary stack is modified in-place.

allow_for_180_projection = False#
angle_variance_threshold = 0.1#
static execute_wrapper(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, secondary_stack: ImageStack | None = None, progress: Any = None) ImageStack[source]#
Parameters:
  • images – Primary ImageStack to be modified.

  • secondary_stack – Secondary ImageStack whose values are added to the primary stack

  • progress – Progress reporting object (unused - no meaningful progress updates to report as operation runs as a single vectorised operation).

Returns:

The modified primary ImageStack.

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

static sum_stacks(primary_stack: ImageStack, secondary_stack: ImageStack) None[source]#

Sum stacks element-wise.

Primary stack is modified in-place, secondary stack is left unchanged. Assumes stacks have already been validated for shape compatibility. During preview, primary_stack may be a single-slice subset; secondary is sliced to match.

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