NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkMIDASRethresholdingFilter.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef itkMIDASRethresholdingFilter_h
16 #define itkMIDASRethresholdingFilter_h
17 
18 #include <itkImageToImageFilter.h>
19 #include <itkRegionOfInterestImageFilter.h>
20 #include <itkPasteImageFilter.h>
21 #include <itkBinaryCrossStructuringElement.h>
22 #include <itkBinaryErodeImageFilter.h>
26 
27 namespace itk
28 {
29 
46  template <class TInputImage1, class TInputImage2, class TOutputImage>
47  class ITK_EXPORT MIDASRethresholdingFilter : public ImageToImageFilter<TInputImage1, TOutputImage>
48  {
49  public:
52  typedef ImageToImageFilter<TInputImage1, TOutputImage> SuperClass;
53  typedef SmartPointer<Self> Pointer;
54  typedef SmartPointer<const Self> ConstPointer;
55 
57  itkNewMacro(Self);
58 
60  itkTypeMacro(MIDASRethresholdingFilter, ImageToImageFilter);
61 
63  typedef typename TInputImage1::PixelType PixelType1;
64 
67 
69  typedef TInputImage1 InputMainImageType;
70  typedef typename InputMainImageType::Pointer InputMainImagePointer;
73 
74  typedef TInputImage2 InputMaskImageType;
75  typedef typename InputMaskImageType::Pointer InputMaskImagePointer;
79 
80  typedef TInputImage2 OutputImageType;
81  typedef typename OutputImageType::Pointer OutputImagePointer;
85 
86  typedef typename itk::RegionOfInterestImageFilter<InputMaskImageType, InputMaskImageType> ROIImageFilterType;
87  typedef typename ROIImageFilterType::Pointer ROIImageFilterPointer;
88 
91 
92  typedef typename itk::BinaryCrossStructuringElement<typename InputMaskImageType::PixelType, InputMaskImageType::ImageDimension > StructuringElementType;
93  typedef typename itk::BinaryErodeImageFilter<InputMaskImageType, InputMaskImageType, StructuringElementType> ErosionFilterType;
94  typedef typename ErosionFilterType::Pointer ErosionFilterPointer;
95 
98 
99  typedef typename itk::PasteImageFilter<InputMaskImageType, InputMaskImageType> PasteImageFilterType;
100  typedef typename PasteImageFilterType::Pointer PasteImageFilterPointer;
101 
103  void SetGreyScaleImageInput(const InputMainImageType* image);
104 
106  void SetBinaryImageInput(const InputMaskImageType* image);
107 
109  void SetThresholdedImageInput(const InputMaskImageType* image);
110 
112  itkSetMacro(InValue, PixelType2);
113  itkGetConstMacro(InValue, PixelType2);
114 
116  itkSetMacro(OutValue, PixelType2);
117  itkGetConstMacro(OutValue, PixelType2);
118 
120  itkSetMacro(DownSamplingFactor, unsigned int);
121  itkGetConstMacro(DownSamplingFactor, unsigned int);
122 
124  itkSetMacro(LowPercentageThreshold, unsigned int);
125  itkGetConstMacro(LowPercentageThreshold, unsigned int);
126 
128  itkSetMacro(HighPercentageThreshold, unsigned int);
129  itkGetConstMacro(HighPercentageThreshold, unsigned int);
130 
131  protected:
134  void PrintSelf(std::ostream& os, Indent indent) const;
135 
137  void GenerateData();
138 
139  private:
140  MIDASRethresholdingFilter(const Self&); //purposely not implemented
141  void operator=(const Self&); //purposely not implemented
142 
143  void CopyImageToOutput(OutputImageType* image);
144 
146  unsigned int m_DownSamplingFactor;
147  unsigned int m_LowPercentageThreshold;
148  unsigned int m_HighPercentageThreshold;
149  PixelType2 m_InValue;
150  PixelType2 m_OutValue;
151 
153  ROIImageFilterPointer m_ROIImageFilter;
154  DownSamplingFilterPointer m_DownSamplingFilter;
155  ErosionFilterPointer m_ErosionFilter1;
156  ErosionFilterPointer m_ErosionFilter2;
157  UpSamplingFilterPointer m_UpSamplingFilter;
158  PasteImageFilterPointer m_PasteImageFilter;
159  };
160 
161 }
162 
163 #ifndef ITK_MANUAL_INSTANTIATION
164 #include "itkMIDASRethresholdingFilter.txx"
165 #endif
166 
167 #endif
InputMainImageType::RegionType InputMainImageRegionType
Definition: itkMIDASRethresholdingFilter.h:72
SmartPointer< Self > Pointer
Definition: itkMIDASDownSamplingFilter.h:39
SmartPointer< const Self > ConstPointer
Definition: itkMIDASRethresholdingFilter.h:54
ImageType::SizeType SizeType
Definition: niftkMakeLapUSProbeBasicModel.cxx:31
itk::MIDASUpSamplingFilter< InputMaskImageType, InputMaskImageType > UpSamplingFilterType
Definition: itkMIDASRethresholdingFilter.h:96
UpSamplingFilterType::Pointer UpSamplingFilterPointer
Definition: itkMIDASRethresholdingFilter.h:97
PasteImageFilterType::Pointer PasteImageFilterPointer
Definition: itkMIDASRethresholdingFilter.h:100
GLenum GLsizei GLenum GLenum const GLvoid * image
Definition: glew.h:4052
InputMainImageType::SizeType InputMainImageSizeType
Definition: itkMIDASRethresholdingFilter.h:71
Definition: niftkITKAffineResampleImage.cxx:74
ImageType::IndexType IndexType
Definition: niftkMakeLapUSProbeBasicModel.cxx:32
InputMaskImageType::RegionType InputMaskImageRegionType
Definition: itkMIDASRethresholdingFilter.h:77
TInputImage2::PixelType PixelType2
Definition: itkMIDASRethresholdingFilter.h:66
TInputImage2 OutputImageType
Definition: itkMIDASRethresholdingFilter.h:80
ROIImageFilterType::Pointer ROIImageFilterPointer
Definition: itkMIDASRethresholdingFilter.h:87
SmartPointer< Self > Pointer
Definition: itkMIDASUpSamplingFilter.h:45
TInputImage2 InputMaskImageType
Definition: itkMIDASRethresholdingFilter.h:74
itk::BinaryCrossStructuringElement< typename InputMaskImageType::PixelType, InputMaskImageType::ImageDimension > StructuringElementType
Definition: itkMIDASRethresholdingFilter.h:92
SmartPointer< Self > Pointer
Definition: itkMIDASRethresholdingFilter.h:53
itk::BinaryErodeImageFilter< InputMaskImageType, InputMaskImageType, StructuringElementType > ErosionFilterType
Definition: itkMIDASRethresholdingFilter.h:93
DownSamplingFilterType::Pointer DownSamplingFilterPointer
Definition: itkMIDASRethresholdingFilter.h:90
Performs the re-thresholding, described in step 5 of "Interactive Algorithms for the segmentation and...
Definition: itkMIDASRethresholdingFilter.h:47
itk::MIDASDownSamplingFilter< InputMaskImageType, InputMaskImageType > DownSamplingFilterType
Definition: itkMIDASRethresholdingFilter.h:89
float PixelType
Definition: niftkBreastDCEandADC.cxx:88
OutputImageType::IndexType OutputImageIndexType
Definition: itkMIDASRethresholdingFilter.h:84
InputMainImageType::Pointer InputMainImagePointer
Definition: itkMIDASRethresholdingFilter.h:70
ImageType::RegionType RegionType
Definition: niftkMakeLapUSProbeBasicModel.cxx:30
TInputImage1::PixelType PixelType1
Definition: itkMIDASRethresholdingFilter.h:60
MIDASRethresholdingFilter Self
Definition: itkMIDASRethresholdingFilter.h:51
ImageToImageFilter< TInputImage1, TOutputImage > SuperClass
Definition: itkMIDASRethresholdingFilter.h:52
Performs the up sampling described in step 5 of "Interactive Algorithms for the segmentation and quan...
Definition: itkMIDASUpSamplingFilter.h:39
Performs the down sampling described in step 5 of "Interactive Algorithms for the segmentation and qu...
Definition: itkMIDASDownSamplingFilter.h:33
itk::RegionOfInterestImageFilter< InputMaskImageType, InputMaskImageType > ROIImageFilterType
Definition: itkMIDASRethresholdingFilter.h:86
OutputImageType::SizeType OutputImageSizeType
Definition: itkMIDASRethresholdingFilter.h:83
InputMaskImageType::Pointer InputMaskImagePointer
Definition: itkMIDASRethresholdingFilter.h:75
ErosionFilterType::Pointer ErosionFilterPointer
Definition: itkMIDASRethresholdingFilter.h:94
OutputImageType::Pointer OutputImagePointer
Definition: itkMIDASRethresholdingFilter.h:81
InputMaskImageType::SizeType InputMaskImageSizeType
Definition: itkMIDASRethresholdingFilter.h:76
TInputImage1 InputMainImageType
Definition: itkMIDASRethresholdingFilter.h:69
virtual ~MIDASRethresholdingFilter()
Definition: itkMIDASRethresholdingFilter.h:133
itk::PasteImageFilter< InputMaskImageType, InputMaskImageType > PasteImageFilterType
Definition: itkMIDASRethresholdingFilter.h:99
InputMaskImageType::IndexType InputMaskImageIndexType
Definition: itkMIDASRethresholdingFilter.h:78
OutputImageType::RegionType OutputImageRegionType
Definition: itkMIDASRethresholdingFilter.h:82