ITK  5.4.0
Insight Toolkit
itkVotingBinaryHoleFillingImageFilter.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 * https://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
24namespace itk
25{
41template <typename TInputImage, typename TOutputImage>
42class ITK_TEMPLATE_EXPORT VotingBinaryHoleFillingImageFilter : public VotingBinaryImageFilter<TInputImage, TOutputImage>
43{
44public:
45 ITK_DISALLOW_COPY_AND_MOVE(VotingBinaryHoleFillingImageFilter);
46
48 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
49 static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
50
52 using InputImageType = TInputImage;
53 using OutputImageType = TOutputImage;
54
60
62 itkNewMacro(Self);
63
65 itkOverrideGetNameOfClassMacro(VotingBinaryHoleFillingImageFilter);
66
68 using InputPixelType = typename InputImageType::PixelType;
69 using OutputPixelType = typename OutputImageType::PixelType;
70
73
76
83 itkGetConstReferenceMacro(MajorityThreshold, unsigned int);
84 itkSetMacro(MajorityThreshold, unsigned int);
88 itkGetConstReferenceMacro(NumberOfPixelsChanged, SizeValueType);
89
90#ifdef ITK_USE_CONCEPT_CHECKING
91 // Begin concept checking
93 itkConceptMacro(UnsignedIntConvertibleToInputCheck, (Concept::Convertible<unsigned int, InputPixelType>));
94 // End concept checking
95#endif
96
97protected:
100 void
101 PrintSelf(std::ostream & os, Indent indent) const override;
102
106 void
107 SetBirthThreshold(const unsigned int value) override
108 {
109 this->Superclass::SetBirthThreshold(value);
110 }
111 void
112 SetSurvivalThreshold(const unsigned int value) override
113 {
114 this->Superclass::SetSurvivalThreshold(value);
115 }
128 void
129 ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId) override;
130
131 void
133 {
134 itkExceptionMacro("This class requires threadId so it must use classic multi-threading model");
135 }
136
139 void
141
142 void
144
145private:
146 unsigned int m_MajorityThreshold{};
147
148 SizeValueType m_NumberOfPixelsChanged{};
149
150 // Auxiliary array for multi-threading
152};
153} // end namespace itk
154
155#ifndef ITK_MANUAL_INSTANTIATION
156# include "itkVotingBinaryHoleFillingImageFilter.hxx"
157#endif
158
159#endif
Base class for all process objects that output image data.
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
typename InputImageType::RegionType InputImageRegionType
Control indentation during Print() invocation.
Definition: itkIndent.h:50
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Fills in holes and cavities by applying a voting operation on each pixel.
void DynamicThreadedGenerateData(const OutputImageRegionType &) override
typename InputImageType::SizeValueType SizeValueType
~VotingBinaryHoleFillingImageFilter() override=default
void PrintSelf(std::ostream &os, Indent indent) const override
void SetBirthThreshold(const unsigned int value) override
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId) override
void SetSurvivalThreshold(const unsigned int value) override
Applies a voting operation in a neighborhood of each pixel.
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned int ThreadIdType
Definition: itkIntTypes.h:99
unsigned long SizeValueType
Definition: itkIntTypes.h:83