Cropper

Cropper in a nutshell.

  1. Plugin to crop region of a stack;

  2. This plugin is multichannel;

  3. Python API reference: bmiptools.transformation.geometric.cropper.Cropper.

This plugin can be used to crop a specific region of a stack. When used inside a pipeline, it is better to apply this plugin as soon as possible, in order to reduce the computation resource needed for the application of the other plugins to a stack.

The Python API reference of the plugin is bmiptools.transformation.geometric.cropper.Cropper.

Transformation dictionary

The transformation dictionary for this plugin look like this.

{'z_range': [None,None],
'y_range': [None,None],
'x_range': [None,None]
}

The plugin-specific parameters contained in this dictionary are:

  • z_range: list specifying the two extrema for the cropping along the Z-direction,

  • y_range: list specifying the two extrema for the cropping along the Y-direction,

  • x_range: list specifying the two extrema for the cropping along the X-direction,

The ranges above have to be expressed according to the convention explained here (also for the Z-axis). Further details useful the the usage of this plugin with the Python API can be found in the __init__ method of the class Cropper.

Use case

The typical use of this plugin are:

  1. Crop part of the input stack.

Application example

As example consider the slice of a stack of a biological sample obtained via cryo-FIB-SEM.

../_images/pre_cropper.png

After cropping a square \(500 \times 500\) pixels in bottom-left part of the slice, the result obtained is given below.

../_images/post_cropper.png

.

Note

The script used to produce the images displayed can be found here. To reproduce the images showed above one may consult the examples/documentation_scritps folder, where is explained how to run the example scripts and where one can find all the necessary input data.

Implementation details

In case of stack with multiple channels, the Cropper is applied independently to each channel.