MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
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:

Public Member Functions

 mitkClassMacro (ToFCompositeFilter, ImageToImageFilter)
 
 itkFactorylessNewMacro (Self)
 
 itkCloneMacro (Self)
 
 itkSetMacro (SegmentationMask, mitk::Image::Pointer)
 
 itkSetMacro (ApplyTemporalMedianFilter, bool)
 
 itkGetConstMacro (ApplyTemporalMedianFilter, bool)
 
 itkSetMacro (ApplyAverageFilter, bool)
 
 itkGetConstMacro (ApplyAverageFilter, bool)
 
 itkSetMacro (ApplyMedianFilter, bool)
 
 itkGetConstMacro (ApplyMedianFilter, bool)
 
 itkSetMacro (ApplyThresholdFilter, bool)
 
 itkGetConstMacro (ApplyThresholdFilter, bool)
 
 itkSetMacro (ApplyMaskSegmentation, bool)
 
 itkGetConstMacro (ApplyMaskSegmentation, bool)
 
 itkSetMacro (ApplyBilateralFilter, bool)
 
 itkGetConstMacro (ApplyBilateralFilter, bool)
 
void SetInput (const InputImageType *distanceImage) override
 sets the input of this filter
 
void SetInput (unsigned int idx, const InputImageType *distanceImage) override
 sets the input of this filter at idx
 
Image * GetInput ()
 returns the input of this filter
 
Image * GetInput (unsigned int idx)
 returns the input with id idx of this filter
 
void SetTemporalMedianFilterParameter (int tmporalMedianFilterNumOfFrames)
 Sets the parameter of the temporal median filter.
 
void SetThresholdFilterParameter (int min, int max)
 Sets the parameters (lower, upper threshold) of the threshold filter.
 
void SetBilateralFilterParameter (double domainSigma, double rangeSigma, int kernelRadius)
 Sets the parameters (domain sigma, range sigma, kernel radius) of the bilateral filter.
 

Protected Member Functions

 ToFCompositeFilter ()
 standard constructor
 
 ~ToFCompositeFilter () override
 standard destructor
 
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
 
void CreateOutputsForAllInputs ()
 Create an output for each input.
 
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.
 
ItkImageType2D::Pointer ProcessItkBilateralFilter (ItkImageType2D::Pointer inputItkImage)
 Applies the ITK bilateral filter to the input image.
 
void ProcessCVBilateralFilter (IplImage *inputIplImage, IplImage *outputIplImage)
 Applies the OpenCV bilateral filter to the input image.
 
void ProcessCVMedianFilter (IplImage *inputIplImage, IplImage *outputIplImage, int radius=3)
 Applies the OpenCV median filter to the input image.
 
void ProcessStreamedQuickSelectMedianImageFilter (IplImage *inputIplImage)
 Performs temporal median filter on an image given the number of frames to be considered.
 
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.
 
void CreateItkImage (ItkImageType2D::Pointer &itkInputImage)
 Initialize and allocate a 2D ITK image of dimension m_ImageWidth*m_ImageHeight.
 

Protected Attributes

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

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

Definition at line 21 of file mitkToFCompositeFilter.cpp.

◆ ~ToFCompositeFilter()

mitk::ToFCompositeFilter::~ToFCompositeFilter ( )
overrideprotected

standard destructor

Definition at line 29 of file mitkToFCompositeFilter.cpp.

Member Function Documentation

◆ CreateItkImage()

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

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

Definition at line 383 of file mitkToFCompositeFilter.cpp.

◆ 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

Definition at line 147 of file mitkToFCompositeFilter.cpp.

◆ 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

Definition at line 96 of file mitkToFCompositeFilter.cpp.

◆ GenerateOutputInformation()

void mitk::ToFCompositeFilter::GenerateOutputInformation ( )
overrideprotected

Definition at line 161 of file mitkToFCompositeFilter.cpp.

◆ GetInput() [1/2]

mitk::Image * mitk::ToFCompositeFilter::GetInput ( )

returns the input of this filter

Definition at line 84 of file mitkToFCompositeFilter.cpp.

◆ GetInput() [2/2]

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

returns the input with id idx of this filter

Definition at line 89 of file mitkToFCompositeFilter.cpp.

◆ itkCloneMacro()

mitk::ToFCompositeFilter::itkCloneMacro ( Self )

◆ itkFactorylessNewMacro()

mitk::ToFCompositeFilter::itkFactorylessNewMacro ( Self )

◆ itkGetConstMacro() [1/6]

mitk::ToFCompositeFilter::itkGetConstMacro ( ApplyAverageFilter ,
bool  )

◆ itkGetConstMacro() [2/6]

mitk::ToFCompositeFilter::itkGetConstMacro ( ApplyBilateralFilter ,
bool  )

◆ itkGetConstMacro() [3/6]

mitk::ToFCompositeFilter::itkGetConstMacro ( ApplyMaskSegmentation ,
bool  )

◆ itkGetConstMacro() [4/6]

mitk::ToFCompositeFilter::itkGetConstMacro ( ApplyMedianFilter ,
bool  )

◆ itkGetConstMacro() [5/6]

mitk::ToFCompositeFilter::itkGetConstMacro ( ApplyTemporalMedianFilter ,
bool  )

◆ itkGetConstMacro() [6/6]

mitk::ToFCompositeFilter::itkGetConstMacro ( ApplyThresholdFilter ,
bool  )

◆ itkSetMacro() [1/7]

mitk::ToFCompositeFilter::itkSetMacro ( ApplyAverageFilter ,
bool  )

◆ itkSetMacro() [2/7]

mitk::ToFCompositeFilter::itkSetMacro ( ApplyBilateralFilter ,
bool  )

◆ itkSetMacro() [3/7]

mitk::ToFCompositeFilter::itkSetMacro ( ApplyMaskSegmentation ,
bool  )

◆ itkSetMacro() [4/7]

mitk::ToFCompositeFilter::itkSetMacro ( ApplyMedianFilter ,
bool  )

◆ itkSetMacro() [5/7]

mitk::ToFCompositeFilter::itkSetMacro ( ApplyTemporalMedianFilter ,
bool  )

◆ itkSetMacro() [6/7]

mitk::ToFCompositeFilter::itkSetMacro ( ApplyThresholdFilter ,
bool  )

◆ itkSetMacro() [7/7]

mitk::ToFCompositeFilter::itkSetMacro ( SegmentationMask ,
mitk::Image::Pointer  )

◆ mitkClassMacro()

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

◆ ProcessCVBilateralFilter()

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

Applies the OpenCV bilateral filter to the input image.

Definition at line 227 of file mitkToFCompositeFilter.cpp.

◆ ProcessCVMedianFilter()

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

Applies the OpenCV median filter to the input image.

Definition at line 235 of file mitkToFCompositeFilter.cpp.

◆ ProcessItkBilateralFilter()

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

Applies the ITK bilateral filter to the input image.

Definition at line 214 of file mitkToFCompositeFilter.cpp.

◆ 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.

Definition at line 175 of file mitkToFCompositeFilter.cpp.

◆ ProcessStreamedQuickSelectMedianImageFilter()

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

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

Definition at line 240 of file mitkToFCompositeFilter.cpp.

◆ 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.

Definition at line 317 of file mitkToFCompositeFilter.cpp.

◆ SetBilateralFilterParameter()

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

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

Definition at line 376 of file mitkToFCompositeFilter.cpp.

◆ SetInput() [1/2]

void mitk::ToFCompositeFilter::SetInput ( const InputImageType * distanceImage)
override

sets the input of this filter

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

Definition at line 39 of file mitkToFCompositeFilter.cpp.

◆ SetInput() [2/2]

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

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

Definition at line 44 of file mitkToFCompositeFilter.cpp.

◆ 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

Definition at line 361 of file mitkToFCompositeFilter.cpp.

◆ 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

Definition at line 366 of file mitkToFCompositeFilter.cpp.

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 files: