ITK  6.0.0
Insight Toolkit
itkLabelImageToShapeLabelMapFilter.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 itkLabelImageToShapeLabelMapFilter_h
19 #define itkLabelImageToShapeLabelMapFilter_h
20 
21 #include "itkShapeLabelObject.h"
23 #include "itkShapeLabelMapFilter.h"
24 
25 namespace itk
26 {
47 template <typename TInputImage,
48  typename TOutputImage =
49  LabelMap<ShapeLabelObject<typename TInputImage::PixelType, TInputImage::ImageDimension>>>
50 class ITK_TEMPLATE_EXPORT LabelImageToShapeLabelMapFilter : public ImageToImageFilter<TInputImage, TOutputImage>
51 {
52 public:
53  ITK_DISALLOW_COPY_AND_MOVE(LabelImageToShapeLabelMapFilter);
54 
60 
62  using InputImageType = TInputImage;
66  using InputImagePixelType = typename InputImageType::PixelType;
67 
68  using OutputImageType = TOutputImage;
72  using OutputImagePixelType = typename OutputImageType::PixelType;
73  using LabelObjectType = typename OutputImageType::LabelObjectType;
74 
76  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
77  static constexpr unsigned int OutputImageDimension = TInputImage::ImageDimension;
78  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
79 
83 
85  itkNewMacro(Self);
86 
88  itkOverrideGetNameOfClassMacro(LabelImageToShapeLabelMapFilter);
89 
90 #ifdef ITK_USE_CONCEPT_CHECKING
91  // Begin concept checking
95  // End concept checking
96 #endif
97 
102  itkSetMacro(BackgroundValue, OutputImagePixelType);
103  itkGetConstMacro(BackgroundValue, OutputImagePixelType);
110  itkSetMacro(ComputeFeretDiameter, bool);
111  itkGetConstReferenceMacro(ComputeFeretDiameter, bool);
112  itkBooleanMacro(ComputeFeretDiameter);
119  itkSetMacro(ComputePerimeter, bool);
120  itkGetConstReferenceMacro(ComputePerimeter, bool);
121  itkBooleanMacro(ComputePerimeter);
129  itkSetMacro(ComputeOrientedBoundingBox, bool);
130  itkGetConstReferenceMacro(ComputeOrientedBoundingBox, bool);
131  itkBooleanMacro(ComputeOrientedBoundingBox);
135 protected:
137  ~LabelImageToShapeLabelMapFilter() override = default;
138  void
139  PrintSelf(std::ostream & os, Indent indent) const override;
140 
143  void
144  GenerateInputRequestedRegion() override;
145 
147  void
148  EnlargeOutputRequestedRegion(DataObject * itkNotUsed(output)) override;
149 
152  void
153  GenerateData() override;
154 
155 private:
156  OutputImagePixelType m_BackgroundValue{};
157  bool m_ComputeFeretDiameter{};
158  bool m_ComputePerimeter{};
159  bool m_ComputeOrientedBoundingBox{};
160 }; // end of class
161 } // end namespace itk
162 
163 #ifndef ITK_MANUAL_INSTANTIATION
164 # include "itkLabelImageToShapeLabelMapFilter.hxx"
165 #endif
166 
167 #endif
itkLabelImageToLabelMapFilter.h
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itk::Concept::OStreamWritable
Definition: itkConceptChecking.h:639
itk::ImageSource::OutputImagePointer
typename OutputImageType::Pointer OutputImagePointer
Definition: itkImageSource.h:91
itk::LabelImageToLabelMapFilter
convert a labeled image to a label collection image
Definition: itkLabelImageToLabelMapFilter.h:49
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ShapeLabelMapFilter
The valuator class for the ShapeLabelObject.
Definition: itkShapeLabelMapFilter.h:53
itk::LabelImageToShapeLabelMapFilter::OutputImageConstPointer
typename OutputImageType::ConstPointer OutputImageConstPointer
Definition: itkLabelImageToShapeLabelMapFilter.h:70
itkShapeLabelMapFilter.h
itk::ImageToImageFilter::InputImagePixelType
typename InputImageType::PixelType InputImagePixelType
Definition: itkImageToImageFilter.h:133
itkShapeLabelObject.h
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::ImageToImageFilter::InputImagePointer
typename InputImageType::Pointer InputImagePointer
Definition: itkImageToImageFilter.h:130
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::LabelImageToShapeLabelMapFilter::LabelObjectType
typename OutputImageType::LabelObjectType LabelObjectType
Definition: itkLabelImageToShapeLabelMapFilter.h:73
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itk::ImageSource::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition: itkImageSource.h:92
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::LabelImageToShapeLabelMapFilter
Converts a label image to a label map and valuates the shape attributes.
Definition: itkLabelImageToShapeLabelMapFilter.h:50
itk::ImageSource::OutputImagePixelType
typename OutputImageType::PixelType OutputImagePixelType
Definition: itkImageSource.h:93
itk::Concept::Convertible
Definition: itkConceptChecking.h:217
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:88
itk::ImageToImageFilter::InputImageRegionType
typename InputImageType::RegionType InputImageRegionType
Definition: itkImageToImageFilter.h:132
itk::Concept::EqualityComparable
Definition: itkConceptChecking.h:307
itk::ImageToImageFilter::InputImageConstPointer
typename InputImageType::ConstPointer InputImageConstPointer
Definition: itkImageToImageFilter.h:131
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293