MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
mitkToFCompositeFilter.h
Go to the documentation of this file.
1/*============================================================================
2
3The Medical Imaging Interaction Toolkit (MITK)
4
5Copyright (c) German Cancer Research Center (DKFZ)
6All rights reserved.
7
8Use of this source code is governed by a 3-clause BSD license that can be
9found in the LICENSE file.
10
11============================================================================*/
12#ifndef mitkToFCompositeFilter_h
13#define mitkToFCompositeFilter_h
14
15#include <mitkImage.h>
16#include "mitkImageToImageFilter.h"
17#include <MitkToFProcessingExports.h>
18#include <itkBilateralImageFilter.h>
19#include <opencv2/core/types_c.h>
20
21typedef itk::Image<float, 2> ItkImageType2D;
22typedef itk::Image<float, 3> ItkImageType3D;
23typedef itk::BilateralImageFilter<ItkImageType2D,ItkImageType2D> BilateralFilterType;
24
25namespace mitk
26{
40 class MITKTOFPROCESSING_EXPORT ToFCompositeFilter : public ImageToImageFilter
41 {
42 public:
43
44 mitkClassMacro( ToFCompositeFilter , ImageToImageFilter );
47 itkSetMacro(SegmentationMask,mitk::Image::Pointer);
48 itkSetMacro(ApplyTemporalMedianFilter,bool);
49 itkGetConstMacro(ApplyTemporalMedianFilter,bool);
50 itkSetMacro(ApplyAverageFilter,bool);
51 itkGetConstMacro(ApplyAverageFilter,bool);
52 itkSetMacro(ApplyMedianFilter,bool);
53 itkGetConstMacro(ApplyMedianFilter,bool);
54 itkSetMacro(ApplyThresholdFilter,bool);
55 itkGetConstMacro(ApplyThresholdFilter,bool);
56 itkSetMacro(ApplyMaskSegmentation,bool);
57 itkGetConstMacro(ApplyMaskSegmentation,bool);
58 itkSetMacro(ApplyBilateralFilter,bool);
59 itkGetConstMacro(ApplyBilateralFilter,bool);
60
61 using itk::ProcessObject::SetInput;
62
67 void SetInput( const InputImageType* distanceImage) override;
68
74 void SetInput(unsigned int idx, const InputImageType* distanceImage) override;
75
79 Image* GetInput();
80
84 Image* GetInput(unsigned int idx);
89 void SetTemporalMedianFilterParameter(int tmporalMedianFilterNumOfFrames);
95 void SetThresholdFilterParameter(int min, int max);
102 void SetBilateralFilterParameter(double domainSigma, double rangeSigma, int kernelRadius);
103
104 protected:
112 ~ToFCompositeFilter() override;
113 void GenerateOutputInformation() override;
118 void GenerateData() override;
126 void CreateOutputsForAllInputs();
132 void ProcessSegmentation(IplImage* inputIplImage);
136 ItkImageType2D::Pointer ProcessItkBilateralFilter(ItkImageType2D::Pointer inputItkImage);
140 void ProcessCVBilateralFilter(IplImage* inputIplImage, IplImage* outputIplImage);
144 void ProcessCVMedianFilter(IplImage* inputIplImage, IplImage* outputIplImage, int radius = 3);
148 void ProcessStreamedQuickSelectMedianImageFilter(IplImage* inputIplImage);
156 float quick_select(float arr[], int n);
160 void CreateItkImage(ItkImageType2D::Pointer &itkInputImage);
161
162 mitk::Image::Pointer m_SegmentationMask;
163
167
170
171 ItkImageType2D::Pointer m_ItkInputImage;
172
179
180 float** m_DataBuffer;
183
190
191 };
192} //END mitk namespace
193#endif
Applies a common filter-pipeline to the first input of this filter.
itkSetMacro(SegmentationMask, mitk::Image::Pointer)
IplImage * m_IplOutputImage
OpenCV-representation of the output image.
int m_ThresholdFilterMin
Lower threshold of the threshold filter. Pixels with values below will be assigned value 0 when apply...
itkGetConstMacro(ApplyBilateralFilter, bool)
bool m_ApplyMedianFilter
Flag indicating if the spatial median filter is currently active for processing the distance image.
itkSetMacro(ApplyBilateralFilter, bool)
itkGetConstMacro(ApplyAverageFilter, bool)
itkSetMacro(ApplyThresholdFilter, bool)
bool m_ApplyAverageFilter
Flag indicating if the average filter is currently active for processing the distance image.
itkGetConstMacro(ApplyThresholdFilter, bool)
int m_ThresholdFilterMax
Lower threshold of the threshold filter. Pixels with values above will be assigned value 0 when apply...
itkSetMacro(ApplyAverageFilter, bool)
mitkClassMacro(ToFCompositeFilter, ImageToImageFilter)
int m_ImageHeight
y-dimension of the image
itkGetConstMacro(ApplyTemporalMedianFilter, bool)
int m_BilateralFilterKernelRadius
Kernel radius of the bilateral filter mask.
double m_BilateralFilterDomainSigma
Parameter of the bilateral filter controlling the smoothing effect of the filter. Default value: 2.
int m_ImageWidth
x-dimension of the image
itkGetConstMacro(ApplyMedianFilter, bool)
itkSetMacro(ApplyMaskSegmentation, bool)
bool m_ApplyMaskSegmentation
Flag indicating if a mask segmentation is performed.
float ** m_DataBuffer
Buffer used for calculating the pixel-wise median over the last n (m_TemporalMedianFilterNumOfFrames)...
IplImage * m_IplDistanceImage
OpenCV-representation of the distance image.
ItkImageType2D::Pointer m_ItkInputImage
ITK representation of the distance image.
int m_DataBufferMaxSize
Maximal size for the buffer of the temporal median filter (m_DataBuffer)
itkGetConstMacro(ApplyMaskSegmentation, bool)
bool m_ApplyBilateralFilter
Flag indicating if the bilateral filter is currently active for processing the distance image.
double m_BilateralFilterRangeSigma
Parameter of the bilateral filter controlling the edge preserving effect of the filter....
bool m_ApplyTemporalMedianFilter
Flag indicating if the temporal median filter is currently active for processing the distance image.
itkSetMacro(ApplyTemporalMedianFilter, bool)
int m_ImageSize
size of the image in bytes
int m_TemporalMedianFilterNumOfFrames
Number of frames to be used in the calculation of the temporal median.
mitk::Image::Pointer m_SegmentationMask
mask image used for segmenting the image
bool m_ApplyThresholdFilter
Flag indicating if the threshold filter is currently active for processing the distance image.
itkSetMacro(ApplyMedianFilter, bool)
int m_DataBufferCurrentIndex
Current index in the buffer of the temporal median filter.
itk::Image< float, 3 > ItkImageType3D
itk::Image< float, 2 > ItkImageType2D
itk::BilateralImageFilter< ItkImageType2D, ItkImageType2D > BilateralFilterType
IGT Exceptions.