ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkVotingBinaryHoleFillingImageFilter.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 itkVotingBinaryHoleFillingImageFilter_h
19 #define itkVotingBinaryHoleFillingImageFilter_h
20 
22 #include "itkArray.h"
23 
24 namespace itk
25 {
40 template< typename TInputImage, typename TOutputImage >
41 class ITK_TEMPLATE_EXPORT VotingBinaryHoleFillingImageFilter:
42  public VotingBinaryImageFilter< TInputImage, TOutputImage >
43 {
44 public:
45  ITK_DISALLOW_COPY_AND_ASSIGN(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 
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);
86 
88  itkGetConstReferenceMacro(NumberOfPixelsChanged, SizeValueType);
89 
90 #ifdef ITK_USE_CONCEPT_CHECKING
91  // Begin concept checking
92  itkConceptMacro( IntConvertibleToInputCheck,
94  itkConceptMacro( UnsignedIntConvertibleToInputCheck,
96  // End concept checking
97 #endif
98 
99 protected:
101  ~VotingBinaryHoleFillingImageFilter() override = default;
102  void PrintSelf(std::ostream & os, Indent indent) const override;
103 
107  void SetBirthThreshold(const unsigned int value) override
108  { this->Superclass::SetBirthThreshold(value); }
109  void SetSurvivalThreshold(const unsigned int value) override
110  { this->Superclass::SetSurvivalThreshold(value); }
112 
123  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
124  ThreadIdType threadId) override;
125 
127  {
128  itkExceptionMacro("This class requires threadId so it must use classic multi-threading model");
129  }
130 
133  void BeforeThreadedGenerateData() override;
134 
135  void AfterThreadedGenerateData() override;
136 
137 private:
138  unsigned int m_MajorityThreshold;
139 
141 
142  // Auxiliary array for multi-threading
144 };
145 } // end namespace itk
146 
147 #ifndef ITK_MANUAL_INSTANTIATION
148 #include "itkVotingBinaryHoleFillingImageFilter.hxx"
149 #endif
150 
151 #endif
void DynamicThreadedGenerateData(const OutputImageRegionType &) override
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 InputImageType::SizeValueType SizeValueType
Fills in holes and cavities by applying a voting operation on each pixel.
void SetBirthThreshold(const unsigned int value) override
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
unsigned int ThreadIdType
Definition: itkIntTypes.h:99
void SetSurvivalThreshold(const unsigned int value) override
typename InputImageType::RegionType InputImageRegionType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Applies a voting operation in a neighborhood of each pixel.
#define itkConceptMacro(name, concept)