ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkLabelVotingImageFilter.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 itkLabelVotingImageFilter_h
19#define itkLabelVotingImageFilter_h
20
22
23namespace itk
24{
72template <typename TInputImage, typename TOutputImage = TInputImage>
73class ITK_TEMPLATE_EXPORT LabelVotingImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
74{
75public:
76 ITK_DISALLOW_COPY_AND_MOVE(LabelVotingImageFilter);
77
83
85 itkNewMacro(Self);
86
88 itkOverrideGetNameOfClassMacro(LabelVotingImageFilter);
89
92 using OutputPixelType = typename TOutputImage::PixelType;
93 using InputPixelType = typename TInputImage::PixelType;
94
97 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
98 static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension;
99
101 using InputImageType = TInputImage;
102 using OutputImageType = TOutputImage;
103 using InputImagePointer = typename InputImageType::ConstPointer;
104 using OutputImagePointer = typename OutputImageType::Pointer;
105
106 using LabelCountType = unsigned long;
107
110
112 void
114 {
116 this->m_HasLabelForUndecidedPixels = true;
117 this->Modified();
118 }
119
120
127 OutputPixelType
129 {
130 return this->m_LabelForUndecidedPixels;
131 }
132
135 void
137 {
139 {
140 this->m_HasLabelForUndecidedPixels = false;
141 this->Modified();
142 }
143 }
144
145
147 itkConceptMacro(IntConvertibleToInputCheck, (Concept::Convertible<int, InputPixelType>));
150 itkConceptMacro(IntConvertibleToOutputPixelType, (Concept::Convertible<int, OutputPixelType>));
152 itkConceptMacro(InputIncrementDecrementOperatorsCheck, (Concept::IncrementDecrementOperators<InputPixelType>));
153 itkConceptMacro(OutputOStreamWritableCheck, (Concept::OStreamWritable<OutputPixelType>));
154
155protected:
157 ~LabelVotingImageFilter() override = default;
158
161 void
163
164 void
165 DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
166
167
168 void
169 PrintSelf(std::ostream &, Indent) const override;
170
174
175private:
178 size_t m_TotalLabelCount{ 0 };
179};
180} // end namespace itk
181
182#ifndef ITK_MANUAL_INSTANTIATION
183# include "itkLabelVotingImageFilter.hxx"
184#endif
185
186#endif
typename OutputImageType::RegionType OutputImageRegionType
Control indentation during Print() invocation.
Definition itkIndent.h:50
typename TOutputImage::PixelType OutputPixelType
void BeforeThreadedGenerateData() override
~LabelVotingImageFilter() override=default
void PrintSelf(std::ostream &, Indent) const override
typename OutputImageType::RegionType OutputImageRegionType
static constexpr unsigned int InputImageDimension
ImageToImageFilter< TInputImage, TOutputImage > Superclass
SmartPointer< const Self > ConstPointer
typename TInputImage::PixelType InputPixelType
void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) override
void SetLabelForUndecidedPixels(const OutputPixelType l)
typename OutputImageType::Pointer OutputImagePointer
OutputPixelType GetLabelForUndecidedPixels() const
static constexpr unsigned int ImageDimension
InputPixelType ComputeMaximumInputValue()
typename InputImageType::ConstPointer InputImagePointer
virtual void Modified() const
Implements transparent reference counting.
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....