ITK  6.0.0
Insight Toolkit
itkVotingBinaryIterativeHoleFillingImageFilter.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 itkVotingBinaryIterativeHoleFillingImageFilter_h
19 #define itkVotingBinaryIterativeHoleFillingImageFilter_h
20 
22 
23 namespace itk
24 {
55 template <typename TImage>
56 class ITK_TEMPLATE_EXPORT VotingBinaryIterativeHoleFillingImageFilter : public ImageToImageFilter<TImage, TImage>
57 {
58 public:
59  ITK_DISALLOW_COPY_AND_MOVE(VotingBinaryIterativeHoleFillingImageFilter);
60 
62  using InputImageType = TImage;
63  using OutputImageType = TImage;
64 
70 
72  itkNewMacro(Self);
73 
75  itkOverrideGetNameOfClassMacro(VotingBinaryIterativeHoleFillingImageFilter);
76 
80 
82  using InputPixelType = typename InputImageType::PixelType;
83  using OutputPixelType = typename OutputImageType::PixelType;
84 
87 
89 
93  itkGetConstReferenceMacro(MaximumNumberOfIterations, unsigned int);
94  itkSetMacro(MaximumNumberOfIterations, unsigned int);
100  itkGetConstReferenceMacro(CurrentNumberOfIterations, unsigned int);
101  itkSetMacro(CurrentNumberOfIterations, unsigned int);
105  itkSetMacro(Radius, InputSizeType);
106 
108  itkGetConstReferenceMacro(Radius, InputSizeType);
109 
112  itkSetMacro(BackgroundValue, InputPixelType);
113  itkSetMacro(ForegroundValue, InputPixelType);
118  itkGetConstReferenceMacro(BackgroundValue, InputPixelType);
119  itkGetConstReferenceMacro(ForegroundValue, InputPixelType);
128  itkGetConstReferenceMacro(MajorityThreshold, unsigned int);
129  itkSetMacro(MajorityThreshold, unsigned int);
133  itkGetConstReferenceMacro(NumberOfPixelsChanged, unsigned int);
134 
135 #ifdef ITK_USE_CONCEPT_CHECKING
136  // Begin concept checking
137  itkConceptMacro(InputEqualityComparableCheck, (Concept::EqualityComparable<InputPixelType>));
138  itkConceptMacro(InputOStreamWritableeCheck, (Concept::OStreamWritable<InputPixelType>));
139  // End concept checking
140 #endif
141 
142 protected:
144  ~VotingBinaryIterativeHoleFillingImageFilter() override = default;
145  void
146  PrintSelf(std::ostream & os, Indent indent) const override;
147 
151  void
152  GenerateData() override;
153 
154 private:
155  InputSizeType m_Radius{};
156 
157  InputPixelType m_ForegroundValue{};
158  InputPixelType m_BackgroundValue{};
159 
160  unsigned int m_MaximumNumberOfIterations{};
161  unsigned int m_CurrentNumberOfIterations{};
162  unsigned int m_MajorityThreshold{};
163  unsigned int m_NumberOfPixelsChanged{};
164 };
165 } // end namespace itk
166 
167 #ifndef ITK_MANUAL_INSTANTIATION
168 # include "itkVotingBinaryIterativeHoleFillingImageFilter.hxx"
169 #endif
170 
171 #endif
itk::VotingBinaryIterativeHoleFillingImageFilter::InputImageRegionType
typename InputImageType::RegionType InputImageRegionType
Definition: itkVotingBinaryIterativeHoleFillingImageFilter.h:85
itk::VotingBinaryIterativeHoleFillingImageFilter::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition: itkVotingBinaryIterativeHoleFillingImageFilter.h:86
itk::VotingBinaryHoleFillingImageFilter
Fills in holes and cavities by applying a voting operation on each pixel.
Definition: itkVotingBinaryHoleFillingImageFilter.h:42
itk::Concept::OStreamWritable
Definition: itkConceptChecking.h:639
itk::VotingBinaryIterativeHoleFillingImageFilter::InputImageType
TImage InputImageType
Definition: itkVotingBinaryIterativeHoleFillingImageFilter.h:62
itk::VotingBinaryIterativeHoleFillingImageFilter::OutputPixelType
typename OutputImageType::PixelType OutputPixelType
Definition: itkVotingBinaryIterativeHoleFillingImageFilter.h:83
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
itk::VotingBinaryIterativeHoleFillingImageFilter::OutputImageType
TImage OutputImageType
Definition: itkVotingBinaryIterativeHoleFillingImageFilter.h:63
itk::VotingBinaryIterativeHoleFillingImageFilter::InputPixelType
typename InputImageType::PixelType InputPixelType
Definition: itkVotingBinaryIterativeHoleFillingImageFilter.h:82
itk::ImageToImageFilter
Base class for filters that take an image as input and produce an image as output.
Definition: itkImageToImageFilter.h:108
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::VotingBinaryIterativeHoleFillingImageFilter::InputSizeType
typename InputImageType::SizeType InputSizeType
Definition: itkVotingBinaryIterativeHoleFillingImageFilter.h:88
itkVotingBinaryHoleFillingImageFilter.h
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::VotingBinaryIterativeHoleFillingImageFilter
Fills in holes and cavities by iteratively applying a voting operation.
Definition: itkVotingBinaryIterativeHoleFillingImageFilter.h:56
itk::Concept::EqualityComparable
Definition: itkConceptChecking.h:307