ITK  5.4.0
Insight Toolkit
itkBinaryPruningImageFilter.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  * https://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 itkBinaryPruningImageFilter_h
19 #define itkBinaryPruningImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
24 
25 namespace itk
26 {
58 template <typename TInputImage, typename TOutputImage>
59 class ITK_TEMPLATE_EXPORT BinaryPruningImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
60 {
61 public:
62  ITK_DISALLOW_COPY_AND_MOVE(BinaryPruningImageFilter);
63 
69 
71  itkNewMacro(Self);
72 
74  itkOverrideGetNameOfClassMacro(BinaryPruningImageFilter);
75 
77  using InputImageType = TInputImage;
78 
80  using OutputImageType = TOutputImage;
81 
84 
86  using IndexType = typename RegionType::IndexType;
87 
89  using PixelType = typename InputImageType::PixelType;
90 
92  using SizeType = typename RegionType::SizeType;
93 
96 
99 
102 
105  GetPruning();
106 
108  itkSetMacro(Iteration, unsigned int);
109  itkGetConstMacro(Iteration, unsigned int);
113  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
114  static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
115 
116 #ifdef ITK_USE_CONCEPT_CHECKING
117  // Begin concept checking
120  itkConceptMacro(AdditiveOperatorsCheck, (Concept::AdditiveOperators<PixelType>));
121  itkConceptMacro(IntConvertibleToPixelTypeCheck, (Concept::Convertible<int, PixelType>));
123  // End concept checking
124 #endif
125 
126 protected:
128  ~BinaryPruningImageFilter() override = default;
129  void
130  PrintSelf(std::ostream & os, Indent indent) const override;
131 
133  void
134  GenerateData() override;
135 
137  void
138  PrepareData();
139 
141  void
142  ComputePruneImage();
143 
144 private:
145  unsigned int m_Iteration{};
146 }; // end of BinaryThinningImageFilter class
147 } // end namespace itk
148 
149 #ifndef ITK_MANUAL_INSTANTIATION
150 # include "itkBinaryPruningImageFilter.hxx"
151 #endif
152 
153 #endif
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itk::ImageSource::OutputImagePointer
typename OutputImageType::Pointer OutputImagePointer
Definition: itkImageSource.h:91
itk::BinaryPruningImageFilter
This filter removes "spurs" of less than a certain length in the input image.
Definition: itkBinaryPruningImageFilter.h:59
itkNeighborhoodIterator.h
itk::BinaryPruningImageFilter::PixelType
typename InputImageType::PixelType PixelType
Definition: itkBinaryPruningImageFilter.h:89
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itkImageRegionIteratorWithIndex.h
itk::Concept::SameDimension
Definition: itkConceptChecking.h:694
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
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::ImageToImageFilter::InputImagePointer
typename InputImageType::Pointer InputImagePointer
Definition: itkImageToImageFilter.h:130
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::BinaryPruningImageFilter::IndexType
typename RegionType::IndexType IndexType
Definition: itkBinaryPruningImageFilter.h:86
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itkImageToImageFilter.h
itk::NeighborhoodIterator
Defines iteration of a local N-dimensional neighborhood of pixels across an itk::Image.
Definition: itkNeighborhoodIterator.h:212
itk::Concept::AdditiveOperators
Definition: itkConceptChecking.h:358
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk::Concept::SameType
Definition: itkConceptChecking.h:677
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::Concept::Convertible
Definition: itkConceptChecking.h:216
itk::BinaryPruningImageFilter::RegionType
typename InputImageType::RegionType RegionType
Definition: itkBinaryPruningImageFilter.h:83
itk::BinaryPruningImageFilter::SizeType
typename RegionType::SizeType SizeType
Definition: itkBinaryPruningImageFilter.h:92
itk::Concept::LessThanComparable
Definition: itkConceptChecking.h:262
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90