ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkConnectedComponentFunctorImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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  * http://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 InputImagePointer = 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 
94  using MaskImagePointer = typename MaskImageType::Pointer;
95 
101 
106 
110  itkNewMacro(Self);
111 
116  FunctorType & GetFunctor() { return m_Functor; }
117  const FunctorType & GetFunctor() const { return m_Functor; }
119 
126  void SetFunctor(const FunctorType & functor)
127  {
128  m_Functor = functor;
129  this->Modified();
130  }
132 
133 #ifdef ITK_USE_CONCEPT_CHECKING
134  // Begin concept checking
135  itkConceptMacro( SameDimensionCheck,
137  itkConceptMacro( InputEqualityComparableCheck,
139  itkConceptMacro( OutputEqualityComparableCheck,
141  itkConceptMacro( OutputConvertibleToUnsignedIntCheck,
143  itkConceptMacro( OutputConvertibleToUnsignedLongCheck,
145  itkConceptMacro( OutputConvertibleToLongCheck,
147  itkConceptMacro( UnsignedLongConvertibleToOutputCheck,
149  itkConceptMacro( OutputIncrementDecrementOperatorsCheck,
151  // End concept checking
152 #endif
153 
154 protected:
156  ~ConnectedComponentFunctorImageFilter() override = default;
158 
160 
164  void GenerateData() override;
165 };
166 } // end namespace itk
167 
168 #ifndef ITK_MANUAL_INSTANTIATION
169 #include "itkConnectedComponentFunctorImageFilter.hxx"
170 #endif
171 
172 #endif
typename TOutputImage::PixelType OutputPixelType
A generic connected components filter that labels the objects in an artibitrary image.
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Base class for all process objects that output image data.
typename TInputImage::InternalPixelType InputInternalPixelType
typename InputImageType::Pointer InputImagePointer
typename TOutputImage::InternalPixelType OutputInternalPixelType
typename MaskImageType::Pointer MaskImagePointer
TOutputImage OutputImageType
Base class for filters that take an image as input and produce an image as output.
typename TInputImage::SizeType SizeType
#define itkConceptMacro(name, concept)
typename TInputImage::PixelType InputPixelType
typename TInputImage::IndexType IndexType
Label the objects in a binary image.