ITK  6.0.0
Insight Toolkit
itkVotingBinaryHoleFillingImageFilter.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 itkVotingBinaryHoleFillingImageFilter_h
19 #define itkVotingBinaryHoleFillingImageFilter_h
20 
22 #include "itkArray.h"
23 
24 namespace itk
25 {
41 template <typename TInputImage, typename TOutputImage>
42 class ITK_TEMPLATE_EXPORT VotingBinaryHoleFillingImageFilter : public VotingBinaryImageFilter<TInputImage, TOutputImage>
43 {
44 public:
45  ITK_DISALLOW_COPY_AND_MOVE(VotingBinaryHoleFillingImageFilter);
46 
48  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
49  static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
50 
52  using InputImageType = TInputImage;
53  using OutputImageType = TOutputImage;
54 
60 
62  itkNewMacro(Self);
63 
65  itkOverrideGetNameOfClassMacro(VotingBinaryHoleFillingImageFilter);
66 
68  using InputPixelType = typename InputImageType::PixelType;
69  using OutputPixelType = typename OutputImageType::PixelType;
70 
73 
76 
83  itkGetConstReferenceMacro(MajorityThreshold, unsigned int);
84  itkSetMacro(MajorityThreshold, unsigned int);
88  itkGetConstReferenceMacro(NumberOfPixelsChanged, SizeValueType);
89 
90 #ifdef ITK_USE_CONCEPT_CHECKING
91  // Begin concept checking
92  itkConceptMacro(IntConvertibleToInputCheck, (Concept::Convertible<int, InputPixelType>));
93  itkConceptMacro(UnsignedIntConvertibleToInputCheck, (Concept::Convertible<unsigned int, InputPixelType>));
94  // End concept checking
95 #endif
96 
97 protected:
99  ~VotingBinaryHoleFillingImageFilter() override = default;
100  void
101  PrintSelf(std::ostream & os, Indent indent) const override;
102 
106  void
107  SetBirthThreshold(const unsigned int value) override
108  {
109  this->Superclass::SetBirthThreshold(value);
110  }
111  void
112  SetSurvivalThreshold(const unsigned int value) override
113  {
114  this->Superclass::SetSurvivalThreshold(value);
115  }
128  void
129  ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId) override;
130 
131  void
133  {
134  itkExceptionMacro("This class requires threadId so it must use classic multi-threading model");
135  }
136 
139  void
140  BeforeThreadedGenerateData() override;
141 
142  void
143  AfterThreadedGenerateData() override;
144 
145 private:
146  unsigned int m_MajorityThreshold{};
147 
148  SizeValueType m_NumberOfPixelsChanged{};
149 
150  // Auxiliary array for multi-threading
152 };
153 } // end namespace itk
154 
155 #ifndef ITK_MANUAL_INSTANTIATION
156 # include "itkVotingBinaryHoleFillingImageFilter.hxx"
157 #endif
158 
159 #endif
itk::VotingBinaryImageFilter
Applies a voting operation in a neighborhood of each pixel.
Definition: itkVotingBinaryImageFilter.h:40
itk::VotingBinaryHoleFillingImageFilter
Fills in holes and cavities by applying a voting operation on each pixel.
Definition: itkVotingBinaryHoleFillingImageFilter.h:42
itk::VotingBinaryHoleFillingImageFilter::OutputPixelType
typename OutputImageType::PixelType OutputPixelType
Definition: itkVotingBinaryHoleFillingImageFilter.h:69
itkVotingBinaryImageFilter.h
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::ThreadIdType
unsigned int ThreadIdType
Definition: itkIntTypes.h:102
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::VotingBinaryHoleFillingImageFilter::InputPixelType
typename InputImageType::PixelType InputPixelType
Definition: itkVotingBinaryHoleFillingImageFilter.h:68
itk::VotingBinaryHoleFillingImageFilter::InputSizeType
typename InputImageType::SizeType InputSizeType
Definition: itkVotingBinaryHoleFillingImageFilter.h:74
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::VotingBinaryHoleFillingImageFilter::SetSurvivalThreshold
void SetSurvivalThreshold(const unsigned int value) override
Definition: itkVotingBinaryHoleFillingImageFilter.h:112
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itkArray.h
itk::VotingBinaryHoleFillingImageFilter::SizeValueType
typename InputImageType::SizeValueType SizeValueType
Definition: itkVotingBinaryHoleFillingImageFilter.h:75
itk::ImageSource::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition: itkImageSource.h:92
itk::VotingBinaryHoleFillingImageFilter::DynamicThreadedGenerateData
void DynamicThreadedGenerateData(const OutputImageRegionType &) override
Definition: itkVotingBinaryHoleFillingImageFilter.h:132
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::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::VotingBinaryHoleFillingImageFilter::SetBirthThreshold
void SetBirthThreshold(const unsigned int value) override
Definition: itkVotingBinaryHoleFillingImageFilter.h:107
itk::Concept::Convertible
Definition: itkConceptChecking.h:217
itk::Array< SizeValueType >
itk::ImageToImageFilter::InputImageRegionType
typename InputImageType::RegionType InputImageRegionType
Definition: itkImageToImageFilter.h:132
itk::SizeValueType
unsigned long SizeValueType
Definition: itkIntTypes.h:86
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90