ITK  6.0.0
Insight Toolkit
itkConnectedComponentFunctorImageFilter.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 itkConnectedComponentFunctorImageFilter_h
19#define itkConnectedComponentFunctorImageFilter_h
20
22
23namespace itk
24{
53template <typename TInputImage, typename TOutputImage, typename TFunctor, typename TMaskImage = TInputImage>
54class ITK_TEMPLATE_EXPORT ConnectedComponentFunctorImageFilter
55 : public ConnectedComponentImageFilter<TInputImage, TOutputImage, TMaskImage>
56{
57public:
63
67 using typename Superclass::InputImagePointer;
68
73 using OutputPixelType = typename TOutputImage::PixelType;
74 using OutputInternalPixelType = typename TOutputImage::InternalPixelType;
75 using InputPixelType = typename TInputImage::PixelType;
76 using InputInternalPixelType = typename TInputImage::InternalPixelType;
77 using MaskPixelType = typename TMaskImage::PixelType;
78 static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension;
79 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
80
84 using FunctorType = TFunctor;
85 using InputImageType = TInputImage;
86 using MaskImageType = TMaskImage;
87 using OutputImageType = TOutputImage;
88
92 using ListType = std::list<IndexType>;
93
95
101
105 itkOverrideGetNameOfClassMacro(ConnectedComponentFunctorImageFilter);
106
110 itkNewMacro(Self);
111
118 {
119 return m_Functor;
120 }
121 const FunctorType &
123 {
124 return m_Functor;
125 }
134 void
135 SetFunctor(const FunctorType & functor)
136 {
137 m_Functor = functor;
138 this->Modified();
139 }
142#ifdef ITK_USE_CONCEPT_CHECKING
143 // Begin concept checking
145 itkConceptMacro(InputEqualityComparableCheck, (Concept::EqualityComparable<InputPixelType>));
146 itkConceptMacro(OutputEqualityComparableCheck, (Concept::EqualityComparable<OutputPixelType>));
147 itkConceptMacro(OutputConvertibleToUnsignedIntCheck, (Concept::Convertible<OutputPixelType, unsigned int>));
148 itkConceptMacro(OutputConvertibleToUnsignedLongCheck, (Concept::Convertible<OutputPixelType, unsigned long>));
149 itkConceptMacro(OutputConvertibleToLongCheck, (Concept::Convertible<OutputPixelType, long>));
150 itkConceptMacro(UnsignedLongConvertibleToOutputCheck, (Concept::Convertible<unsigned long, OutputPixelType>));
151 itkConceptMacro(OutputIncrementDecrementOperatorsCheck, (Concept::IncrementDecrementOperators<OutputPixelType>));
152 // End concept checking
153#endif
154
155protected:
159
160 FunctorType m_Functor{};
161
165 void
166 GenerateData() override;
167};
168} // end namespace itk
169
170#ifndef ITK_MANUAL_INSTANTIATION
171# include "itkConnectedComponentFunctorImageFilter.hxx"
172#endif
173
174#endif
A generic connected components filter that labels the objects in an arbitrary image.
~ConnectedComponentFunctorImageFilter() override=default
typename TOutputImage::InternalPixelType OutputInternalPixelType
typename TInputImage::InternalPixelType InputInternalPixelType
Label the objects in a binary image.
Base class for all process objects that output image data.
TOutputImage OutputImageType
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
typename TInputImage::IndexType IndexType
typename TInputImage::SizeType SizeType
typename TInputImage::PixelType InputPixelType
typename TOutputImage::PixelType OutputPixelType
Functor::Add2< typename TInputImage1::PixelType, typename TInputImage2::PixelType, typename TOutputImage::PixelType > FunctorType
SmartPointer< Self > Pointer
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....