- class mantidimaging.core.operations.median_filter.median_filter.KernelSpinBox(on_change: Callable)¶
- class mantidimaging.core.operations.median_filter.median_filter.MedianFilter¶
Applies Median filter to the data.
Intended to be used on: Projections or reconstructed slices
When: As a pre-processing or post-reconstruction step to reduce noise.
Note: NaN values are preserved through the filter. They are treated as negative infinity while calculating neighbouring pixels.
- static execute_wrapper(size_field=None, mode_field=None, use_gpu_field=None)¶
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(data: ImageStack, size=None, mode='reflect', progress=None, force_cpu=True)¶
data – Input data as an ImageStack object.
size – Size of the kernel
mode – The mode with which to handle the edges. One of [reflect, constant, nearest, mirror, wrap]. Modes are described in the SciPy documentation.
progress – The object for displaying the progress.
force_cpu – Whether or not to use the CPU.
Returns the processed data
- filter_name = 'Median'¶
- static register_gui(form: QFormLayout, on_change: Callable, view) Dict[str, Any] ¶
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.
form – the layout to create input widgets in
on_change – the filter view action to be bound to all created inputs
the widgets bound as kwargs which are needed to call execute_wrapper