ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkVotingBinaryImageFilter.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 itkVotingBinaryImageFilter_h
19 #define itkVotingBinaryImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 
23 namespace itk
24 {
38 template< typename TInputImage, typename TOutputImage >
39 class ITK_TEMPLATE_EXPORT VotingBinaryImageFilter:
40  public ImageToImageFilter< TInputImage, TOutputImage >
41 {
42 public:
44  itkStaticConstMacro(InputImageDimension, unsigned int,
45  TInputImage::ImageDimension);
46  itkStaticConstMacro(OutputImageDimension, unsigned int,
47  TOutputImage::ImageDimension);
49 
51  typedef TInputImage InputImageType;
52  typedef TOutputImage OutputImageType;
53 
59 
61  itkNewMacro(Self);
62 
65 
67  typedef typename InputImageType::PixelType InputPixelType;
68  typedef typename OutputImageType::PixelType OutputPixelType;
69 
70  typedef typename InputImageType::RegionType InputImageRegionType;
71  typedef typename OutputImageType::RegionType OutputImageRegionType;
72 
74 
76  itkSetMacro(Radius, InputSizeType);
77 
79  itkGetConstReferenceMacro(Radius, InputSizeType);
80 
83  itkSetMacro(BackgroundValue, InputPixelType);
84  itkSetMacro(ForegroundValue, InputPixelType);
86 
89  itkGetConstReferenceMacro(BackgroundValue, InputPixelType);
90  itkGetConstReferenceMacro(ForegroundValue, InputPixelType);
92 
95  itkGetConstReferenceMacro(BirthThreshold, unsigned int);
96  itkSetMacro(BirthThreshold, unsigned int);
98 
101  itkGetConstReferenceMacro(SurvivalThreshold, unsigned int);
102  itkSetMacro(SurvivalThreshold, unsigned int);
104 
111  virtual void GenerateInputRequestedRegion() ITK_OVERRIDE;
112 
113 #ifdef ITK_USE_CONCEPT_CHECKING
114  // Begin concept checking
115  itkConceptMacro( InputEqualityComparableCheck,
117  itkConceptMacro( IntConvertibleToInputCheck,
119  itkConceptMacro( InputConvertibleToOutputCheck,
121  itkConceptMacro( SameDimensionCheck,
123  itkConceptMacro( InputOStreamWritableCheck,
125  // End concept checking
126 #endif
127 
128 protected:
130  virtual ~VotingBinaryImageFilter() ITK_OVERRIDE {}
131  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
132 
143  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
144  ThreadIdType threadId) ITK_OVERRIDE;
145 
146 private:
147  ITK_DISALLOW_COPY_AND_ASSIGN(VotingBinaryImageFilter);
148 
150 
153 
154  unsigned int m_BirthThreshold;
155  unsigned int m_SurvivalThreshold;
156 };
157 } // end namespace itk
158 
159 #ifndef ITK_MANUAL_INSTANTIATION
160 #include "itkVotingBinaryImageFilter.hxx"
161 #endif
162 
163 #endif
InputImageType::PixelType InputPixelType
InputImageType::RegionType InputImageRegionType
InputImageType::SizeType InputSizeType
Base class for all process objects that output image data.
ImageToImageFilter< InputImageType, OutputImageType > Superclass
OutputImageType::PixelType OutputPixelType
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
OutputImageType::RegionType OutputImageRegionType
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
SmartPointer< const Self > ConstPointer
Applies a voting operation in a neighborhood of each pixel.
#define itkConceptMacro(name, concept)