List of my modules...
Module: Extract Elements
Description:
Copies to output the elements of the input (connected components of same-value pixels) that are in the mask. I propose four definitions of in depending on the need, and they are:
- Loose: at least one pixel of the element is in the mask.
- Strict: all pixels of the element are in the mask.
- Very strict: pixels of the element cannot be neighbour to pixels outside of the mask.
- Partial Volume: a given fraction of pixels of the element must be in the mask.
Illustration of the element extraction on a foam sample in which the cells were segmented. From left to right: a cross-section through the segmented image, along with the mask of the whole sample in very transparent, and a spherical mask in the center. The result using the spherical mask and the loose definition. The result with the strict definition. The result using the mask of the entire sample (again in transparent) and the very strict definition. The latter is useful if the elements on the border are not representative of the elements overall.
Notes
- Supposes the value of an elements must be non-zero.
- Supposes elements are 6-connected.
- Only checks for dimensions of input and mask, ignores transformation matrices and bounding boxes.
- For the Partial volume defition, a fraction of 1 is the same as the Strict definition, which is logical.
- Less logical, a fraction of 0 is the same as the Loose definition, because for optimisation purposes only the elements having at least one pixel in the mask are processed.
Connections:
Image
[required]
The input image containing the elements, defined in a class HxUniformComplexField3.
Mask
[required]
The input mask, defined in a class HxUniformComplexField3.
Threshold

Value that defines whether a pixel is part of the mask.
Comparison

Defines how the threshold is used: should the pixel value be lower, lower or equal, greater, etc. than the threshold ?
Type

Defines what in means. See the description above.
Volume

If Partial volume is selected in the port above, then an element will be considered in if at least a certain fraction of its volume is in the mask. That fraction is given by this port.
Action

Push the button to extract the elements.
Commands:
Additional options can be accessed when typing in the console Extract_Elements COMMAND_NAME.
verbose
Displays additional information. Type againg to switch off.
create
Runs the computation. Returns the name of the output, so it can be used in a script, such as set RESULT [Extract_Elements create].