ITK  5.0.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:
43  ITK_DISALLOW_COPY_AND_ASSIGN(VotingBinaryImageFilter);
44 
46  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
47  static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
48 
50  using InputImageType = TInputImage;
51  using OutputImageType = TOutputImage;
52 
58 
60  itkNewMacro(Self);
61 
64 
66  using InputPixelType = typename InputImageType::PixelType;
67  using OutputPixelType = typename OutputImageType::PixelType;
68 
71 
73 
75  itkSetMacro(Radius, InputSizeType);
76 
78  itkGetConstReferenceMacro(Radius, InputSizeType);
79 
82  itkSetMacro(BackgroundValue, InputPixelType);
83  itkSetMacro(ForegroundValue, InputPixelType);
85 
88  itkGetConstReferenceMacro(BackgroundValue, InputPixelType);
89  itkGetConstReferenceMacro(ForegroundValue, InputPixelType);
91 
94  itkGetConstReferenceMacro(BirthThreshold, unsigned int);
95  itkSetMacro(BirthThreshold, unsigned int);
97 
100  itkGetConstReferenceMacro(SurvivalThreshold, unsigned int);
101  itkSetMacro(SurvivalThreshold, unsigned int);
103 
110  void GenerateInputRequestedRegion() override;
111 
112 #ifdef ITK_USE_CONCEPT_CHECKING
113  // Begin concept checking
114  itkConceptMacro( InputEqualityComparableCheck,
116  itkConceptMacro( IntConvertibleToInputCheck,
118  itkConceptMacro( InputConvertibleToOutputCheck,
120  itkConceptMacro( SameDimensionCheck,
122  itkConceptMacro( InputOStreamWritableCheck,
124  // End concept checking
125 #endif
126 
127 protected:
129  ~VotingBinaryImageFilter() override = default;
130  void PrintSelf(std::ostream & os, Indent indent) const override;
131 
142  void DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
143 
144 private:
146 
149 
150  unsigned int m_BirthThreshold;
151  unsigned int m_SurvivalThreshold;
152 };
153 } // end namespace itk
154 
155 #ifndef ITK_MANUAL_INSTANTIATION
156 #include "itkVotingBinaryImageFilter.hxx"
157 #endif
158 
159 #endif
typename InputImageType::PixelType InputPixelType
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::SizeType InputSizeType
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
typename InputImageType::RegionType InputImageRegionType
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
Applies a voting operation in a neighborhood of each pixel.
typename OutputImageType::PixelType OutputPixelType
#define itkConceptMacro(name, concept)