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

Applies a common filter-pipeline to the first input of this filter. More...

#include <mitkToFCompositeFilter.h>

Inheritance diagram for mitk::ToFCompositeFilter:
Collaboration diagram for mitk::ToFCompositeFilter:

Public Member Functions

 mitkClassMacro (ToFCompositeFilter, ImageToImageFilter)
 
Pointer Clone () const
 
virtual void SetSegmentationMask (mitk::Image::Pointer _arg)
 
virtual void SetApplyTemporalMedianFilter (bool _arg)
 
virtual bool GetApplyTemporalMedianFilter () const
 
virtual void SetApplyAverageFilter (bool _arg)
 
virtual bool GetApplyAverageFilter () const
 
virtual void SetApplyMedianFilter (bool _arg)
 
virtual bool GetApplyMedianFilter () const
 
virtual void SetApplyThresholdFilter (bool _arg)
 
virtual bool GetApplyThresholdFilter () const
 
virtual void SetApplyMaskSegmentation (bool _arg)
 
virtual bool GetApplyMaskSegmentation () const
 
virtual void SetApplyBilateralFilter (bool _arg)
 
virtual bool GetApplyBilateralFilter () const
 
void SetInput (const InputImageType *distanceImage) override
 sets the input of this filter More...
 
void SetInput (unsigned int idx, const InputImageType *distanceImage) override
 sets the input of this filter at idx More...
 
ImageGetInput ()
 returns the input of this filter More...
 
ImageGetInput (unsigned int idx)
 returns the input with id idx of this filter More...
 
void SetTemporalMedianFilterParameter (int tmporalMedianFilterNumOfFrames)
 Sets the parameter of the temporal median filter. More...
 
void SetThresholdFilterParameter (int min, int max)
 Sets the parameters (lower, upper threshold) of the threshold filter. More...
 
void SetBilateralFilterParameter (double domainSigma, double rangeSigma, int kernelRadius)
 Sets the parameters (domain sigma, range sigma, kernel radius) of the bilateral filter. More...
 
- Public Member Functions inherited from mitk::ImageToImageFilter
virtual std::vector< std::string > GetClassHierarchy () const override
 
virtual const char * GetClassName () const
 
Pointer Clone () const
 
InputImageTypeGetInput (void)
 
InputImageTypeGetInput (unsigned int idx)
 
const InputImageTypeGetInput (void) const
 
const InputImageTypeGetInput (unsigned int idx) const
 
- Public Member Functions inherited from mitk::ImageSource
Pointer Clone () const
 
OutputTypeGetOutput ()
 Get the output data of this image source object. More...
 
const OutputTypeGetOutput () const
 
OutputTypeGetOutput (DataObjectPointerArraySizeType idx)
 
const OutputTypeGetOutput (DataObjectPointerArraySizeType idx) const
 
itk::DataObject::Pointer MakeOutput (DataObjectPointerArraySizeType idx) override
 Make a DataObject of the correct type to used as the specified output. More...
 
itk::DataObject::Pointer MakeOutput (const DataObjectIdentifierType &name) override
 
virtual vtkImageData * GetVtkImageData ()
 
virtual const vtkImageData * GetVtkImageData () const
 
- Public Member Functions inherited from mitk::BaseDataSource
OutputTypeGetOutput ()
 
const OutputTypeGetOutput () const
 
OutputTypeGetOutput (DataObjectPointerArraySizeType idx)
 
const OutputTypeGetOutput (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)
 
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
 Access itk::ProcessObject::m_Updating. More...
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from mitk::ImageToImageFilter
static const char * GetStaticNameOfClass ()
 
static Pointer New ()
 
- Static Public Member Functions inherited from mitk::ImageSource
static const char * GetStaticNameOfClass ()
 
static Pointer New ()
 Method for creation through the object factory. More...
 
- Static Public Member Functions inherited from mitk::BaseDataSource
static const char * GetStaticNameOfClass ()
 

Protected Member Functions

 ToFCompositeFilter ()
 standard constructor More...
 
 ~ToFCompositeFilter () override
 standard destructor More...
 
void GenerateOutputInformation () override
 
void GenerateData () override
 method generating the output of this filter. Called in the updated process of the pipeline. This method generates the output of the ToFSurfaceSource: The generated surface of the 3d points More...
 
void CreateOutputsForAllInputs ()
 Create an output for each input. More...
 
void ProcessSegmentation (IplImage *inputIplImage)
 Applies a mask and/or threshold segmentation to the input image. All pixels with values outside the mask, below the lower threshold (min) and above the upper threshold (max) are assigned the pixel value 0. More...
 
ItkImageType2D::Pointer ProcessItkBilateralFilter (ItkImageType2D::Pointer inputItkImage)
 Applies the ITK bilateral filter to the input image. More...
 
void ProcessCVBilateralFilter (IplImage *inputIplImage, IplImage *outputIplImage)
 Applies the OpenCV bilateral filter to the input image. More...
 
void ProcessCVMedianFilter (IplImage *inputIplImage, IplImage *outputIplImage, int radius=3)
 Applies the OpenCV median filter to the input image. More...
 
void ProcessStreamedQuickSelectMedianImageFilter (IplImage *inputIplImage)
 Performs temporal median filter on an image given the number of frames to be considered. More...
 
float quick_select (float arr[], int n)
 Quickselect algorithm This Quickselect routine is based on the algorithm described in "Numerical recipes in C", Second Edition, Cambridge University Press, 1992, Section 8.5, ISBN 0-521-43108-5 This code by Nicolas Devillard - 1998. Public domain. More...
 
void CreateItkImage (ItkImageType2D::Pointer &itkInputImage)
 Initialize and allocate a 2D ITK image of dimension m_ImageWidth*m_ImageHeight. More...
 
- Protected Member Functions inherited from mitk::ImageToImageFilter
 ImageToImageFilter ()
 
 ~ImageToImageFilter () override
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
void GenerateInputRequestedRegion () override
 
- 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 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 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 ()
 
 ~BaseDataSource () override
 

Protected Attributes

mitk::Image::Pointer m_SegmentationMask
 mask image used for segmenting the image More...
 
int m_ImageWidth
 x-dimension of the image More...
 
int m_ImageHeight
 y-dimension of the image More...
 
int m_ImageSize
 size of the image in bytes More...
 
IplImage * m_IplDistanceImage
 OpenCV-representation of the distance image. More...
 
IplImage * m_IplOutputImage
 OpenCV-representation of the output image. More...
 
ItkImageType2D::Pointer m_ItkInputImage
 ITK representation of the distance image. More...
 
bool m_ApplyTemporalMedianFilter
 Flag indicating if the temporal median filter is currently active for processing the distance image. More...
 
bool m_ApplyAverageFilter
 Flag indicating if the average filter is currently active for processing the distance image. More...
 
bool m_ApplyMedianFilter
 Flag indicating if the spatial median filter is currently active for processing the distance image. More...
 
bool m_ApplyThresholdFilter
 Flag indicating if the threshold filter is currently active for processing the distance image. More...
 
bool m_ApplyMaskSegmentation
 Flag indicating if a mask segmentation is performed. More...
 
bool m_ApplyBilateralFilter
 Flag indicating if the bilateral filter is currently active for processing the distance image. More...
 
float ** m_DataBuffer
 Buffer used for calculating the pixel-wise median over the last n (m_TemporalMedianFilterNumOfFrames) number of frames. More...
 
int m_DataBufferCurrentIndex
 Current index in the buffer of the temporal median filter. More...
 
int m_DataBufferMaxSize
 Maximal size for the buffer of the temporal median filter (m_DataBuffer) More...
 
int m_TemporalMedianFilterNumOfFrames
 Number of frames to be used in the calculation of the temporal median. More...
 
int m_ThresholdFilterMin
 Lower threshold of the threshold filter. Pixels with values below will be assigned value 0 when applying the threshold filter. More...
 
int m_ThresholdFilterMax
 Lower threshold of the threshold filter. Pixels with values above will be assigned value 0 when applying the threshold filter. More...
 
double m_BilateralFilterDomainSigma
 Parameter of the bilateral filter controlling the smoothing effect of the filter. Default value: 2. More...
 
double m_BilateralFilterRangeSigma
 Parameter of the bilateral filter controlling the edge preserving effect of the filter. Default value: 60. More...
 
int m_BilateralFilterKernelRadius
 Kernel radius of the bilateral filter mask. More...
 

Additional Inherited Members

- Public Types inherited from mitk::ImageToImageFilter
typedef ImageToImageFilter Self
 
typedef ImageSource Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef Superclass::OutputImageRegionType OutputImageRegionType
 
typedef mitk::Image InputImageType
 
typedef InputImageType::Pointer InputImagePointer
 
typedef InputImageType::ConstPointer InputImageConstPointer
 
typedef SlicedData::RegionType InputImageRegionType
 
- Public Types inherited from mitk::ImageSource
typedef ImageSource Self
 
typedef BaseDataSource Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
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 BaseDataSource Self
 
typedef itk::ProcessObject Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef BaseData OutputType
 
typedef itk::DataObject::DataObjectIdentifierType DataObjectIdentifierType
 
- 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

Applies a common filter-pipeline to the first input of this filter.

This class intends to allow quick preprocessing of (ToF) range data. Input 0 of this filter, holding the range image, is processed using the following image processing filters:

  • threshold filter
  • mask segmentation
  • temporal median filter
  • spatial median filter
  • bilateral filter

Definition at line 40 of file mitkToFCompositeFilter.h.

Constructor & Destructor Documentation

◆ ToFCompositeFilter()

mitk::ToFCompositeFilter::ToFCompositeFilter ( )
protected

standard constructor

◆ ~ToFCompositeFilter()

mitk::ToFCompositeFilter::~ToFCompositeFilter ( )
overrideprotected

standard destructor

Member Function Documentation

◆ Clone()

Pointer mitk::ToFCompositeFilter::Clone ( ) const

◆ CreateItkImage()

void mitk::ToFCompositeFilter::CreateItkImage ( ItkImageType2D::Pointer &  itkInputImage)
protected

Initialize and allocate a 2D ITK image of dimension m_ImageWidth*m_ImageHeight.

◆ CreateOutputsForAllInputs()

void mitk::ToFCompositeFilter::CreateOutputsForAllInputs ( )
protected

Create an output for each input.

This Method sets the number of outputs to the number of inputs and creates missing outputs objects.

Warning
any additional outputs that exist before the method is called are deleted

◆ GenerateData()

void mitk::ToFCompositeFilter::GenerateData ( )
overrideprotected

method generating the output of this filter. Called in the updated process of the pipeline. This method generates the output of the ToFSurfaceSource: The generated surface of the 3d points

◆ GenerateOutputInformation()

void mitk::ToFCompositeFilter::GenerateOutputInformation ( )
overrideprotected

◆ GetApplyAverageFilter()

virtual bool mitk::ToFCompositeFilter::GetApplyAverageFilter ( ) const
virtual

◆ GetApplyBilateralFilter()

virtual bool mitk::ToFCompositeFilter::GetApplyBilateralFilter ( ) const
virtual

◆ GetApplyMaskSegmentation()

virtual bool mitk::ToFCompositeFilter::GetApplyMaskSegmentation ( ) const
virtual

◆ GetApplyMedianFilter()

virtual bool mitk::ToFCompositeFilter::GetApplyMedianFilter ( ) const
virtual

◆ GetApplyTemporalMedianFilter()

virtual bool mitk::ToFCompositeFilter::GetApplyTemporalMedianFilter ( ) const
virtual

◆ GetApplyThresholdFilter()

virtual bool mitk::ToFCompositeFilter::GetApplyThresholdFilter ( ) const
virtual

◆ GetInput() [1/2]

Image* mitk::ToFCompositeFilter::GetInput ( )

returns the input of this filter

◆ GetInput() [2/2]

Image* mitk::ToFCompositeFilter::GetInput ( unsigned int  idx)

returns the input with id idx of this filter

◆ mitkClassMacro()

mitk::ToFCompositeFilter::mitkClassMacro ( ToFCompositeFilter  ,
ImageToImageFilter   
)

◆ New()

static Pointer mitk::ToFCompositeFilter::New ( )
static

◆ ProcessCVBilateralFilter()

void mitk::ToFCompositeFilter::ProcessCVBilateralFilter ( IplImage *  inputIplImage,
IplImage *  outputIplImage 
)
protected

Applies the OpenCV bilateral filter to the input image.

◆ ProcessCVMedianFilter()

void mitk::ToFCompositeFilter::ProcessCVMedianFilter ( IplImage *  inputIplImage,
IplImage *  outputIplImage,
int  radius = 3 
)
protected

Applies the OpenCV median filter to the input image.

◆ ProcessItkBilateralFilter()

ItkImageType2D::Pointer mitk::ToFCompositeFilter::ProcessItkBilateralFilter ( ItkImageType2D::Pointer  inputItkImage)
protected

Applies the ITK bilateral filter to the input image.

◆ ProcessSegmentation()

void mitk::ToFCompositeFilter::ProcessSegmentation ( IplImage *  inputIplImage)
protected

Applies a mask and/or threshold segmentation to the input image. All pixels with values outside the mask, below the lower threshold (min) and above the upper threshold (max) are assigned the pixel value 0.

◆ ProcessStreamedQuickSelectMedianImageFilter()

void mitk::ToFCompositeFilter::ProcessStreamedQuickSelectMedianImageFilter ( IplImage *  inputIplImage)
protected

Performs temporal median filter on an image given the number of frames to be considered.

◆ quick_select()

float mitk::ToFCompositeFilter::quick_select ( float  arr[],
int  n 
)
protected

Quickselect algorithm This Quickselect routine is based on the algorithm described in "Numerical recipes in C", Second Edition, Cambridge University Press, 1992, Section 8.5, ISBN 0-521-43108-5 This code by Nicolas Devillard - 1998. Public domain.

◆ SetApplyAverageFilter()

virtual void mitk::ToFCompositeFilter::SetApplyAverageFilter ( bool  _arg)
virtual

◆ SetApplyBilateralFilter()

virtual void mitk::ToFCompositeFilter::SetApplyBilateralFilter ( bool  _arg)
virtual

◆ SetApplyMaskSegmentation()

virtual void mitk::ToFCompositeFilter::SetApplyMaskSegmentation ( bool  _arg)
virtual

◆ SetApplyMedianFilter()

virtual void mitk::ToFCompositeFilter::SetApplyMedianFilter ( bool  _arg)
virtual

◆ SetApplyTemporalMedianFilter()

virtual void mitk::ToFCompositeFilter::SetApplyTemporalMedianFilter ( bool  _arg)
virtual

◆ SetApplyThresholdFilter()

virtual void mitk::ToFCompositeFilter::SetApplyThresholdFilter ( bool  _arg)
virtual

◆ SetBilateralFilterParameter()

void mitk::ToFCompositeFilter::SetBilateralFilterParameter ( double  domainSigma,
double  rangeSigma,
int  kernelRadius 
)

Sets the parameters (domain sigma, range sigma, kernel radius) of the bilateral filter.

Parameters
domainSigmaParameter controlling the smoothing effect of the bilateral filter. Default value: 2
rangeSigmaParameter controlling the edge preserving effect of the bilateral filter. Default value: 60
kernelRadiusradius of the filter mask of the bilateral filter

◆ SetInput() [1/2]

void mitk::ToFCompositeFilter::SetInput ( const InputImageType distanceImage)
overridevirtual

sets the input of this filter

Parameters
distanceImageinput is the distance image of e.g. a ToF camera

Reimplemented from mitk::ImageToImageFilter.

◆ SetInput() [2/2]

void mitk::ToFCompositeFilter::SetInput ( unsigned int  idx,
const InputImageType distanceImage 
)
overridevirtual

sets the input of this filter at idx

Parameters
idxnumber of the current input
distanceImageinput is the distance image of e.g. a ToF camera

Reimplemented from mitk::ImageToImageFilter.

◆ SetSegmentationMask()

virtual void mitk::ToFCompositeFilter::SetSegmentationMask ( mitk::Image::Pointer  _arg)
virtual

◆ SetTemporalMedianFilterParameter()

void mitk::ToFCompositeFilter::SetTemporalMedianFilterParameter ( int  tmporalMedianFilterNumOfFrames)

Sets the parameter of the temporal median filter.

Parameters
tmporalMedianFilterNumOfFramesnumber of frames to be considered for calulating the temporal median

◆ SetThresholdFilterParameter()

void mitk::ToFCompositeFilter::SetThresholdFilterParameter ( int  min,
int  max 
)

Sets the parameters (lower, upper threshold) of the threshold filter.

Parameters
minlower threshold of the threshold filter
maxupper threshold of the threshold filter

Member Data Documentation

◆ m_ApplyAverageFilter

bool mitk::ToFCompositeFilter::m_ApplyAverageFilter
protected

Flag indicating if the average filter is currently active for processing the distance image.

Definition at line 174 of file mitkToFCompositeFilter.h.

◆ m_ApplyBilateralFilter

bool mitk::ToFCompositeFilter::m_ApplyBilateralFilter
protected

Flag indicating if the bilateral filter is currently active for processing the distance image.

Definition at line 178 of file mitkToFCompositeFilter.h.

◆ m_ApplyMaskSegmentation

bool mitk::ToFCompositeFilter::m_ApplyMaskSegmentation
protected

Flag indicating if a mask segmentation is performed.

Definition at line 177 of file mitkToFCompositeFilter.h.

◆ m_ApplyMedianFilter

bool mitk::ToFCompositeFilter::m_ApplyMedianFilter
protected

Flag indicating if the spatial median filter is currently active for processing the distance image.

Definition at line 175 of file mitkToFCompositeFilter.h.

◆ m_ApplyTemporalMedianFilter

bool mitk::ToFCompositeFilter::m_ApplyTemporalMedianFilter
protected

Flag indicating if the temporal median filter is currently active for processing the distance image.

Definition at line 173 of file mitkToFCompositeFilter.h.

◆ m_ApplyThresholdFilter

bool mitk::ToFCompositeFilter::m_ApplyThresholdFilter
protected

Flag indicating if the threshold filter is currently active for processing the distance image.

Definition at line 176 of file mitkToFCompositeFilter.h.

◆ m_BilateralFilterDomainSigma

double mitk::ToFCompositeFilter::m_BilateralFilterDomainSigma
protected

Parameter of the bilateral filter controlling the smoothing effect of the filter. Default value: 2.

Definition at line 187 of file mitkToFCompositeFilter.h.

◆ m_BilateralFilterKernelRadius

int mitk::ToFCompositeFilter::m_BilateralFilterKernelRadius
protected

Kernel radius of the bilateral filter mask.

Definition at line 189 of file mitkToFCompositeFilter.h.

◆ m_BilateralFilterRangeSigma

double mitk::ToFCompositeFilter::m_BilateralFilterRangeSigma
protected

Parameter of the bilateral filter controlling the edge preserving effect of the filter. Default value: 60.

Definition at line 188 of file mitkToFCompositeFilter.h.

◆ m_DataBuffer

float** mitk::ToFCompositeFilter::m_DataBuffer
protected

Buffer used for calculating the pixel-wise median over the last n (m_TemporalMedianFilterNumOfFrames) number of frames.

Definition at line 180 of file mitkToFCompositeFilter.h.

◆ m_DataBufferCurrentIndex

int mitk::ToFCompositeFilter::m_DataBufferCurrentIndex
protected

Current index in the buffer of the temporal median filter.

Definition at line 181 of file mitkToFCompositeFilter.h.

◆ m_DataBufferMaxSize

int mitk::ToFCompositeFilter::m_DataBufferMaxSize
protected

Maximal size for the buffer of the temporal median filter (m_DataBuffer)

Definition at line 182 of file mitkToFCompositeFilter.h.

◆ m_ImageHeight

int mitk::ToFCompositeFilter::m_ImageHeight
protected

y-dimension of the image

Definition at line 165 of file mitkToFCompositeFilter.h.

◆ m_ImageSize

int mitk::ToFCompositeFilter::m_ImageSize
protected

size of the image in bytes

Definition at line 166 of file mitkToFCompositeFilter.h.

◆ m_ImageWidth

int mitk::ToFCompositeFilter::m_ImageWidth
protected

x-dimension of the image

Definition at line 164 of file mitkToFCompositeFilter.h.

◆ m_IplDistanceImage

IplImage* mitk::ToFCompositeFilter::m_IplDistanceImage
protected

OpenCV-representation of the distance image.

Definition at line 168 of file mitkToFCompositeFilter.h.

◆ m_IplOutputImage

IplImage* mitk::ToFCompositeFilter::m_IplOutputImage
protected

OpenCV-representation of the output image.

Definition at line 169 of file mitkToFCompositeFilter.h.

◆ m_ItkInputImage

ItkImageType2D::Pointer mitk::ToFCompositeFilter::m_ItkInputImage
protected

ITK representation of the distance image.

Definition at line 171 of file mitkToFCompositeFilter.h.

◆ m_SegmentationMask

mitk::Image::Pointer mitk::ToFCompositeFilter::m_SegmentationMask
protected

mask image used for segmenting the image

Definition at line 162 of file mitkToFCompositeFilter.h.

◆ m_TemporalMedianFilterNumOfFrames

int mitk::ToFCompositeFilter::m_TemporalMedianFilterNumOfFrames
protected

Number of frames to be used in the calculation of the temporal median.

Definition at line 184 of file mitkToFCompositeFilter.h.

◆ m_ThresholdFilterMax

int mitk::ToFCompositeFilter::m_ThresholdFilterMax
protected

Lower threshold of the threshold filter. Pixels with values above will be assigned value 0 when applying the threshold filter.

Definition at line 186 of file mitkToFCompositeFilter.h.

◆ m_ThresholdFilterMin

int mitk::ToFCompositeFilter::m_ThresholdFilterMin
protected

Lower threshold of the threshold filter. Pixels with values below will be assigned value 0 when applying the threshold filter.

Definition at line 185 of file mitkToFCompositeFilter.h.


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