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

Provides morphological operations for binary segmentation images. More...

#include <mitkMorphologicalOperations.h>

Public Types

enum  StructuralElementType {
  Ball , Ball_Axial , Ball_Sagittal , Ball_Coronal ,
  Cross , Cross_Axial , Cross_Sagittal , Cross_Coronal
}
 Defines the type and orientation of the structuring element. More...
 

Static Public Member Functions

static void Closing (mitk::Image::Pointer &image, int factor, StructuralElementType structuralElement)
 Performs a morphological closing on a 2D, 3D, or 3D+t segmentation image. More...
 
static void Erode (mitk::Image::Pointer &image, int factor, StructuralElementType structuralElement)
 Performs a morphological erosion on a 2D, 3D, or 3D+t segmentation image. More...
 
static void Dilate (mitk::Image::Pointer &image, int factor, StructuralElementType structuralElement)
 Performs a morphological dilation on a 2D, 3D, or 3D+t segmentation image. More...
 
static void Opening (mitk::Image::Pointer &image, int factor, StructuralElementType structuralElement)
 Performs a morphological opening on a 2D, 3D, or 3D+t segmentation image. More...
 
static void FillHoles (mitk::Image::Pointer &image)
 Fills holes in a binary 2D, 3D, or 3D+t segmentation image. More...
 

Detailed Description

Provides morphological operations for binary segmentation images.

Supports closing, opening, erosion, dilation, and hole filling on 2D, 3D, or 3D+t segmentation images. Structuring elements can be ball- or cross-shaped and can be restricted to specific orientations (axial, sagittal, coronal).

Note
2D images do not work with coronal or sagittal structuring elements, as those require a third dimension.
See also
OtsuSegmentationFilter

Definition at line 33 of file mitkMorphologicalOperations.h.

Member Enumeration Documentation

◆ StructuralElementType

Defines the type and orientation of the structuring element.

Values are bitmask-combinable. For example, Ball = Ball_Axial | Ball_Sagittal | Ball_Coronal.

Enumerator
Ball 

Full 3D ball structuring element.

Ball_Axial 

Ball restricted to axial plane.

Ball_Sagittal 

Ball restricted to sagittal plane.

Ball_Coronal 

Ball restricted to coronal plane.

Cross 

Full 3D cross structuring element.

Cross_Axial 

Cross restricted to axial plane.

Cross_Sagittal 

Cross restricted to sagittal plane.

Cross_Coronal 

Cross restricted to coronal plane.

Definition at line 41 of file mitkMorphologicalOperations.h.

Member Function Documentation

◆ Closing()

static void mitk::MorphologicalOperations::Closing ( mitk::Image::Pointer &  image,
int  factor,
StructuralElementType  structuralElement 
)
static

Performs a morphological closing on a 2D, 3D, or 3D+t segmentation image.

Parameters
[in,out]imageThe segmentation image to process (modified in-place).
[in]factorThe radius/size of the structuring element.
[in]structuralElementThe type and orientation of the structuring element.

◆ Dilate()

static void mitk::MorphologicalOperations::Dilate ( mitk::Image::Pointer &  image,
int  factor,
StructuralElementType  structuralElement 
)
static

Performs a morphological dilation on a 2D, 3D, or 3D+t segmentation image.

Parameters
[in,out]imageThe segmentation image to process (modified in-place).
[in]factorThe radius/size of the structuring element.
[in]structuralElementThe type and orientation of the structuring element.

◆ Erode()

static void mitk::MorphologicalOperations::Erode ( mitk::Image::Pointer &  image,
int  factor,
StructuralElementType  structuralElement 
)
static

Performs a morphological erosion on a 2D, 3D, or 3D+t segmentation image.

Parameters
[in,out]imageThe segmentation image to process (modified in-place).
[in]factorThe radius/size of the structuring element.
[in]structuralElementThe type and orientation of the structuring element.

◆ FillHoles()

static void mitk::MorphologicalOperations::FillHoles ( mitk::Image::Pointer &  image)
static

Fills holes in a binary 2D, 3D, or 3D+t segmentation image.

Parameters
[in,out]imageThe segmentation image to process (modified in-place).

◆ Opening()

static void mitk::MorphologicalOperations::Opening ( mitk::Image::Pointer &  image,
int  factor,
StructuralElementType  structuralElement 
)
static

Performs a morphological opening on a 2D, 3D, or 3D+t segmentation image.

Parameters
[in,out]imageThe segmentation image to process (modified in-place).
[in]factorThe radius/size of the structuring element.
[in]structuralElementThe type and orientation of the structuring element.

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