Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::BoundingObjectCutAndCast< TPixel > Class Template Reference

Cuts a BoundingObject region out of an image and casts the result to a specific pixel type. More...

#include <mitkBoundingObjectCutAndCast.h>

Inheritance diagram for mitk::BoundingObjectCutAndCast< TPixel >:
Collaboration diagram for mitk::BoundingObjectCutAndCast< TPixel >:

Public Types

typedef TPixel PixelType
 The output pixel type for the cast operation. More...
 
- 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...
 

Public Member Functions

 mitkClassMacro (BoundingObjectCutAndCast, BoundingObjectCutter)
 
Pointer Clone () const
 
- Public Member Functions inherited from mitk::BoundingObjectCutter
 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::BoundingObjectCutter
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

 BoundingObjectCutAndCast ()
 
virtual ~BoundingObjectCutAndCast ()
 
virtual const std::type_info & GetOutputPixelType ()
 
virtual void ComputeData (mitk::Image *input3D, int boTimeStep)
 
- Protected Member Functions inherited from mitk::BoundingObjectCutter
 BoundingObjectCutter ()
 
 ~BoundingObjectCutter () override
 
void GenerateInputRequestedRegion () override
 
void GenerateOutputInformation () override
 
void GenerateData () override
 
- 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...
 

Additional Inherited Members

- 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 ()
 
- Protected Attributes inherited from mitk::BoundingObjectCutter
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
 

Detailed Description

template<typename TPixel>
class mitk::BoundingObjectCutAndCast< TPixel >

Cuts a BoundingObject region out of an image and casts the result to a specific pixel type.

This is a templated extension of BoundingObjectCutter that additionally casts the output image to the pixel type specified by the template parameter TPixel. Input parameters are a mitk::BoundingObject and optionally a mitk::Image. If no image is provided, the resulting image will have m_InsideValue as the pixel value for inside pixels. If an image is provided, inside pixels retain their original values. Pixels outside the BoundingObject are set to m_OutsideValue.

Template Parameters
TPixelThe desired output pixel type (e.g., short, float, unsigned char).
See also
BoundingObjectCutter
BoundingObject

Definition at line 40 of file mitkBoundingObjectCutAndCast.h.

Member Typedef Documentation

◆ PixelType

template<typename TPixel >
typedef TPixel mitk::BoundingObjectCutAndCast< TPixel >::PixelType

The output pixel type for the cast operation.

Definition at line 48 of file mitkBoundingObjectCutAndCast.h.

Constructor & Destructor Documentation

◆ BoundingObjectCutAndCast()

template<typename TPixel >
mitk::BoundingObjectCutAndCast< TPixel >::BoundingObjectCutAndCast ( )
protected

◆ ~BoundingObjectCutAndCast()

template<typename TPixel >
virtual mitk::BoundingObjectCutAndCast< TPixel >::~BoundingObjectCutAndCast ( )
protectedvirtual

Member Function Documentation

◆ Clone()

template<typename TPixel >
Pointer mitk::BoundingObjectCutAndCast< TPixel >::Clone ( ) const

◆ ComputeData()

template<typename TPixel >
virtual void mitk::BoundingObjectCutAndCast< TPixel >::ComputeData ( mitk::Image *  input3D,
int  boTimeStep 
)
protectedvirtual

Reimplemented from mitk::BoundingObjectCutter.

◆ GetOutputPixelType()

template<typename TPixel >
virtual const std::type_info& mitk::BoundingObjectCutAndCast< TPixel >::GetOutputPixelType ( )
protectedvirtual

Reimplemented from mitk::BoundingObjectCutter.

◆ mitkClassMacro()

template<typename TPixel >
mitk::BoundingObjectCutAndCast< TPixel >::mitkClassMacro ( BoundingObjectCutAndCast< TPixel >  ,
BoundingObjectCutter   
)

◆ New()

template<typename TPixel >
static Pointer mitk::BoundingObjectCutAndCast< TPixel >::New ( )
static

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