ITK  5.3.0
Insight Toolkit
itkVotingBinaryImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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 {
39 template <typename TInputImage, typename TOutputImage>
40 class ITK_TEMPLATE_EXPORT VotingBinaryImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
41 {
42 public:
43  ITK_DISALLOW_COPY_AND_MOVE(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
111  GenerateInputRequestedRegion() override;
112 
113 #ifdef ITK_USE_CONCEPT_CHECKING
114  // Begin concept checking
115  itkConceptMacro(InputEqualityComparableCheck, (Concept::EqualityComparable<InputPixelType>));
116  itkConceptMacro(IntConvertibleToInputCheck, (Concept::Convertible<int, InputPixelType>));
119  itkConceptMacro(InputOStreamWritableCheck, (Concept::OStreamWritable<InputPixelType>));
120  // End concept checking
121 #endif
122 
123 protected:
125  ~VotingBinaryImageFilter() override = default;
126  void
127  PrintSelf(std::ostream & os, Indent indent) const override;
128 
139  void
140  DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
141 
142 private:
144 
147 
148  unsigned int m_BirthThreshold;
149  unsigned int m_SurvivalThreshold;
150 };
151 } // end namespace itk
152 
153 #ifndef ITK_MANUAL_INSTANTIATION
154 # include "itkVotingBinaryImageFilter.hxx"
155 #endif
156 
157 #endif
itk::VotingBinaryImageFilter
Applies a voting operation in a neighborhood of each pixel.
Definition: itkVotingBinaryImageFilter.h:40
itk::VotingBinaryImageFilter::InputSizeType
typename InputImageType::SizeType InputSizeType
Definition: itkVotingBinaryImageFilter.h:72
itk::Concept::OStreamWritable
Definition: itkConceptChecking.h:636
itk::VotingBinaryImageFilter::InputPixelType
typename InputImageType::PixelType InputPixelType
Definition: itkVotingBinaryImageFilter.h:66
itk::VotingBinaryImageFilter::m_ForegroundValue
InputPixelType m_ForegroundValue
Definition: itkVotingBinaryImageFilter.h:145
itk::VotingBinaryImageFilter::m_BackgroundValue
InputPixelType m_BackgroundValue
Definition: itkVotingBinaryImageFilter.h:146
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::VotingBinaryImageFilter::m_BirthThreshold
unsigned int m_BirthThreshold
Definition: itkVotingBinaryImageFilter.h:148
itk::VotingBinaryImageFilter::OutputPixelType
typename OutputImageType::PixelType OutputPixelType
Definition: itkVotingBinaryImageFilter.h:67
itk::Concept::SameDimension
Definition: itkConceptChecking.h:694
itk::ImageToImageFilter
Base class for filters that take an image as input and produce an image as output.
Definition: itkImageToImageFilter.h:108
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::VotingBinaryImageFilter::m_Radius
InputSizeType m_Radius
Definition: itkVotingBinaryImageFilter.h:143
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itkImageToImageFilter.h
itk::ImageSource::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition: itkImageSource.h:92
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:138
itk::Concept::Convertible
Definition: itkConceptChecking.h:216
itk::VotingBinaryImageFilter::m_SurvivalThreshold
unsigned int m_SurvivalThreshold
Definition: itkVotingBinaryImageFilter.h:149
itk::ImageToImageFilter::InputImageRegionType
typename InputImageType::RegionType InputImageRegionType
Definition: itkImageToImageFilter.h:132
itk::Concept::EqualityComparable
Definition: itkConceptChecking.h:306
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90