ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkThresholdMaximumConnectedComponentsImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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_ASSIGN(ThresholdMaximumConnectedComponentsImageFilter);
79 
85 
87  itkNewMacro(Self);
88 
92 
94  using PixelType = typename TInputImage::PixelType;
95  using OutputPixelType = typename TOutputImage::PixelType;
96 
98  itkConceptMacro( PixelTypeComparable, ( Concept::Comparable< PixelType > ) );
99 
107  itkSetMacro(MinimumObjectSizeInPixels, unsigned int);
108  itkGetConstMacro(MinimumObjectSizeInPixels, unsigned int);
110 
124  itkSetMacro(InsideValue, OutputPixelType);
125  itkSetMacro(OutsideValue, OutputPixelType);
126  itkSetMacro(UpperBoundary, PixelType);
127  itkGetConstMacro(InsideValue, OutputPixelType);
128  itkGetConstMacro(OutsideValue, OutputPixelType);
129  itkGetConstMacro(UpperBoundary, PixelType);
131 
136  itkGetConstMacro(NumberOfObjects, SizeValueType);
137 
141  itkGetConstMacro(ThresholdValue, PixelType);
142 
144  using InputImageType = TInputImage;
145  using InputImagePointer = typename InputImageType::ConstPointer;
147  using InputImagePixelType = typename InputImageType::PixelType;
148 
150  using OutputImageType = TOutputImage;
151  using OutputImagePointer = typename OutputImageType::Pointer;
153  using OutputImagePixelType = typename OutputImageType::PixelType;
154 
155 protected:
158  void PrintSelf(std::ostream & os, Indent indent) const override;
159 
160  void GenerateData() override;
161 
166  SizeValueType ComputeConnectedComponents();
167 
168 private:
169 
171  using FilterPixelType = unsigned int;
172 
173  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
174 
175  using FilterImageType =
177 
179 
180  //
181  // Binary Threshold Filter
182  //
183  using ThresholdFilterType =
185 
186  //
187  // Connected Components Filter
188  //
189  using ConnectedFilterType =
191 
192  //
193  // Relabeled Components Filter
194  //
195  using RelabelFilterType =
197 
198  //
199  // Minimum maximum calculator
200  //
202 
203  //
204  // Declare member variables for the filters of the internal pipeline.
205  //
208 
210 
212 
213  // Variables defined by the user
215 
216  // Binary threshold variables
219 
222 
223  // Filter variables
226 };
227 } // end namespace itk
228 
229 #ifndef ITK_MANUAL_INSTANTIATION
230 #include "itkThresholdMaximumConnectedComponentsImageFilter.hxx"
231 #endif
232 
233 #endif
typename OutputImageType::Pointer OutputImagePointer
unsigned long SizeValueType
Definition: itkIntTypes.h:83
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Base class for all process objects that output image data.
typename OutputImageType::PixelType OutputImagePixelType
Binarize an input image by thresholding.
typename InputImageType::PixelType InputImagePixelType
typename InputImageType::Pointer InputImagePointer
Finds the threshold value of an image based on maximizing the number of objects in the image that are...
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
Computes the minimum and the maximum intensity values of an image.
Relabel the components in an image such that consecutive labels are used.
typename InputImageType::RegionType InputImageRegionType
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
#define itkConceptMacro(name, concept)
Templated n-dimensional image class.
Definition: itkImage.h:75
Label the objects in a binary image.