ITK  5.2.0
Insight Toolkit
itkHardConnectedComponentImageFilter.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  * 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 itkHardConnectedComponentImageFilter_h
19 #define itkHardConnectedComponentImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 #include "itkImage.h"
23 
24 namespace itk
25 {
48 template <typename TInputImage, typename TOutputImage>
49 class ITK_TEMPLATE_EXPORT HardConnectedComponentImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
50 {
51 public:
52  ITK_DISALLOW_COPY_AND_MOVE(HardConnectedComponentImageFilter);
53 
61 
66  using OutputPixelType = typename TOutputImage::PixelType;
67  using OutputInternalPixelType = typename TOutputImage::InternalPixelType;
68  using InputPixelType = typename TInputImage::PixelType;
69  using InputInternalPixelType = typename TInputImage::InternalPixelType;
70  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
71  static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension;
72 
76  using InputImageType = TInputImage;
77  using OutputImageType = TOutputImage;
79  using SizeType = typename TInputImage::SizeType;
81  using ListType = std::list<IndexType>;
82 
87 
91  itkNewMacro(Self);
92 
94  void
95  SetObjectSeed(const IndexType & seed)
96  {
97  m_Seeds.push_front(seed);
98  }
99 
100 #ifdef ITK_USE_CONCEPT_CHECKING
101  // Begin concept checking
103  itkConceptMacro(IntConvertibleToOutputCheck, (Concept::Convertible<int, OutputPixelType>));
104  itkConceptMacro(UnsignedShortConvertibleToOutputCheck, (Concept::Convertible<unsigned short, OutputPixelType>));
105  itkConceptMacro(OutputEqualityComparableCheck, (Concept::EqualityComparable<OutputPixelType>));
106  itkConceptMacro(UnsignedCharConvertibleToOutputCheck, (Concept::Convertible<unsigned char, OutputPixelType>));
107  itkConceptMacro(OutputIncrementDecrementOperatorsCheck, (Concept::IncrementDecrementOperators<OutputPixelType>));
108  // End concept checking
109 #endif
110 
111 protected:
113  ~HardConnectedComponentImageFilter() override = default;
114 
118  void
119  GenerateData() override;
120 
121  void
122  PrintSelf(std::ostream & os, Indent indent) const override
123  {
124  Superclass::PrintSelf(os, indent);
125  }
126 
127 private:
129 };
130 } // end namespace itk
131 
132 #ifndef ITK_MANUAL_INSTANTIATION
133 # include "itkHardConnectedComponentImageFilter.hxx"
134 #endif
135 
136 #endif
itk::HardConnectedComponentImageFilter
Definition: itkHardConnectedComponentImageFilter.h:49
itk::HardConnectedComponentImageFilter::SetObjectSeed
void SetObjectSeed(const IndexType &seed)
Definition: itkHardConnectedComponentImageFilter.h:95
itk::HardConnectedComponentImageFilter::InputInternalPixelType
typename TInputImage::InternalPixelType InputInternalPixelType
Definition: itkHardConnectedComponentImageFilter.h:69
itk::HardConnectedComponentImageFilter::OutputInternalPixelType
typename TOutputImage::InternalPixelType OutputInternalPixelType
Definition: itkHardConnectedComponentImageFilter.h:67
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itkImage.h
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::HardConnectedComponentImageFilter::SizeType
typename TInputImage::SizeType SizeType
Definition: itkHardConnectedComponentImageFilter.h:79
itk::Concept::SameDimension
Definition: itkConceptChecking.h:694
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::ImageToImageFilter
Base class for filters that take an image as input and produce an image as output.
Definition: itkImageToImageFilter.h:108
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::HardConnectedComponentImageFilter::ListType
std::list< IndexType > ListType
Definition: itkHardConnectedComponentImageFilter.h:81
itk::HardConnectedComponentImageFilter::RegionType
typename TOutputImage::RegionType RegionType
Definition: itkHardConnectedComponentImageFilter.h:80
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::HardConnectedComponentImageFilter::IndexType
typename TInputImage::IndexType IndexType
Definition: itkHardConnectedComponentImageFilter.h:78
itk::HardConnectedComponentImageFilter::m_Seeds
ListType m_Seeds
Definition: itkHardConnectedComponentImageFilter.h:128
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itkImageToImageFilter.h
itk::HardConnectedComponentImageFilter::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
Definition: itkHardConnectedComponentImageFilter.h:122
itk::HardConnectedComponentImageFilter::InputPixelType
typename TInputImage::PixelType InputPixelType
Definition: itkHardConnectedComponentImageFilter.h:68
itk::HardConnectedComponentImageFilter::OutputPixelType
typename TOutputImage::PixelType OutputPixelType
Definition: itkHardConnectedComponentImageFilter.h:66
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:138
itk::Concept::Convertible
Definition: itkConceptChecking.h:216
itk::Concept::IncrementDecrementOperators
Definition: itkConceptChecking.h:615
itk::Concept::EqualityComparable
Definition: itkConceptChecking.h:306
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90