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{
74template <typename TInputImage, typename TOutputImage = TInputImage>
75class ITK_TEMPLATE_EXPORT LabelVotingImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
76{
77public:
78 ITK_DISALLOW_COPY_AND_MOVE(LabelVotingImageFilter);
79
85
87 itkNewMacro(Self);
88
90 itkOverrideGetNameOfClassMacro(LabelVotingImageFilter);
91
94 using OutputPixelType = typename TOutputImage::PixelType;
95 using InputPixelType = typename TInputImage::PixelType;
96
99 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
100 static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension;
101
103 using InputImageType = TInputImage;
104 using OutputImageType = TOutputImage;
105 using InputImagePointer = typename InputImageType::ConstPointer;
106 using OutputImagePointer = typename OutputImageType::Pointer;
107
108 using LabelCountType = unsigned long;
109
112
114 void
116 {
118 this->m_HasLabelForUndecidedPixels = true;
119 this->Modified();
120 }
121
128 OutputPixelType
130 {
131 return this->m_LabelForUndecidedPixels;
132 }
133
136 void
138 {
140 {
141 this->m_HasLabelForUndecidedPixels = false;
142 this->Modified();
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:51
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....