Edit Mask¶
Add a mask to an image or edit/remove an existing one.
Input¶
A single 2D or 3D image or set containing any combination thereof.
Output¶
Changes the mask attachment of the input image. No images will be added to the data model.
Description¶
The algorithm allows to add, remove and edit the mask of an image. A mask can be used to discard certain areas of an image during algorithms that support masks. For each pixel of an image, the mask defines if a pixel is regarded as inside (i.e. relevant) or outside (i.e. irrelevant). For example, a mask can be used to pixel-precisely clip the black border around an ultrasound image.
The views treat masks according to the settings value in ‘Visualization -> Mask Rendering’:
- Discard Pixels: pixels outside the mask are rendered completely transparent.
- Colorize Pixels: pixels outside the mask are rendered with the defined color.
- Transparent Pixels: pixels outside the mask are rendered partially transparent using the defined alpha value.
If the input image does not have mask yet, a mask type can be selected from the combo box and added to the image with Add. The following mask types exist:
- Intensity Mask: Removes all pixels with the given value or, if
Mask range
is checked, all pixels that are outside the given range. - Explicit Mask: Stores a binary value for each individual pixel in the image that is either 1 for inside or 0 for outside. In the default Explicit Mask all pixels are inside. An Explicit Mask is more useful, however, when attaching another (binary) image as a mask with Attach . For example, after segmenting a certain region of interest, the result can be exported as a Label Map and attached as an Explicit Mask.
- Cropping Mask: Defines a region starting from the image border that should be discarded.
- Skipping Mask: Only pixels every
skip
are inside. - Explicit Intensity Mask: A combination of an Explicit Mask and an Intensity Mask. Therefore, you select a secondary image using the Attach while Intensity Mask is the selected mode and define the masking range. The input intensities for the mask will be taken from the attached second image, while the actual mask will be applied to the first input image.
If the Individual per frame
option is checked, an individual mask can be assigned to each frame of an image set. Otherwise, all frames will receive the same mask (i.e. changing the properties of the mask affects all frames).
Each mask can be exported as a label map through Extract, which will add the mask to the data list as a binary image.