Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::MaskCleaningOperation Class Reference

Provides static methods for cleaning and filtering segmentation masks. More...

#include <mitkMaskCleaningOperation.h>

Static Public Member Functions

static Image::Pointer RangeBasedMasking (Image::Pointer &image, Image::Pointer &mask, bool lowerLimitOn=false, double lowerLimit=0, bool upperLimitOn=false, double upperLimit=1)
 Remove mask voxels where the corresponding image intensity is outside a given range. More...
 
static Image::Pointer MaskOutlierFiltering (Image::Pointer &image, Image::Pointer &mask)
 Remove mask voxels where image intensities are statistical outliers. More...
 

Detailed Description

Provides static methods for cleaning and filtering segmentation masks.

The MaskCleaningOperation class provides operations to refine binary segmentation masks based on the intensity values of a corresponding grey-scale image. Supported operations include range-based masking (removing mask voxels outside a specified intensity range) and statistical outlier filtering (removing mask voxels where intensities fall outside three standard deviations from the mean).

It is assumed that the segmentation mask is of type "unsigned short".

See also
ArithmeticOperation, TransformationOperation

Definition at line 35 of file mitkMaskCleaningOperation.h.

Member Function Documentation

◆ MaskOutlierFiltering()

static Image::Pointer mitk::MaskCleaningOperation::MaskOutlierFiltering ( Image::Pointer &  image,
Image::Pointer &  mask 
)
static

Remove mask voxels where image intensities are statistical outliers.

Computes the mean ( \(\mu\)) and standard deviation ( \(\sigma\)) of the image intensities within the masked region, then removes all mask voxels where the corresponding image intensity falls outside the range \([\mu - 3\sigma, \mu + 3\sigma]\).

Internally delegates to RangeBasedMasking() with the computed statistical bounds.

Parameters
[in]imageGrey-scale image providing the intensity values for outlier detection.
[in]maskOriginal binary mask (unsigned short) defining the region of interest.
Returns
A new mask image with outlier voxels set to 0.
See also
RangeBasedMasking

◆ RangeBasedMasking()

static Image::Pointer mitk::MaskCleaningOperation::RangeBasedMasking ( Image::Pointer &  image,
Image::Pointer &  mask,
bool  lowerLimitOn = false,
double  lowerLimit = 0,
bool  upperLimitOn = false,
double  upperLimit = 1 
)
static

Remove mask voxels where the corresponding image intensity is outside a given range.

For each voxel in the mask, the corresponding intensity in the grey-scale image is checked against optional lower and upper thresholds. If the intensity falls outside the active threshold bounds, the mask voxel is set to 0.

Parameters
[in]imageGrey-scale image providing the intensity values for threshold comparison.
[in]maskOriginal binary mask (unsigned short) to be filtered.
[in]lowerLimitOnIf true, mask voxels covering intensities below lowerLimit are set to 0. Default: false.
[in]lowerLimitThe lower intensity threshold. Only used when lowerLimitOn is true. Default: 0.
[in]upperLimitOnIf true, mask voxels covering intensities above upperLimit are set to 0. Default: false.
[in]upperLimitThe upper intensity threshold. Only used when upperLimitOn is true. Default: 1.
Returns
A new mask image with out-of-range voxels set to 0.

The documentation for this class was generated from the following file: