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 
23 namespace itk
24 {
53 template <typename TInputImage, typename TOutputImage, typename TFunctor, typename TMaskImage = TInputImage>
54 class ITK_TEMPLATE_EXPORT ConnectedComponentFunctorImageFilter
55  : public ConnectedComponentImageFilter<TInputImage, TOutputImage, TMaskImage>
56 {
57 public:
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 
90  using SizeType = typename TInputImage::SizeType;
92  using ListType = std::list<IndexType>;
93 
95 
101 
105  itkOverrideGetNameOfClassMacro(ConnectedComponentFunctorImageFilter);
106 
110  itkNewMacro(Self);
111 
116  FunctorType &
118  {
119  return m_Functor;
120  }
121  const FunctorType &
122  GetFunctor() const
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 
155 protected:
157  ~ConnectedComponentFunctorImageFilter() override = default;
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
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::ConnectedComponentImageFilter::MaskImageType
TMaskImage MaskImageType
Definition: itkConnectedComponentImageFilter.h:96
itk::ConnectedComponentFunctorImageFilter
A generic connected components filter that labels the objects in an arbitrary image.
Definition: itkConnectedComponentFunctorImageFilter.h:54
itk::ConnectedComponentFunctorImageFilter::GetFunctor
const FunctorType & GetFunctor() const
Definition: itkConnectedComponentFunctorImageFilter.h:122
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::SmartPointer< Self >
itk::ConnectedComponentFunctorImageFilter::ConnectedComponentFunctorImageFilter
ConnectedComponentFunctorImageFilter(const Self &)
Definition: itkConnectedComponentFunctorImageFilter.h:158
itk::ScanlineFilterCommon::OutputPixelType
typename TOutputImage::PixelType OutputPixelType
Definition: itkScanlineFilterCommon.h:77
itk::Concept::SameDimension
Definition: itkConceptChecking.h:697
itk::ConnectedComponentImageFilter::InputInternalPixelType
typename TInputImage::InternalPixelType InputInternalPixelType
Definition: itkConnectedComponentImageFilter.h:86
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::ConnectedComponentImageFilter::OutputInternalPixelType
typename TOutputImage::InternalPixelType OutputInternalPixelType
Definition: itkConnectedComponentImageFilter.h:84
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::Functor::SimilarVectorsFunctor< TInputImage::ValueType >
FunctorType
Functor::Add2< typename TInputImage1::PixelType, typename TInputImage2::PixelType, typename TOutputImage::PixelType > FunctorType
Definition: itkAddImageFilter.h:97
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itk::ScanlineFilterCommon::InputPixelType
typename TInputImage::PixelType InputPixelType
Definition: itkScanlineFilterCommon.h:78
itk::ConnectedComponentFunctorImageFilter::GetFunctor
FunctorType & GetFunctor()
Definition: itkConnectedComponentFunctorImageFilter.h:117
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::ConnectedComponentImageFilter::MaskImagePointer
typename MaskImageType::Pointer MaskImagePointer
Definition: itkConnectedComponentImageFilter.h:109
itkConnectedComponentImageFilter.h
itk::Concept::Convertible
Definition: itkConceptChecking.h:217
itk::ConnectedComponentFunctorImageFilter::SetFunctor
void SetFunctor(const FunctorType &functor)
Definition: itkConnectedComponentFunctorImageFilter.h:135
itk::ConnectedComponentImageFilter::ListType
std::list< IndexType > ListType
Definition: itkConnectedComponentImageFilter.h:108
itk::ConnectedComponentImageFilter
Label the objects in a binary image.
Definition: itkConnectedComponentImageFilter.h:59
itk::Concept::IncrementDecrementOperators
Definition: itkConceptChecking.h:618
itk::ScanlineFilterCommon::IndexType
typename TInputImage::IndexType IndexType
Definition: itkScanlineFilterCommon.h:85
itk::Concept::EqualityComparable
Definition: itkConceptChecking.h:307
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90
itk::ScanlineFilterCommon::RegionType
OutputRegionType RegionType
Definition: itkScanlineFilterCommon.h:91
itk::ConnectedComponentImageFilter::MaskPixelType
typename TMaskImage::PixelType MaskPixelType
Definition: itkConnectedComponentImageFilter.h:87
itk::ScanlineFilterCommon::SizeType
typename TInputImage::SizeType SizeType
Definition: itkScanlineFilterCommon.h:86