ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkConnectedComponentImageFilter.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 itkConnectedComponentImageFilter_h
19#define itkConnectedComponentImageFilter_h
20
22
23namespace itk
24{
57
58template <typename TInputImage, typename TOutputImage, typename TMaskImage = TInputImage>
59class ITK_TEMPLATE_EXPORT ConnectedComponentImageFilter
60 : public ImageToImageFilter<TInputImage, TOutputImage>
61 , protected ScanlineFilterCommon<TInputImage, TOutputImage>
62{
63public:
64 ITK_DISALLOW_COPY_AND_MOVE(ConnectedComponentImageFilter);
65
73
77 using typename Superclass::InputImagePointer;
78
83 using OutputPixelType = typename TOutputImage::PixelType;
84 using OutputInternalPixelType = typename TOutputImage::InternalPixelType;
85 using InputPixelType = typename TInputImage::PixelType;
86 using InputInternalPixelType = typename TInputImage::InternalPixelType;
87 using MaskPixelType = typename TMaskImage::PixelType;
88 static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension;
89 static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
90 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
91
95 using InputImageType = TInputImage;
96 using MaskImageType = TMaskImage;
97 using IndexType = typename TInputImage::IndexType;
98 using SizeType = typename TInputImage::SizeType;
99 using OffsetType = typename TInputImage::OffsetType;
100
101 using OutputImageType = TOutputImage;
102 using RegionType = typename TOutputImage::RegionType;
103 using OutputIndexType = typename TOutputImage::IndexType;
104 using OutputSizeType = typename TOutputImage::SizeType;
105 using OutputOffsetType = typename TOutputImage::OffsetType;
106 using OutputImagePixelType = typename TOutputImage::PixelType;
107
108 using ListType = std::list<IndexType>;
109 using MaskImagePointer = typename MaskImageType::Pointer;
110
116
120 itkOverrideGetNameOfClassMacro(ConnectedComponentImageFilter);
121
125 itkNewMacro(Self);
126
133 itkSetMacro(FullyConnected, bool);
134 itkGetConstReferenceMacro(FullyConnected, bool);
135 itkBooleanMacro(FullyConnected);
137
140
141 // only set after completion
142 itkGetConstReferenceMacro(ObjectCount, LabelType);
143
144 itkConceptMacro(OutputImagePixelTypeIsInteger, (Concept::IsInteger<OutputImagePixelType>));
145
148
154 itkSetMacro(BackgroundValue, OutputImagePixelType);
155 itkGetConstMacro(BackgroundValue, OutputImagePixelType);
157
158protected:
160
161 ~ConnectedComponentImageFilter() override = default;
162 void
163 PrintSelf(std::ostream & os, Indent indent) const override;
164
165 void
166 GenerateData() override;
167
168 void
170
171 void
173
177 void
179
184 void
185 EnlargeOutputRequestedRegion(DataObject * itkNotUsed(output)) override;
186
188
201
202private:
205
206 typename TInputImage::ConstPointer m_Input{};
207};
208} // end namespace itk
209
210#ifndef ITK_MANUAL_INSTANTIATION
211# if !defined(ITK_WRAPPING_PARSER)
212# include "itkConnectedComponentImageFilter.hxx"
213# endif
214#endif
215
216#endif
void GenerateInputRequestedRegion() override
void PrintSelf(std::ostream &os, Indent indent) const override
void EnlargeOutputRequestedRegion(DataObject *output) override
void DynamicThreadedGenerateData(const RegionType &) override
~ConnectedComponentImageFilter() override=default
itkGetInputMacro(MaskImage, MaskImageType)
void ThreadedWriteOutput(const RegionType &)
itkSetInputMacro(MaskImage, MaskImageType)
Base class for all data objects in ITK.
typename InputImageType::Pointer InputImagePointer
Control indentation during Print() invocation.
Definition itkIndent.h:50
virtual void UnRegister() const noexcept
virtual void Register() const
typename OffsetVectorType::const_iterator OffsetVectorConstIterator
typename TOutputImage::RegionType::SizeType OutSizeType
typename LineEncodingType::const_iterator LineEncodingConstIterator
typename LineEncodingType::iterator LineEncodingIterator
std::vector< LineEncodingType > LineMapType
std::vector< RunLength > LineEncodingType
std::vector< OffsetValueType > OffsetVectorType
std::vector< InternalLabelType > UnionFindType
std::vector< OutputPixelType > ConsecutiveVectorType
ScanlineFilterCommon(EnclosingFilter *enclosingFilter)
Implements transparent reference counting.
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
SizeValueType IdentifierType
Definition itkIntTypes.h:90