ITK  5.2.0
Insight Toolkit
itkThresholdMaximumConnectedComponentsImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkThresholdMaximumConnectedComponentsImageFilter_h
19 #define itkThresholdMaximumConnectedComponentsImageFilter_h
20 
25 #include "itkCastImageFilter.h"
26 
27 
28 namespace itk
29 {
73 template <typename TInputImage, typename TOutputImage = TInputImage>
75  : public ImageToImageFilter<TInputImage, TOutputImage>
76 {
77 public:
78  ITK_DISALLOW_COPY_AND_MOVE(ThresholdMaximumConnectedComponentsImageFilter);
79 
85 
87  itkNewMacro(Self);
88 
91 
93  using PixelType = typename TInputImage::PixelType;
94  using OutputPixelType = typename TOutputImage::PixelType;
95 
97  itkConceptMacro(PixelTypeComparable, (Concept::Comparable<PixelType>));
98 
106  itkSetMacro(MinimumObjectSizeInPixels, unsigned int);
107  itkGetConstMacro(MinimumObjectSizeInPixels, unsigned int);
109 
123  itkSetMacro(InsideValue, OutputPixelType);
124  itkSetMacro(OutsideValue, OutputPixelType);
125  itkSetMacro(UpperBoundary, PixelType);
126  itkGetConstMacro(InsideValue, OutputPixelType);
127  itkGetConstMacro(OutsideValue, OutputPixelType);
128  itkGetConstMacro(UpperBoundary, PixelType);
130 
135  itkGetConstMacro(NumberOfObjects, SizeValueType);
136 
140  itkGetConstMacro(ThresholdValue, PixelType);
141 
143  using InputImageType = TInputImage;
144  using InputImagePointer = typename InputImageType::ConstPointer;
146  using InputImagePixelType = typename InputImageType::PixelType;
147 
149  using OutputImageType = TOutputImage;
150  using OutputImagePointer = typename OutputImageType::Pointer;
152  using OutputImagePixelType = typename OutputImageType::PixelType;
153 
154 protected:
157  void
158  PrintSelf(std::ostream & os, Indent indent) const override;
159 
160  void
161  GenerateData() override;
162 
168  ComputeConnectedComponents();
169 
170 private:
172  using FilterPixelType = unsigned int;
173 
174  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
175 
177 
179 
180  //
181  // Binary Threshold Filter
182  //
184 
185  //
186  // Connected Components Filter
187  //
189 
190  //
191  // Relabeled Components Filter
192  //
194 
195  //
196  // Minimum maximum calculator
197  //
199 
200  //
201  // Declare member variables for the filters of the internal pipeline.
202  //
205 
207 
209 
210  // Variables defined by the user
212 
213  // Binary threshold variables
216 
219 
220  // Filter variables
223 };
224 } // end namespace itk
225 
226 #ifndef ITK_MANUAL_INSTANTIATION
227 # include "itkThresholdMaximumConnectedComponentsImageFilter.hxx"
228 #endif
229 
230 #endif
itk::ThresholdMaximumConnectedComponentsImageFilter::m_MinMaxCalculator
MinMaxCalculatorType::Pointer m_MinMaxCalculator
Definition: itkThresholdMaximumConnectedComponentsImageFilter.h:208
itk::ThresholdMaximumConnectedComponentsImageFilter::m_OutsideValue
OutputPixelType m_OutsideValue
Definition: itkThresholdMaximumConnectedComponentsImageFilter.h:214
itk::ImageSource::OutputImagePointer
typename OutputImageType::Pointer OutputImagePointer
Definition: itkImageSource.h:91
itk::ThresholdMaximumConnectedComponentsImageFilter::m_ConnectedComponent
ConnectedFilterType::Pointer m_ConnectedComponent
Definition: itkThresholdMaximumConnectedComponentsImageFilter.h:204
itk::ThresholdMaximumConnectedComponentsImageFilter::m_MinimumObjectSizeInPixels
unsigned int m_MinimumObjectSizeInPixels
Definition: itkThresholdMaximumConnectedComponentsImageFilter.h:211
itk::ThresholdMaximumConnectedComponentsImageFilter::OutputPixelType
typename TOutputImage::PixelType OutputPixelType
Definition: itkThresholdMaximumConnectedComponentsImageFilter.h:94
itk::ThresholdMaximumConnectedComponentsImageFilter::FilterPixelType
unsigned int FilterPixelType
Definition: itkThresholdMaximumConnectedComponentsImageFilter.h:172
itk::MinimumMaximumImageCalculator
Computes the minimum and the maximum intensity values of an image.
Definition: itkMinimumMaximumImageCalculator.h:44
itk::BinaryThresholdImageFilter
Binarize an input image by thresholding.
Definition: itkBinaryThresholdImageFilter.h:139
itk::ThresholdMaximumConnectedComponentsImageFilter::m_ThresholdFilter
ThresholdFilterType::Pointer m_ThresholdFilter
Definition: itkThresholdMaximumConnectedComponentsImageFilter.h:203
itk::ThresholdMaximumConnectedComponentsImageFilter::m_InsideValue
OutputPixelType m_InsideValue
Definition: itkThresholdMaximumConnectedComponentsImageFilter.h:215
itkMinimumMaximumImageCalculator.h
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ThresholdMaximumConnectedComponentsImageFilter::m_LowerBoundary
PixelType m_LowerBoundary
Definition: itkThresholdMaximumConnectedComponentsImageFilter.h:217
itkCastImageFilter.h
itk::ThresholdMaximumConnectedComponentsImageFilter::m_NumberOfObjects
SizeValueType m_NumberOfObjects
Definition: itkThresholdMaximumConnectedComponentsImageFilter.h:222
itkRelabelComponentImageFilter.h
itk::ImageToImageFilter::InputImagePixelType
typename InputImageType::PixelType InputImagePixelType
Definition: itkImageToImageFilter.h:133
itk::ImageToImageFilter
Base class for filters that take an image as input and produce an image as output.
Definition: itkImageToImageFilter.h:108
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::ThresholdMaximumConnectedComponentsImageFilter::PixelType
typename TInputImage::PixelType PixelType
Definition: itkThresholdMaximumConnectedComponentsImageFilter.h:93
itk::ImageToImageFilter::InputImagePointer
typename InputImageType::Pointer InputImagePointer
Definition: itkImageToImageFilter.h:130
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::ThresholdMaximumConnectedComponentsImageFilter::FilterImagePointer
typename FilterImageType::Pointer FilterImagePointer
Definition: itkThresholdMaximumConnectedComponentsImageFilter.h:178
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itk::Concept::Comparable
Definition: itkConceptChecking.h:330
itk::ThresholdMaximumConnectedComponentsImageFilter
Finds the threshold value of an image based on maximizing the number of objects in the image that are...
Definition: itkThresholdMaximumConnectedComponentsImageFilter.h:74
itk::ImageSource::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition: itkImageSource.h:92
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::RelabelComponentImageFilter
Relabel the components in an image such that consecutive labels are used.
Definition: itkRelabelComponentImageFilter.h:82
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:138
itk::ThresholdMaximumConnectedComponentsImageFilter::m_LabeledComponent
RelabelFilterType::Pointer m_LabeledComponent
Definition: itkThresholdMaximumConnectedComponentsImageFilter.h:206
itk::ThresholdMaximumConnectedComponentsImageFilter::m_UpperBoundary
PixelType m_UpperBoundary
Definition: itkThresholdMaximumConnectedComponentsImageFilter.h:218
itkConnectedComponentImageFilter.h
itk::ImageSource::OutputImagePixelType
typename OutputImageType::PixelType OutputImagePixelType
Definition: itkImageSource.h:93
itkBinaryThresholdImageFilter.h
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:86
itk::ConnectedComponentImageFilter
Label the objects in a binary image.
Definition: itkConnectedComponentImageFilter.h:59
itk::ImageToImageFilter::InputImageRegionType
typename InputImageType::RegionType InputImageRegionType
Definition: itkImageToImageFilter.h:132
itk::ThresholdMaximumConnectedComponentsImageFilter::m_ThresholdValue
PixelType m_ThresholdValue
Definition: itkThresholdMaximumConnectedComponentsImageFilter.h:221
itk::SizeValueType
unsigned long SizeValueType
Definition: itkIntTypes.h:83
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90