ITK  4.13.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:
46  itkStaticConstMacro(InputImageDimension, unsigned int,
47  TInputImage::ImageDimension);
48  itkStaticConstMacro(OutputImageDimension, unsigned int,
49  TOutputImage::ImageDimension);
51 
53  typedef TInputImage InputImageType;
54  typedef TOutputImage OutputImageType;
55 
61 
63  itkNewMacro(Self);
64 
67 
69  typedef typename InputImageType::PixelType InputPixelType;
70  typedef typename OutputImageType::PixelType OutputPixelType;
71 
72  typedef typename InputImageType::RegionType InputImageRegionType;
73  typedef typename OutputImageType::RegionType OutputImageRegionType;
74 
77 
84  itkGetConstReferenceMacro(MajorityThreshold, unsigned int);
85  itkSetMacro(MajorityThreshold, unsigned int);
87 
89  itkGetConstReferenceMacro(NumberOfPixelsChanged, SizeValueType);
90 
91 #ifdef ITK_USE_CONCEPT_CHECKING
92  // Begin concept checking
93  itkConceptMacro( IntConvertibleToInputCheck,
95  itkConceptMacro( UnsignedIntConvertibleToInputCheck,
97  // End concept checking
98 #endif
99 
100 protected:
102  virtual ~VotingBinaryHoleFillingImageFilter() ITK_OVERRIDE {}
103  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
104 
108  void SetBirthThreshold(const unsigned int value) ITK_OVERRIDE
109  { this->Superclass::SetBirthThreshold(value); }
110  void SetSurvivalThreshold(const unsigned int value) ITK_OVERRIDE
111  { this->Superclass::SetSurvivalThreshold(value); }
113 
124  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
125  ThreadIdType threadId) ITK_OVERRIDE;
126 
129  void BeforeThreadedGenerateData() ITK_OVERRIDE;
130 
131  void AfterThreadedGenerateData() ITK_OVERRIDE;
132 
133 private:
134  ITK_DISALLOW_COPY_AND_ASSIGN(VotingBinaryHoleFillingImageFilter);
135 
136  unsigned int m_MajorityThreshold;
137 
138  SizeValueType m_NumberOfPixelsChanged;
139 
140  // Auxiliary array for multi-threading
141  Array< SizeValueType > m_Count;
142 };
143 } // end namespace itk
144 
145 #ifndef ITK_MANUAL_INSTANTIATION
146 #include "itkVotingBinaryHoleFillingImageFilter.hxx"
147 #endif
148 
149 #endif
Array class with size defined at construction time.
Definition: itkArray.h:50
Base class for all process objects that output image data.
unsigned long SizeValueType
Definition: itkIntTypes.h:143
Fills in holes and cavities by applying a voting operation on each pixel.
void SetBirthThreshold(const unsigned int value) override
VotingBinaryImageFilter< InputImageType, OutputImageType > Superclass
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
void SetSurvivalThreshold(const unsigned int value) override
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Applies a voting operation in a neighborhood of each pixel.
#define itkConceptMacro(name, concept)