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

Cuts a BoundingObject region out of a mitk::Image. More...

#include <mitkBoundingObjectCutter.h>

Inheritance diagram for mitk::BoundingObjectCutter:
Collaboration diagram for mitk::BoundingObjectCutter:

Public Member Functions

 mitkClassMacro (BoundingObjectCutter, ImageToImageFilter)
 
Pointer Clone () const
 
void SetBoundingObject (const mitk::BoundingObject *boundingObject)
 Set the bounding object that defines the cutting region. More...
 
const mitk::BoundingObject * GetBoundingObject () const
 Get the bounding object that defines the cutting region. More...
 
virtual void SetInsideValue (ScalarType _arg)
 Set the pixel value for inside pixels, used when m_UseInsideValue is true. More...
 
virtual ScalarType GetInsideValue ()
 Get the pixel value for inside pixels. More...
 
virtual void SetOutsideValue (ScalarType _arg)
 Set the pixel value for outside pixels, used when m_AutoOutsideValue is false. More...
 
virtual ScalarType GetOutsideValue ()
 Get the pixel value for outside pixels. More...
 
virtual void SetUseInsideValue (bool _arg)
 Set whether to use m_InsideValue for inside pixels (default: false). More...
 
virtual bool GetUseInsideValue ()
 Get whether m_InsideValue is used for inside pixels. More...
 
virtual void UseInsideValueOn ()
 Toggle UseInsideValue on/off. More...
 
virtual void UseInsideValueOff ()
 
virtual void SetAutoOutsideValue (bool _arg)
 Set whether to automatically determine the outside value. More...
 
virtual bool GetAutoOutsideValue ()
 Get whether the outside value is automatically determined. More...
 
virtual void AutoOutsideValueOn ()
 Toggle AutoOutsideValue on/off. More...
 
virtual void AutoOutsideValueOff ()
 
virtual unsigned int GetInsidePixelCount ()
 Get the number of pixels inside the bounding object after the last execution. More...
 
virtual unsigned int GetOutsidePixelCount ()
 Get the number of pixels outside the bounding object after the last execution. More...
 
virtual void SetUseWholeInputRegion (bool _arg)
 Set whether to use the whole input region instead of a subregion. More...
 
virtual bool GetUseWholeInputRegion ()
 Get whether the whole input region is used. 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

 BoundingObjectCutter ()
 
 ~BoundingObjectCutter () override
 
virtual const PixelType GetOutputPixelType ()
 
void GenerateInputRequestedRegion () override
 
void GenerateOutputInformation () override
 
void GenerateData () override
 
virtual void ComputeData (mitk::Image *input3D, int boTimeStep)
 
- 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::BoundingObject::Pointer m_BoundingObject
 BoundingObject that will be cut. More...
 
ScalarType m_InsideValue
 Value for inside pixels, used when m_UseInsideValue is 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_UseInsideValue
 Use m_InsideValue for inside pixels (default: false). More...
 
unsigned int m_OutsidePixelCount
 
unsigned int m_InsidePixelCount
 
mitk::SlicedData::RegionType m_InputRequestedRegion
 Region of input needed for cutting. More...
 
itk::TimeStamp m_TimeOfHeaderInitialization
 Time when header was last initialized. More...
 
mitk::ImageTimeSelector::Pointer m_InputTimeSelector
 
mitk::ImageTimeSelector::Pointer m_OutputTimeSelector
 
bool m_UseWholeInputRegion
 

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

Cuts a BoundingObject region out of a mitk::Image.

This filter extracts the region defined by a BoundingObject from an input image. If no input image is provided, inside pixels are filled with m_InsideValue. If an input image is provided, inside pixels retain the original image values (unless m_UseInsideValue is set to true, in which case they are replaced with m_InsideValue). Pixels outside the BoundingObject are set to m_OutsideValue (or the pixel type minimum if m_AutoOutsideValue is true).

See also
BoundingObject
BoundingObjectCutAndCast
BoundingObjectToSegmentationFilter

Definition at line 40 of file mitkBoundingObjectCutter.h.

Constructor & Destructor Documentation

◆ BoundingObjectCutter()

mitk::BoundingObjectCutter::BoundingObjectCutter ( )
protected

◆ ~BoundingObjectCutter()

mitk::BoundingObjectCutter::~BoundingObjectCutter ( )
overrideprotected

Member Function Documentation

◆ AutoOutsideValueOff()

virtual void mitk::BoundingObjectCutter::AutoOutsideValueOff ( )
virtual

◆ AutoOutsideValueOn()

virtual void mitk::BoundingObjectCutter::AutoOutsideValueOn ( )
virtual

Toggle AutoOutsideValue on/off.

◆ Clone()

Pointer mitk::BoundingObjectCutter::Clone ( ) const

◆ ComputeData()

virtual void mitk::BoundingObjectCutter::ComputeData ( mitk::Image *  input3D,
int  boTimeStep 
)
protectedvirtual

◆ GenerateData()

void mitk::BoundingObjectCutter::GenerateData ( )
overrideprotected

◆ GenerateInputRequestedRegion()

void mitk::BoundingObjectCutter::GenerateInputRequestedRegion ( )
overrideprotected

◆ GenerateOutputInformation()

void mitk::BoundingObjectCutter::GenerateOutputInformation ( )
overrideprotected

◆ GetAutoOutsideValue()

virtual bool mitk::BoundingObjectCutter::GetAutoOutsideValue ( )
virtual

Get whether the outside value is automatically determined.

Returns
True if automatic outside value is enabled.

◆ GetBoundingObject()

const mitk::BoundingObject* mitk::BoundingObjectCutter::GetBoundingObject ( ) const

Get the bounding object that defines the cutting region.

Returns
Const pointer to the bounding object.

◆ GetInsidePixelCount()

virtual unsigned int mitk::BoundingObjectCutter::GetInsidePixelCount ( )
virtual

Get the number of pixels inside the bounding object after the last execution.

Returns
The inside pixel count.

◆ GetInsideValue()

virtual ScalarType mitk::BoundingObjectCutter::GetInsideValue ( )
virtual

Get the pixel value for inside pixels.

Returns
The inside pixel value.

◆ GetOutputPixelType()

virtual const PixelType mitk::BoundingObjectCutter::GetOutputPixelType ( )
protectedvirtual

◆ GetOutsidePixelCount()

virtual unsigned int mitk::BoundingObjectCutter::GetOutsidePixelCount ( )
virtual

Get the number of pixels outside the bounding object after the last execution.

Returns
The outside pixel count.

◆ GetOutsideValue()

virtual ScalarType mitk::BoundingObjectCutter::GetOutsideValue ( )
virtual

Get the pixel value for outside pixels.

Returns
The outside pixel value.

◆ GetUseInsideValue()

virtual bool mitk::BoundingObjectCutter::GetUseInsideValue ( )
virtual

Get whether m_InsideValue is used for inside pixels.

Returns
True if inside pixels are replaced with m_InsideValue.

◆ GetUseWholeInputRegion()

virtual bool mitk::BoundingObjectCutter::GetUseWholeInputRegion ( )
virtual

Get whether the whole input region is used.

Returns
True if using the whole input region.

◆ mitkClassMacro()

mitk::BoundingObjectCutter::mitkClassMacro ( BoundingObjectCutter  ,
ImageToImageFilter   
)

◆ New()

static Pointer mitk::BoundingObjectCutter::New ( )
static

◆ SetAutoOutsideValue()

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

Set whether to automatically determine the outside value.

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

Parameters
[in]_argTrue to use automatic outside value.

◆ SetBoundingObject()

void mitk::BoundingObjectCutter::SetBoundingObject ( const mitk::BoundingObject *  boundingObject)

Set the bounding object that defines the cutting region.

Parameters
[in]boundingObjectThe bounding object to use.

◆ SetInsideValue()

virtual void mitk::BoundingObjectCutter::SetInsideValue ( ScalarType  _arg)
virtual

Set the pixel value for inside pixels, used when m_UseInsideValue is true.

Parameters
[in]_argThe inside pixel value.

◆ SetOutsideValue()

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

Set the pixel value for outside pixels, used when m_AutoOutsideValue is false.

Parameters
[in]_argThe outside pixel value (default: 0).

◆ SetUseInsideValue()

virtual void mitk::BoundingObjectCutter::SetUseInsideValue ( bool  _arg)
virtual

Set whether to use m_InsideValue for inside pixels (default: false).

If true, all pixels inside the bounding object are set to m_InsideValue. If false, they retain their original image values.

Parameters
[in]_argTrue to replace inside pixels with m_InsideValue.

◆ SetUseWholeInputRegion()

virtual void mitk::BoundingObjectCutter::SetUseWholeInputRegion ( bool  _arg)
virtual

Set whether to use the whole input region instead of a subregion.

Parameters
[in]_argTrue to use the whole input region.

◆ UseInsideValueOff()

virtual void mitk::BoundingObjectCutter::UseInsideValueOff ( )
virtual

◆ UseInsideValueOn()

virtual void mitk::BoundingObjectCutter::UseInsideValueOn ( )
virtual

Toggle UseInsideValue on/off.

Member Data Documentation

◆ m_AutoOutsideValue

bool mitk::BoundingObjectCutter::m_AutoOutsideValue
protected

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

Definition at line 189 of file mitkBoundingObjectCutter.h.

◆ m_BoundingObject

mitk::BoundingObject::Pointer mitk::BoundingObjectCutter::m_BoundingObject
protected

BoundingObject that will be cut.

Definition at line 176 of file mitkBoundingObjectCutter.h.

◆ m_InputRequestedRegion

mitk::SlicedData::RegionType mitk::BoundingObjectCutter::m_InputRequestedRegion
protected

Region of input needed for cutting.

Definition at line 203 of file mitkBoundingObjectCutter.h.

◆ m_InputTimeSelector

mitk::ImageTimeSelector::Pointer mitk::BoundingObjectCutter::m_InputTimeSelector
protected

Definition at line 208 of file mitkBoundingObjectCutter.h.

◆ m_InsidePixelCount

unsigned int mitk::BoundingObjectCutter::m_InsidePixelCount
protected

Definition at line 200 of file mitkBoundingObjectCutter.h.

◆ m_InsideValue

ScalarType mitk::BoundingObjectCutter::m_InsideValue
protected

Value for inside pixels, used when m_UseInsideValue is true.

See also
m_UseInsideValue

Definition at line 181 of file mitkBoundingObjectCutter.h.

◆ m_OutputTimeSelector

mitk::ImageTimeSelector::Pointer mitk::BoundingObjectCutter::m_OutputTimeSelector
protected

Definition at line 209 of file mitkBoundingObjectCutter.h.

◆ m_OutsidePixelCount

unsigned int mitk::BoundingObjectCutter::m_OutsidePixelCount
protected

Definition at line 199 of file mitkBoundingObjectCutter.h.

◆ m_OutsideValue

ScalarType mitk::BoundingObjectCutter::m_OutsideValue
protected

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

Definition at line 186 of file mitkBoundingObjectCutter.h.

◆ m_TimeOfHeaderInitialization

itk::TimeStamp mitk::BoundingObjectCutter::m_TimeOfHeaderInitialization
protected

Time when header was last initialized.

Definition at line 206 of file mitkBoundingObjectCutter.h.

◆ m_UseInsideValue

bool mitk::BoundingObjectCutter::m_UseInsideValue
protected

Use m_InsideValue for inside pixels (default: false).

If true, pixels that are inside m_BoundingObject will get m_InsideValue in the cutting process. If false, they keep their original value.

See also
m_InsideValue

Definition at line 197 of file mitkBoundingObjectCutter.h.

◆ m_UseWholeInputRegion

bool mitk::BoundingObjectCutter::m_UseWholeInputRegion
protected

Definition at line 211 of file mitkBoundingObjectCutter.h.


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