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

Static utility methods for working with contour models and images. More...

#include <mitkContourModelUtils.h>

Inheritance diagram for mitk::ContourModelUtils:
Collaboration diagram for mitk::ContourModelUtils:

Public Member Functions

 mitkClassMacroItkParent (ContourModelUtils, itk::Object)
 

Static Public Member Functions

static ContourModel::Pointer ProjectContourTo2DSlice (const Image *slice, const ContourModel *contourIn3D)
 Project a 3D contour onto a 2D image slice. More...
 
static ContourModel::Pointer BackProjectContourFrom2DSlice (const BaseGeometry *sliceGeometry, const ContourModel *contourIn2D)
 Back-project a 2D slice contour into 3D world coordinates. More...
 
static void FillContourInSlice2 (const ContourModel *projectedContour, Image *sliceImage, int paintingPixelValue=1)
 Fill a contour in a 2D slice with a specified pixel value. This version always uses the contour of time step 0 and fills the image. More...
 
static void FillContourInSlice2 (const ContourModel *projectedContour, TimeStepType contourTimeStep, Image *sliceImage, int paintingPixelValue=1)
 Fill a contour in a 2D slice with a specified pixel value. This overloaded version uses the contour at the passed contourTimeStep to fill the passed image slice. More...
 
static ContourModel::Pointer MoveZerothContourTimeStep (const ContourModel *contour, TimeStepType timeStep)
 Create a new contour model with the contour from time step 0 placed at the specified time step. More...
 

Protected Member Functions

 ContourModelUtils ()
 
 ~ContourModelUtils () override
 

Detailed Description

Static utility methods for working with contour models and images.

Provides projection, back-projection, and fill operations for contour models in relation to 2D image slices. These utilities support the segmentation workflow by converting between world and index coordinate contour representations and by filling contour regions into images.

See also
ContourModel, Image, LabelSetImage

Definition at line 35 of file mitkContourModelUtils.h.

Constructor & Destructor Documentation

◆ ContourModelUtils()

mitk::ContourModelUtils::ContourModelUtils ( )
protected

◆ ~ContourModelUtils()

mitk::ContourModelUtils::~ContourModelUtils ( )
overrideprotected

Member Function Documentation

◆ BackProjectContourFrom2DSlice()

static ContourModel::Pointer mitk::ContourModelUtils::BackProjectContourFrom2DSlice ( const BaseGeometry *  sliceGeometry,
const ContourModel *  contourIn2D 
)
static

Back-project a 2D slice contour into 3D world coordinates.

Converts each vertex of the contour from slice index coordinates back to world coordinates using the provided geometry.

Parameters
[in]sliceGeometryThe geometry of the 2D slice.
[in]contourIn2DThe contour in slice index coordinates.
Returns
A new ContourModel with vertices in world (3D) coordinates.

◆ FillContourInSlice2() [1/2]

static void mitk::ContourModelUtils::FillContourInSlice2 ( const ContourModel *  projectedContour,
Image *  sliceImage,
int  paintingPixelValue = 1 
)
static

Fill a contour in a 2D slice with a specified pixel value. This version always uses the contour of time step 0 and fills the image.

Parameters
projectedContourPointer to the contour that should be projected.
sliceImagePointer to the image which content should be altered by adding the contour with the specified paintingPixelValue.
paintingPixelValue
Precondition
sliceImage points to a valid instance
projectedContour points to a valid instance

◆ FillContourInSlice2() [2/2]

static void mitk::ContourModelUtils::FillContourInSlice2 ( const ContourModel *  projectedContour,
TimeStepType  contourTimeStep,
Image *  sliceImage,
int  paintingPixelValue = 1 
)
static

Fill a contour in a 2D slice with a specified pixel value. This overloaded version uses the contour at the passed contourTimeStep to fill the passed image slice.

Parameters
projectedContourPointer to the contour that should be projected.
contourTimeStep
sliceImagePointer to the image which content should be altered by
paintingPixelValueadding the contour with the specified paintingPixelValue.
Precondition
sliceImage points to a valid instance
projectedContour points to a valid instance

◆ mitkClassMacroItkParent()

mitk::ContourModelUtils::mitkClassMacroItkParent ( ContourModelUtils  ,
itk::Object   
)

◆ MoveZerothContourTimeStep()

static ContourModel::Pointer mitk::ContourModelUtils::MoveZerothContourTimeStep ( const ContourModel *  contour,
TimeStepType  timeStep 
)
static

Create a new contour model with the contour from time step 0 placed at the specified time step.

Parameters
[in]contourThe source contour model whose time step 0 data is used.
[in]timeStepThe destination time step in the new contour model.
Returns
A new ContourModel containing the contour at the specified time step.

◆ ProjectContourTo2DSlice()

static ContourModel::Pointer mitk::ContourModelUtils::ProjectContourTo2DSlice ( const Image *  slice,
const ContourModel *  contourIn3D 
)
static

Project a 3D contour onto a 2D image slice.

Converts each vertex of the contour from world coordinates to index coordinates of the given slice.

Parameters
[in]sliceThe 2D image slice providing the geometry for projection.
[in]contourIn3DThe contour in world (3D) coordinates.
Returns
A new ContourModel with vertices in slice index coordinates.

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