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

Filter for clipping an image with a PlaneGeometry. More...

#include <mitkGeometryClipImageFilter.h>

Inheritance diagram for mitk::GeometryClipImageFilter:
Collaboration diagram for mitk::GeometryClipImageFilter:

Public Member Functions

 mitkClassMacro (GeometryClipImageFilter, ImageToImageFilter)
 
Pointer Clone () const
 
void SetClippingGeometry (const mitk::BaseGeometry *aClippingGeometry)
 Set the clipping geometry (must be a PlaneGeometry). More...
 
void SetClippingGeometry (const mitk::TimeGeometry *aClippingGeometry)
 Set the clipping geometry as a TimeGeometry. More...
 
const mitk::BaseGeometry * GetClippingGeometry () const
 Get the clipping geometry for a single time step. More...
 
const mitk::TimeGeometry * GetClippingTimeGeometry () const
 Get the clipping time geometry (if set). More...
 
virtual bool GetClipPartAboveGeometry () const
 Get whether the part above the geometry is clipped (default: true). More...
 
virtual void SetClipPartAboveGeometry (bool _arg)
 Set whether the part above or below the geometry shall be clipped (default: true). More...
 
virtual void ClipPartAboveGeometryOn ()
 Toggle ClipPartAboveGeometry on/off. More...
 
virtual void ClipPartAboveGeometryOff ()
 
virtual void SetOutsideValue (ScalarType _arg)
 Set the value for outside (clipped) pixels (default: 0). More...
 
virtual ScalarType GetOutsideValue () const
 Get the value for outside (clipped) pixels. More...
 
virtual void SetAutoOutsideValue (bool _arg)
 Set whether to automatically use the pixel type minimum as outside value (default: false). More...
 
virtual bool GetAutoOutsideValue () const
 Get whether the outside value is automatically determined. More...
 
virtual void AutoOutsideValueOn ()
 Toggle AutoOutsideValue on/off. More...
 
virtual void AutoOutsideValueOff ()
 
virtual void SetAutoOrientLabels (bool _arg)
 Set whether to auto-orient labels like vtkPolyDataNormals. More...
 
virtual bool GetAutoOrientLabels () const
 Get whether automatic label orientation is enabled. More...
 
virtual void SetLabelBothSides (bool _arg)
 Set whether both sides of the clipping geometry are labeled (default: false). More...
 
virtual bool GetLabelBothSides () const
 Get whether both sides labeling is enabled. More...
 
virtual void LabelBothSidesOn ()
 Toggle LabelBothSides on/off. More...
 
virtual void LabelBothSidesOff ()
 
virtual void SetAboveGeometryLabel (ScalarType _arg)
 Set the label value for voxels above the clipping geometry. More...
 
virtual ScalarType GetAboveGeometryLabel () const
 Get the label value for voxels above the clipping geometry. More...
 
virtual void SetBelowGeometryLabel (ScalarType _arg)
 Set the label value for voxels below the clipping geometry. More...
 
virtual ScalarType GetBelowGeometryLabel () const
 Get the label value for voxels below the clipping geometry. More...
 
- Public Member Functions inherited from mitk::ImageToImageFilter
 mitkClassMacro (ImageToImageFilter, ImageSource)
 
Pointer Clone () const
 
virtual void SetInput (const InputImageType *image)
 Set the image input of this process object. More...
 
virtual void SetInput (unsigned int idx, const InputImageType *image)
 Set the image input at the specified index. More...
 
InputImageType * GetInput (void)
 Get the input image (non-const). More...
 
InputImageType * GetInput (unsigned int idx)
 Get the input image at the specified index (non-const). More...
 
const InputImageType * GetInput (void) const
 Get the input image (const). More...
 
const InputImageType * GetInput (unsigned int idx) const
 Get the input image at the specified index (const). More...
 
- Public Member Functions inherited from mitk::ImageSource
 mitkClassMacro (ImageSource, BaseDataSource)
 
Pointer Clone () const
 
mitkBaseDataSourceGetOutputDeclarations itk::DataObject::Pointer MakeOutput (DataObjectPointerArraySizeType idx) override
 Get the output data of this image source object. More...
 
itk::DataObject::Pointer MakeOutput (const DataObjectIdentifierType &name) override
 
virtual vtkImageData * GetVtkImageData ()
 Get the output as VTK image data (non-const version). More...
 
virtual const vtkImageData * GetVtkImageData () const
 Get the output as VTK image data (const version). 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::ImageToImageFilter
static Pointer New ()
 Method for creation through the object factory. More...
 
- Static Public Member Functions inherited from mitk::ImageSource
static Pointer New ()
 Method for creation through the object factory. More...
 

Protected Member Functions

 GeometryClipImageFilter ()
 
 ~GeometryClipImageFilter () override
 
void GenerateInputRequestedRegion () override
 
void GenerateOutputInformation () override
 
void GenerateData () override
 
template<typename TPixel , unsigned int VImageDimension>
void _InternalComputeClippedImage (itk::Image< TPixel, VImageDimension > *itkImage, mitk::GeometryClipImageFilter *geometryClipper, const mitk::PlaneGeometry *clippingPlaneGeometry)
 
- Protected Member Functions inherited from mitk::ImageToImageFilter
 ImageToImageFilter ()
 
 ~ImageToImageFilter () override
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 Print self information to the given stream. More...
 
void GenerateInputRequestedRegion () override
 Determine the input requested region to produce the output requested region. More...
 
- Protected Member Functions inherited from mitk::ImageSource
 ImageSource ()
 
 ~ImageSource () override
 
void GenerateData () override
 A version of GenerateData() specific for image processing filters. More...
 
virtual void ThreadedGenerateData (const OutputImageRegionType &outputRegionForThread, itk::ThreadIdType threadId)
 If an imaging filter can be implemented as a multithreaded algorithm, the filter will provide an implementation of ThreadedGenerateData(). More...
 
void PrepareOutputs () override
 This method is intentionally left blank. More...
 
virtual void AllocateOutputs ()
 The GenerateData method normally allocates the buffers for all of the outputs of a filter. More...
 
virtual void BeforeThreadedGenerateData ()
 If an imaging filter needs to perform processing after the buffer has been allocated but before threads are spawned, the filter can provide an implementation for BeforeThreadedGenerateData(). More...
 
virtual void AfterThreadedGenerateData ()
 If an imaging filter needs to perform processing after all processing threads have completed, the filter can provide an implementation for AfterThreadedGenerateData(). More...
 
virtual unsigned int SplitRequestedRegion (unsigned int i, unsigned int num, OutputImageRegionType &splitRegion)
 Split the output's RequestedRegion into "num" pieces, returning region "i" as "splitRegion". More...
 
- Protected Member Functions inherited from mitk::BaseDataSource
 BaseDataSource ()
 Constructor. More...
 
 ~BaseDataSource () override
 Destructor. More...
 

Protected Attributes

mitk::BaseGeometry::ConstPointer m_ClippingGeometry
 
mitk::GeometryData::Pointer m_ClippingGeometryData
 
mitk::TimeGeometry::ConstPointer m_TimeClippingGeometry
 
mitk::ImageTimeSelector::Pointer m_InputTimeSelector
 
mitk::ImageTimeSelector::Pointer m_OutputTimeSelector
 
bool m_ClipPartAboveGeometry
 Defines whether the part above or below the geometry shall be clipped (default: true). More...
 
ScalarType m_OutsideValue
 Value for outside pixels (default: 0). Used only if m_AutoOutsideValue is false. More...
 
bool m_AutoOutsideValue
 If true, the minimum of the output pixel type is used as outside value (default: false). More...
 
bool m_LabelBothSides
 If true, all pixels above and below the geometry are labeled with m_AboveGeometryLabel and m_BelowGeometryLabel. More...
 
bool m_AutoOrientLabels
 Orient above like vtkPolyDataNormals does with AutoOrientNormals. More...
 
ScalarType m_AboveGeometryLabel
 Label value for pixels above the geometry when m_LabelBothSides is on. More...
 
ScalarType m_BelowGeometryLabel
 Label value for pixels below the geometry when m_LabelBothSides is on. More...
 
itk::TimeStamp m_TimeOfHeaderInitialization
 Time when header was last initialized. More...
 

Additional Inherited Members

- Public Types inherited from mitk::ImageToImageFilter
typedef Superclass::OutputImageRegionType OutputImageRegionType
 Superclass typedefs. More...
 
typedef mitk::Image InputImageType
 Some convenient typedefs. More...
 
typedef InputImageType::Pointer InputImagePointer
 
typedef InputImageType::ConstPointer InputImageConstPointer
 
typedef SlicedData::RegionType InputImageRegionType
 
- Public Types inherited from mitk::ImageSource
typedef mitk::Image OutputImageType
 Some convenient typedefs. More...
 
typedef OutputImageType OutputType
 
typedef OutputImageType::Pointer OutputImagePointer
 
typedef SlicedData::RegionType OutputImageRegionType
 
- 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...
 
- Static Protected Member Functions inherited from mitk::ImageSource
static itk::ITK_THREAD_RETURN_TYPE ThreaderCallback (void *arg)
 Static function used as a "callback" by the MultiThreader. More...
 
- Static Protected Member Functions inherited from mitk::BaseDataSource
static Pointer New ()
 

Detailed Description

Filter for clipping an image with a PlaneGeometry.

This filter clips an image along a plane defined by a PlaneGeometry. The clipping geometry can be either a single PlaneGeometry or a TimeGeometry containing PlaneGeometry instances for multiple time steps. Pixels on one side of the plane are set to an outside value (or labeled), while pixels on the other side retain their original values.

The filter supports several modes:

  • Simple clipping with a constant outside value
  • Automatic outside value (minimum of the pixel type)
  • Labeling both sides of the plane with distinct labels
See also
PlaneGeometry
HeightFieldSurfaceClipImageFilter

Definition at line 48 of file mitkGeometryClipImageFilter.h.

Constructor & Destructor Documentation

◆ GeometryClipImageFilter()

mitk::GeometryClipImageFilter::GeometryClipImageFilter ( )
protected

◆ ~GeometryClipImageFilter()

mitk::GeometryClipImageFilter::~GeometryClipImageFilter ( )
overrideprotected

Member Function Documentation

◆ _InternalComputeClippedImage()

template<typename TPixel , unsigned int VImageDimension>
void mitk::GeometryClipImageFilter::_InternalComputeClippedImage ( itk::Image< TPixel, VImageDimension > *  itkImage,
mitk::GeometryClipImageFilter *  geometryClipper,
const mitk::PlaneGeometry *  clippingPlaneGeometry 
)
protected

◆ AutoOutsideValueOff()

virtual void mitk::GeometryClipImageFilter::AutoOutsideValueOff ( )
virtual

◆ AutoOutsideValueOn()

virtual void mitk::GeometryClipImageFilter::AutoOutsideValueOn ( )
virtual

Toggle AutoOutsideValue on/off.

◆ ClipPartAboveGeometryOff()

virtual void mitk::GeometryClipImageFilter::ClipPartAboveGeometryOff ( )
virtual

◆ ClipPartAboveGeometryOn()

virtual void mitk::GeometryClipImageFilter::ClipPartAboveGeometryOn ( )
virtual

Toggle ClipPartAboveGeometry on/off.

◆ Clone()

Pointer mitk::GeometryClipImageFilter::Clone ( ) const

◆ GenerateData()

void mitk::GeometryClipImageFilter::GenerateData ( )
overrideprotected

◆ GenerateInputRequestedRegion()

void mitk::GeometryClipImageFilter::GenerateInputRequestedRegion ( )
overrideprotected

◆ GenerateOutputInformation()

void mitk::GeometryClipImageFilter::GenerateOutputInformation ( )
overrideprotected

◆ GetAboveGeometryLabel()

virtual ScalarType mitk::GeometryClipImageFilter::GetAboveGeometryLabel ( ) const
virtual

Get the label value for voxels above the clipping geometry.

Returns
The above-geometry label value.

◆ GetAutoOrientLabels()

virtual bool mitk::GeometryClipImageFilter::GetAutoOrientLabels ( ) const
virtual

Get whether automatic label orientation is enabled.

Returns
True if automatic label orientation is enabled.

◆ GetAutoOutsideValue()

virtual bool mitk::GeometryClipImageFilter::GetAutoOutsideValue ( ) const
virtual

Get whether the outside value is automatically determined.

Returns
True if automatic outside value is enabled.

◆ GetBelowGeometryLabel()

virtual ScalarType mitk::GeometryClipImageFilter::GetBelowGeometryLabel ( ) const
virtual

Get the label value for voxels below the clipping geometry.

Returns
The below-geometry label value.

◆ GetClipPartAboveGeometry()

virtual bool mitk::GeometryClipImageFilter::GetClipPartAboveGeometry ( ) const
virtual

Get whether the part above the geometry is clipped (default: true).

Returns
True if the part above the geometry is clipped.

◆ GetClippingGeometry()

const mitk::BaseGeometry* mitk::GeometryClipImageFilter::GetClippingGeometry ( ) const

Get the clipping geometry for a single time step.

Returns
Const pointer to the clipping BaseGeometry.

◆ GetClippingTimeGeometry()

const mitk::TimeGeometry* mitk::GeometryClipImageFilter::GetClippingTimeGeometry ( ) const

Get the clipping time geometry (if set).

Returns
Const pointer to the clipping TimeGeometry, or nullptr.

◆ GetLabelBothSides()

virtual bool mitk::GeometryClipImageFilter::GetLabelBothSides ( ) const
virtual

Get whether both sides labeling is enabled.

Returns
True if both sides are labeled.

◆ GetOutsideValue()

virtual ScalarType mitk::GeometryClipImageFilter::GetOutsideValue ( ) const
virtual

Get the value for outside (clipped) pixels.

Returns
The outside pixel value.

◆ LabelBothSidesOff()

virtual void mitk::GeometryClipImageFilter::LabelBothSidesOff ( )
virtual

◆ LabelBothSidesOn()

virtual void mitk::GeometryClipImageFilter::LabelBothSidesOn ( )
virtual

Toggle LabelBothSides on/off.

◆ mitkClassMacro()

mitk::GeometryClipImageFilter::mitkClassMacro ( GeometryClipImageFilter  ,
ImageToImageFilter   
)

◆ New()

static Pointer mitk::GeometryClipImageFilter::New ( )
static

◆ SetAboveGeometryLabel()

virtual void mitk::GeometryClipImageFilter::SetAboveGeometryLabel ( ScalarType  _arg)
virtual

Set the label value for voxels above the clipping geometry.

Only used when LabelBothSides is true.

Parameters
[in]_argThe above-geometry label value.

◆ SetAutoOrientLabels()

virtual void mitk::GeometryClipImageFilter::SetAutoOrientLabels ( bool  _arg)
virtual

Set whether to auto-orient labels like vtkPolyDataNormals.

Parameters
[in]_argTrue to enable automatic label orientation.

◆ SetAutoOutsideValue()

virtual void mitk::GeometryClipImageFilter::SetAutoOutsideValue ( bool  _arg)
virtual

Set whether to automatically use the pixel type minimum as outside value (default: false).

Parameters
[in]_argTrue to use automatic outside value.

◆ SetBelowGeometryLabel()

virtual void mitk::GeometryClipImageFilter::SetBelowGeometryLabel ( ScalarType  _arg)
virtual

Set the label value for voxels below the clipping geometry.

Only used when LabelBothSides is true.

Parameters
[in]_argThe below-geometry label value.

◆ SetClipPartAboveGeometry()

virtual void mitk::GeometryClipImageFilter::SetClipPartAboveGeometry ( bool  _arg)
virtual

Set whether the part above or below the geometry shall be clipped (default: true).

Parameters
[in]_argTrue to clip above, false to clip below.

◆ SetClippingGeometry() [1/2]

void mitk::GeometryClipImageFilter::SetClippingGeometry ( const mitk::BaseGeometry *  aClippingGeometry)

Set the clipping geometry (must be a PlaneGeometry).

Parameters
[in]aClippingGeometryThe PlaneGeometry used for clipping.

◆ SetClippingGeometry() [2/2]

void mitk::GeometryClipImageFilter::SetClippingGeometry ( const mitk::TimeGeometry *  aClippingGeometry)

Set the clipping geometry as a TimeGeometry.

The TimeGeometry must contain PlaneGeometry instances, one per time step.

Parameters
[in]aClippingGeometryThe TimeGeometry containing PlaneGeometry instances.

◆ SetLabelBothSides()

virtual void mitk::GeometryClipImageFilter::SetLabelBothSides ( bool  _arg)
virtual

Set whether both sides of the clipping geometry are labeled (default: false).

When enabled, pixels above the geometry receive AboveGeometryLabel and pixels below receive BelowGeometryLabel.

Parameters
[in]_argTrue to label both sides.

◆ SetOutsideValue()

virtual void mitk::GeometryClipImageFilter::SetOutsideValue ( ScalarType  _arg)
virtual

Set the value for outside (clipped) pixels (default: 0).

Only used when AutoOutsideValue is false.

Parameters
[in]_argThe outside pixel value.

Member Data Documentation

◆ m_AboveGeometryLabel

ScalarType mitk::GeometryClipImageFilter::m_AboveGeometryLabel
protected

Label value for pixels above the geometry when m_LabelBothSides is on.

Definition at line 234 of file mitkGeometryClipImageFilter.h.

◆ m_AutoOrientLabels

bool mitk::GeometryClipImageFilter::m_AutoOrientLabels
protected

Orient above like vtkPolyDataNormals does with AutoOrientNormals.

Definition at line 231 of file mitkGeometryClipImageFilter.h.

◆ m_AutoOutsideValue

bool mitk::GeometryClipImageFilter::m_AutoOutsideValue
protected

If true, the minimum of the output pixel type is used as outside value (default: false).

Definition at line 221 of file mitkGeometryClipImageFilter.h.

◆ m_BelowGeometryLabel

ScalarType mitk::GeometryClipImageFilter::m_BelowGeometryLabel
protected

Label value for pixels below the geometry when m_LabelBothSides is on.

Definition at line 237 of file mitkGeometryClipImageFilter.h.

◆ m_ClipPartAboveGeometry

bool mitk::GeometryClipImageFilter::m_ClipPartAboveGeometry
protected

Defines whether the part above or below the geometry shall be clipped (default: true).

Definition at line 213 of file mitkGeometryClipImageFilter.h.

◆ m_ClippingGeometry

mitk::BaseGeometry::ConstPointer mitk::GeometryClipImageFilter::m_ClippingGeometry
protected

Definition at line 206 of file mitkGeometryClipImageFilter.h.

◆ m_ClippingGeometryData

mitk::GeometryData::Pointer mitk::GeometryClipImageFilter::m_ClippingGeometryData
protected

Definition at line 207 of file mitkGeometryClipImageFilter.h.

◆ m_InputTimeSelector

mitk::ImageTimeSelector::Pointer mitk::GeometryClipImageFilter::m_InputTimeSelector
protected

Definition at line 209 of file mitkGeometryClipImageFilter.h.

◆ m_LabelBothSides

bool mitk::GeometryClipImageFilter::m_LabelBothSides
protected

If true, all pixels above and below the geometry are labeled with m_AboveGeometryLabel and m_BelowGeometryLabel.

Definition at line 226 of file mitkGeometryClipImageFilter.h.

◆ m_OutputTimeSelector

mitk::ImageTimeSelector::Pointer mitk::GeometryClipImageFilter::m_OutputTimeSelector
protected

Definition at line 210 of file mitkGeometryClipImageFilter.h.

◆ m_OutsideValue

ScalarType mitk::GeometryClipImageFilter::m_OutsideValue
protected

Value for outside pixels (default: 0). Used only if m_AutoOutsideValue is false.

Definition at line 218 of file mitkGeometryClipImageFilter.h.

◆ m_TimeClippingGeometry

mitk::TimeGeometry::ConstPointer mitk::GeometryClipImageFilter::m_TimeClippingGeometry
protected

Definition at line 208 of file mitkGeometryClipImageFilter.h.

◆ m_TimeOfHeaderInitialization

itk::TimeStamp mitk::GeometryClipImageFilter::m_TimeOfHeaderInitialization
protected

Time when header was last initialized.

Definition at line 240 of file mitkGeometryClipImageFilter.h.


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