mantidimaging.core.operations.rebin.rebin module

class mantidimaging.core.operations.rebin.rebin.RebinFilter[source]

Bases: BaseFilter

Rebin the image to reduce the resolution.

This filter temporarily increases memory usage, while the image is being rebinned. The memory usage will be lowered after the filter has finished executing.

Intended to be used on: Any data

When: If you want to reduce the data size and to smoothen the image.

static execute_wrapper(rebin_to_dimensions_radio=None, shape_x=None, shape_y=None, rebin_by_factor_radio=None, factor=None, mode_field=None)[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, rebin_param=0.5, mode=None, progress=None) ImageStack[source]
Parameters:
  • images – Sample data which is to be processed. Expects radiograms

  • rebin_param – int, float or tuple int - Percentage of current size. float - Fraction of current size. tuple - Size of the output image (x, y).

  • mode – Interpolation to use for re-sizing (‘nearest’, ‘lanczos’, ‘bilinear’, ‘bicubic’ or ‘cubic’).

Returns:

The processed 3D numpy.ndarray

filter_name = 'Rebin'
static register_gui(form, on_change, view)[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

mantidimaging.core.operations.rebin.rebin.modes()[source]