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

Helpful methods for working with contours 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)
 Projects a contour onto an image point by point. Converts from world to index coordinates. More...
 
static ContourModel::Pointer BackProjectContourFrom2DSlice (const BaseGeometry *sliceGeometry, const ContourModel *contourIn2D)
 Projects a slice index coordinates of a contour back into world coordinates. More...
 
static void FillContourInSlice (const ContourModel *projectedContour, Image *sliceImage, const Image *workingImage, 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 FillContourInSlice (const ContourModel *projectedContour, TimeStepType contourTimeStep, Image *sliceImage, const Image *workingImage, 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 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 void FillSliceInSlice (vtkSmartPointer< vtkImageData > filledImage, vtkSmartPointer< vtkImageData > resultImage, const Image *image, int paintingPixelValue, double fillForegroundThreshold=1.0)
 Fills the paintingPixelValue into every pixel of resultImage as indicated by filledImage. If a LableSet image is specified it also by incorporating the rules of LabelSet images when filling the content. More...
 
static ContourModel::Pointer MoveZerothContourTimeStep (const ContourModel *contour, TimeStepType timeStep)
 Move the contour in time step 0 to to a new contour model at the given time step. More...
 
static int GetActivePixelValue (const Image *workingImage)
 Retrieves the active pixel value of a (labelset) image. If the image is basic image, the pixel value 1 (one) will be returned. If the image is actually a labelset image, the pixel value of the active label of the active layer will be returned. More...
 

Protected Member Functions

 ContourModelUtils ()
 
 ~ContourModelUtils () override
 

Detailed Description

Helpful methods for working with contours and images.

Definition at line 29 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

Projects a slice index coordinates of a contour back into world coordinates.

Parameters
sliceGeometry
contourIn2D

◆ FillContourInSlice() [1/2]

static void mitk::ContourModelUtils::FillContourInSlice ( const ContourModel projectedContour,
Image sliceImage,
const Image workingImage,
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.

Deprecated:
Ths function is deprecated. Use FillContourInSlice2() (in conjunction e.g. with TransferLabelContent()) instead.
Precondition
sliceImage points to a valid instance
projectedContour points to a valid instance

◆ FillContourInSlice() [2/2]

static void mitk::ContourModelUtils::FillContourInSlice ( const ContourModel projectedContour,
TimeStepType  contourTimeStep,
Image sliceImage,
const Image workingImage,
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.

Deprecated:
Ths function is deprecated. Use FillContourInSlice2() (in conjunction e.g. with TransferLabelContentAtTimeStep()) instead.
Precondition
sliceImage points to a valid instance
projectedContour points to a valid instance

◆ 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

◆ FillSliceInSlice()

static void mitk::ContourModelUtils::FillSliceInSlice ( vtkSmartPointer< vtkImageData >  filledImage,
vtkSmartPointer< vtkImageData >  resultImage,
const Image image,
int  paintingPixelValue,
double  fillForegroundThreshold = 1.0 
)
static

Fills the paintingPixelValue into every pixel of resultImage as indicated by filledImage. If a LableSet image is specified it also by incorporating the rules of LabelSet images when filling the content.

Parameters
filledImagePointer to the image content that should be checked to decied of a pixel in resultImage should be filled with paintingPixelValue or not.
resultImagePointer to the image content that should be overwritten guided by the content of filledImage.
imagePointer to an mitk image that allows to define the LabelSet image which states steer the filling process. If an LabelSet instance is passed its states (e.g. locked labels etc...) will be used. If nullptr or an normal image is passed, then simply any pixel position indicated by filledImage will be overwritten.
paintingPixelValuethe pixelvalue/label that should be used in the result image when filling.
fillForegroundThresholdThe threshold value that decides if a pixel in the filled image counts as foreground (>=fillForegroundThreshold) or not.
Deprecated:
Ths function is deprecated. Use TransferLabelContent() instead.

◆ GetActivePixelValue()

static int mitk::ContourModelUtils::GetActivePixelValue ( const Image workingImage)
static

Retrieves the active pixel value of a (labelset) image. If the image is basic image, the pixel value 1 (one) will be returned. If the image is actually a labelset image, the pixel value of the active label of the active layer will be returned.

Parameters
workingImageThe (labelset) image to retrieve the active pixel value of.

◆ mitkClassMacroItkParent()

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

◆ MoveZerothContourTimeStep()

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

Move the contour in time step 0 to to a new contour model at the given time step.

◆ ProjectContourTo2DSlice()

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

Projects a contour onto an image point by point. Converts from world to index coordinates.

Parameters
slice
contourIn3D

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