ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkBinaryImageToLabelMapFilter.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 itkBinaryImageToLabelMapFilter_h
19#define itkBinaryImageToLabelMapFilter_h
20
22#include "itkLabelMap.h"
23#include "itkLabelObject.h"
24
25namespace itk
26{
52
53template <typename TInputImage,
55class ITK_TEMPLATE_EXPORT BinaryImageToLabelMapFilter
56 : public ImageToImageFilter<TInputImage, TOutputImage>
57 , protected ScanlineFilterCommon<TInputImage, TOutputImage>
58{
59public:
60 ITK_DISALLOW_COPY_AND_MOVE(BinaryImageToLabelMapFilter);
61
71
75 itkNewMacro(Self);
76
80 itkOverrideGetNameOfClassMacro(BinaryImageToLabelMapFilter);
81
85 using typename Superclass::InputImagePointer;
86
91 using OutputPixelType = typename TOutputImage::PixelType;
92 using InputPixelType = typename TInputImage::PixelType;
93 using SizeValueType = typename TInputImage::SizeValueType;
94 using OffsetValueType = typename TInputImage::OffsetValueType;
95 static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension;
96 static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
97 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
98
102 using InputImageType = TInputImage;
103 using IndexType = typename TInputImage::IndexType;
104 using SizeType = typename TInputImage::SizeType;
105 using OffsetType = typename TInputImage::OffsetType;
106
107 using OutputImageType = TOutputImage;
108 using RegionType = typename TOutputImage::RegionType;
109 using OutputIndexType = typename TOutputImage::IndexType;
110 using OutputSizeType = typename TOutputImage::SizeType;
111 using OutputOffsetType = typename TOutputImage::OffsetType;
112 using OutputImagePixelType = typename TOutputImage::PixelType;
113
120 itkSetMacro(FullyConnected, bool);
121 itkGetConstReferenceMacro(FullyConnected, bool);
122 itkBooleanMacro(FullyConnected);
124
125 // only set after completion
126 itkGetConstReferenceMacro(NumberOfObjects, SizeValueType);
127
132 itkSetMacro(OutputBackgroundValue, OutputPixelType);
133 itkGetConstMacro(OutputBackgroundValue, OutputPixelType);
135
140 itkSetMacro(InputForegroundValue, InputPixelType);
141 itkGetConstMacro(InputForegroundValue, InputPixelType);
143
144protected:
146 ~BinaryImageToLabelMapFilter() override = default;
147 void
148 PrintSelf(std::ostream & os, Indent indent) const override;
149
150 void
151 DynamicThreadedGenerateData(const RegionType & outputRegionForThread) override;
152
153 void
154 GenerateData() override;
155
159 void
161
166 void
167 EnlargeOutputRequestedRegion(DataObject * itkNotUsed(output)) override;
168
170
183
184private:
188};
189} // end namespace itk
190
191#ifndef ITK_MANUAL_INSTANTIATION
192# if !defined(ITK_WRAPPING_PARSER)
193# include "itkBinaryImageToLabelMapFilter.hxx"
194# endif
195#endif
196
197#endif
typename ScanlineFunctions::WorkUnitData WorkUnitData
void PrintSelf(std::ostream &os, Indent indent) const override
typename ScanlineFunctions::ConsecutiveVectorType ConsecutiveVectorType
typename TInputImage::PixelType InputPixelType
typename TOutputImage::PixelType OutputPixelType
ImageToImageFilter< TInputImage, TOutputImage > Superclass
typename TOutputImage::PixelType OutputImagePixelType
typename TOutputImage::IndexType OutputIndexType
ScanlineFilterCommon< TInputImage, TOutputImage > ScanlineFunctions
typename ScanlineFunctions::InternalLabelType InternalLabelType
typename ScanlineFunctions::UnionFindType UnionFindType
typename TInputImage::SizeValueType SizeValueType
typename TOutputImage::OffsetType OutputOffsetType
typename TInputImage::OffsetValueType OffsetValueType
typename TInputImage::OffsetType OffsetType
typename ScanlineFunctions::OffsetVectorConstIterator OffsetVectorConstIterator
typename ScanlineFunctions::LineEncodingType LineEncodingType
typename ScanlineFunctions::LineEncodingIterator LineEncodingIterator
typename TOutputImage::RegionType RegionType
~BinaryImageToLabelMapFilter() override=default
void DynamicThreadedGenerateData(const RegionType &outputRegionForThread) override
typename ScanlineFunctions::OutSizeType OutSizeType
typename ScanlineFunctions::RunLength RunLength
typename TOutputImage::SizeType OutputSizeType
void GenerateInputRequestedRegion() override
typename ScanlineFunctions::LineMapType LineMapType
void EnlargeOutputRequestedRegion(DataObject *output) override
typename ScanlineFunctions::LineEncodingConstIterator LineEncodingConstIterator
typename ScanlineFunctions::OffsetVectorType OffsetVectorType
Base class for all data objects in ITK.
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition itkIndent.h:50
Templated n-dimensional image to store labeled objects.
Definition itkLabelMap.h:71
virtual void UnRegister() const noexcept
virtual void Register() const
Helper class for a group of filters which operate on scan-lines.
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
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....