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

Filter that extracts contour lines from a 2D image at a given iso-value. More...

#include <mitkImageToContourModelFilter.h>

Inheritance diagram for mitk::ImageToContourModelFilter:
Collaboration diagram for mitk::ImageToContourModelFilter:

Public Types

typedef mitk::Image InputType
 The input image type. More...
 
- Public Types inherited from mitk::ContourModelSource
typedef ContourModel OutputType
 The output data type produced by this source. More...
 
typedef OutputType::Pointer OutputTypePointer
 Smart pointer type for the output. More...
 
- Public Types inherited from mitk::BaseDataSource
typedef BaseData OutputType
 Output data type. More...
 
typedef itk::DataObject::DataObjectIdentifierType DataObjectIdentifierType
 Identifier type for named data objects. More...
 

Public Member Functions

 mitkClassMacro (ImageToContourModelFilter, ContourModelSource)
 
Pointer Clone () const
 
virtual void SetInput (const InputType *input)
 Set the input image from which contours are extracted. More...
 
virtual void SetInput (unsigned int idx, const InputType *input)
 Set the input image at the given index. More...
 
const InputType * GetInput (void)
 Get the first input image. More...
 
const InputType * GetInput (unsigned int idx)
 Get the input image at the given index. More...
 
void SetContourValue (float contourValue)
 Set the iso-value at which contours are extracted. More...
 
float GetContourValue ()
 Get the current iso-value used for contour extraction. More...
 
- Public Member Functions inherited from mitk::ContourModelSource
 mitkClassMacro (ContourModelSource, BaseDataSource)
 
Pointer Clone () const
 
mitkBaseDataSourceGetOutputDeclarations itk::DataObject::Pointer MakeOutput (DataObjectPointerArraySizeType idx) override
 Allocate a new output object at the given index. More...
 
itk::DataObject::Pointer MakeOutput (const DataObjectIdentifierType &name) override
 Allocate a new output object by name. More...
 
- Public Member Functions inherited from mitk::BaseDataSource
 mitkClassMacroItkParent (BaseDataSource, itk::ProcessObject)
 
OutputType * GetOutput ()
 
const OutputType * GetOutput () const
 
OutputType * GetOutput (DataObjectPointerArraySizeType idx)
 
const OutputType * GetOutput (DataObjectPointerArraySizeType idx) const
 
virtual void GraftOutput (OutputType *output)
 Graft the specified BaseData onto this BaseDataSource's output. More...
 
virtual void GraftOutput (const DataObjectIdentifierType &key, OutputType *output)
 Graft the specified base data object onto a named output. More...
 
virtual void GraftNthOutput (unsigned int idx, OutputType *output)
 Graft the specified base data object onto this BaseDataSource's idx'th output. More...
 
bool Updating () const
 Check whether the pipeline is currently executing. More...
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from mitk::ContourModelSource
static Pointer New ()
 

Protected Member Functions

 ImageToContourModelFilter ()
 
 ~ImageToContourModelFilter () override
 
void GenerateData () override
 
template<typename TPixel , unsigned int VImageDimension>
void Itk2DContourExtraction (const itk::Image< TPixel, VImageDimension > *sliceImage)
 
- Protected Member Functions inherited from mitk::ContourModelSource
 ContourModelSource ()
 
 ~ContourModelSource () override
 
- Protected Member Functions inherited from mitk::BaseDataSource
 BaseDataSource ()
 Constructor. More...
 
 ~BaseDataSource () override
 Destructor. More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from mitk::BaseDataSource
static Pointer New ()
 

Detailed Description

Filter that extracts contour lines from a 2D image at a given iso-value.

Takes a 2D mitk::Image as input and extracts contour lines at the specified contour value (default: 0.5) using ITK's ContourExtractor2DImageFilter. The input image is padded by one pixel on each side to handle contours touching image boundaries. The extracted contours are output as closed ContourModel instances in world coordinates.

Precondition
The input image must be 2-dimensional.
See also
ContourModel, ContourModelSource, Image

Definition at line 37 of file mitkImageToContourModelFilter.h.

Member Typedef Documentation

◆ InputType

The input image type.

Definition at line 45 of file mitkImageToContourModelFilter.h.

Constructor & Destructor Documentation

◆ ImageToContourModelFilter()

mitk::ImageToContourModelFilter::ImageToContourModelFilter ( )
protected

◆ ~ImageToContourModelFilter()

mitk::ImageToContourModelFilter::~ImageToContourModelFilter ( )
overrideprotected

Member Function Documentation

◆ Clone()

Pointer mitk::ImageToContourModelFilter::Clone ( ) const

◆ GenerateData()

void mitk::ImageToContourModelFilter::GenerateData ( )
overrideprotected

◆ GetContourValue()

float mitk::ImageToContourModelFilter::GetContourValue ( )

Get the current iso-value used for contour extraction.

Returns
The contour iso-value.

◆ GetInput() [1/2]

const InputType* mitk::ImageToContourModelFilter::GetInput ( unsigned int  idx)

Get the input image at the given index.

Parameters
[in]idxInput port index.
Returns
Const pointer to the input Image, or nullptr if none is set.

◆ GetInput() [2/2]

const InputType* mitk::ImageToContourModelFilter::GetInput ( void  )

Get the first input image.

Returns
Const pointer to the input Image, or nullptr if none is set.

◆ Itk2DContourExtraction()

template<typename TPixel , unsigned int VImageDimension>
void mitk::ImageToContourModelFilter::Itk2DContourExtraction ( const itk::Image< TPixel, VImageDimension > *  sliceImage)
protected

◆ mitkClassMacro()

mitk::ImageToContourModelFilter::mitkClassMacro ( ImageToContourModelFilter  ,
ContourModelSource   
)

◆ New()

static Pointer mitk::ImageToContourModelFilter::New ( )
static

◆ SetContourValue()

void mitk::ImageToContourModelFilter::SetContourValue ( float  contourValue)

Set the iso-value at which contours are extracted.

Parameters
[in]contourValueThe iso-value threshold. Default is 0.5.

◆ SetInput() [1/2]

virtual void mitk::ImageToContourModelFilter::SetInput ( const InputType *  input)
virtual

Set the input image from which contours are extracted.

Parameters
[in]inputPointer to a 2D mitk::Image.

◆ SetInput() [2/2]

virtual void mitk::ImageToContourModelFilter::SetInput ( unsigned int  idx,
const InputType *  input 
)
virtual

Set the input image at the given index.

Parameters
[in]idxInput port index.
[in]inputPointer to a 2D mitk::Image.

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