ITK  4.3.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< class TInputImage, class TOutputImage >
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 
75  typedef typename InputImageType::SizeType InputSizeType;
77 
84  itkGetConstReferenceMacro(MajorityThreshold, unsigned int);
85  itkSetMacro(MajorityThreshold, unsigned int);
87 
89  itkGetConstReferenceMacro(NumberOfPixelsChanged, SizeValueType);
90 
91 #ifdef ITK_USE_CONCEPT_CHECKING
92 
93  itkConceptMacro( IntConvertibleToInputCheck,
95  itkConceptMacro( UnsignedIntConvertibleToInputCheck,
97 
99 #endif
100 
101 protected:
104  void PrintSelf(std::ostream & os, Indent indent) const;
105 
109  void SetBirthThreshold(const unsigned int value)
110  { this->Superclass::SetBirthThreshold(value); }
111  void SetSurvivalThreshold(const unsigned int value)
112  { this->Superclass::SetSurvivalThreshold(value); }
114 
125  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
126  ThreadIdType threadId);
127 
130  void BeforeThreadedGenerateData();
131 
132  void AfterThreadedGenerateData();
133 
134 private:
135  VotingBinaryHoleFillingImageFilter(const Self &); //purposely not implemented
136  void operator=(const Self &); //purposely not implemented
137 
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
152