ITK  6.0.0
Insight Toolkit
itkBinaryImageToShapeLabelMapFilter.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 itkBinaryImageToShapeLabelMapFilter_h
19#define itkBinaryImageToShapeLabelMapFilter_h
20
21#include "itkShapeLabelObject.h"
24
25namespace itk
26{
60template <typename TInputImage,
61 typename TOutputImage = LabelMap<ShapeLabelObject<SizeValueType, TInputImage::ImageDimension>>>
62class ITK_TEMPLATE_EXPORT BinaryImageToShapeLabelMapFilter : public ImageToImageFilter<TInputImage, TOutputImage>
63{
64public:
65 ITK_DISALLOW_COPY_AND_MOVE(BinaryImageToShapeLabelMapFilter);
73
75 using InputImageType = TInputImage;
79 using InputImagePixelType = typename InputImageType::PixelType;
80
81 using OutputImageType = TOutputImage;
85 using OutputImagePixelType = typename OutputImageType::PixelType;
86 using LabelObjectType = typename OutputImageType::LabelObjectType;
87
89 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
90 static constexpr unsigned int OutputImageDimension = TInputImage::ImageDimension;
91 static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
92
96
98 itkNewMacro(Self);
99
101 itkOverrideGetNameOfClassMacro(BinaryImageToShapeLabelMapFilter);
102
108 itkSetMacro(FullyConnected, bool);
109 itkGetConstReferenceMacro(FullyConnected, bool);
110 itkBooleanMacro(FullyConnected);
113#ifdef ITK_USE_CONCEPT_CHECKING
114 // Begin concept checking
118 // End concept checking
119#endif
120
125 itkSetMacro(OutputBackgroundValue, OutputImagePixelType);
126 itkGetConstMacro(OutputBackgroundValue, OutputImagePixelType);
133 itkSetMacro(InputForegroundValue, InputImagePixelType);
134 itkGetConstMacro(InputForegroundValue, InputImagePixelType);
141 itkSetMacro(ComputeFeretDiameter, bool);
142 itkGetConstReferenceMacro(ComputeFeretDiameter, bool);
143 itkBooleanMacro(ComputeFeretDiameter);
150 itkSetMacro(ComputePerimeter, bool);
151 itkGetConstReferenceMacro(ComputePerimeter, bool);
152 itkBooleanMacro(ComputePerimeter);
160 itkSetMacro(ComputeOrientedBoundingBox, bool);
161 itkGetConstReferenceMacro(ComputeOrientedBoundingBox, bool);
162 itkBooleanMacro(ComputeOrientedBoundingBox);
165protected:
168 void
169 PrintSelf(std::ostream & os, Indent indent) const override;
170
173 void
175
177 void
178 EnlargeOutputRequestedRegion(DataObject * itkNotUsed(output)) override;
179
182 void
183 GenerateData() override;
184
185private:
186 bool m_FullyConnected{};
187 OutputImagePixelType m_OutputBackgroundValue{};
188 InputImagePixelType m_InputForegroundValue{};
189 bool m_ComputeFeretDiameter{};
190 bool m_ComputePerimeter{};
191 bool m_ComputeOrientedBoundingBox{};
192}; // end of class
193} // end namespace itk
194
195#ifndef ITK_MANUAL_INSTANTIATION
196# include "itkBinaryImageToShapeLabelMapFilter.hxx"
197#endif
198
199#endif
Label the connected components in a binary image and produce a collection of label objects.
Converts a binary image to a label map and valuate the shape attributes.
typename InputImageType::RegionType InputImageRegionType
void PrintSelf(std::ostream &os, Indent indent) const override
typename OutputImageType::PixelType OutputImagePixelType
typename OutputImageType::LabelObjectType LabelObjectType
typename InputImageType::PixelType InputImagePixelType
typename OutputImageType::RegionType OutputImageRegionType
typename OutputImageType::ConstPointer OutputImageConstPointer
typename InputImageType::ConstPointer InputImageConstPointer
~BinaryImageToShapeLabelMapFilter() override=default
void EnlargeOutputRequestedRegion(DataObject *) override
Base class for all data objects in ITK.
Base class for filters that take an image as input and produce an image as output.
Templated n-dimensional image class.
Definition: itkImage.h:89
Control indentation during Print() invocation.
Definition: itkIndent.h:50
The valuator class for the ShapeLabelObject.
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....