ITK  5.3.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  * 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 itkBinaryImageToShapeLabelMapFilter_h
19 #define itkBinaryImageToShapeLabelMapFilter_h
20 
21 #include "itkShapeLabelObject.h"
23 #include "itkShapeLabelMapFilter.h"
24 
25 namespace itk
26 {
60 template <typename TInputImage,
61  typename TOutputImage = LabelMap<ShapeLabelObject<SizeValueType, TInputImage::ImageDimension>>>
62 class ITK_TEMPLATE_EXPORT BinaryImageToShapeLabelMapFilter : public ImageToImageFilter<TInputImage, TOutputImage>
63 {
64 public:
65  ITK_DISALLOW_COPY_AND_MOVE(BinaryImageToShapeLabelMapFilter);
67 
73 
75  using InputImageType = TInputImage;
76  using InputImagePointer = typename InputImageType::Pointer;
77  using InputImageConstPointer = typename InputImageType::ConstPointer;
79  using InputImagePixelType = typename InputImageType::PixelType;
80 
81  using OutputImageType = TOutputImage;
82  using OutputImagePointer = typename OutputImageType::Pointer;
83  using OutputImageConstPointer = typename OutputImageType::ConstPointer;
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 
102 
108  itkSetMacro(FullyConnected, bool);
109  itkGetConstReferenceMacro(FullyConnected, bool);
110  itkBooleanMacro(FullyConnected);
112 
113 #ifdef ITK_USE_CONCEPT_CHECKING
114  // Begin concept checking
115  itkConceptMacro(InputEqualityComparableCheck, (Concept::EqualityComparable<InputImagePixelType>));
118  // End concept checking
119 #endif
120 
125  itkSetMacro(OutputBackgroundValue, OutputImagePixelType);
126  itkGetConstMacro(OutputBackgroundValue, OutputImagePixelType);
128 
133  itkSetMacro(InputForegroundValue, InputImagePixelType);
134  itkGetConstMacro(InputForegroundValue, InputImagePixelType);
136 
141  itkSetMacro(ComputeFeretDiameter, bool);
142  itkGetConstReferenceMacro(ComputeFeretDiameter, bool);
143  itkBooleanMacro(ComputeFeretDiameter);
145 
150  itkSetMacro(ComputePerimeter, bool);
151  itkGetConstReferenceMacro(ComputePerimeter, bool);
152  itkBooleanMacro(ComputePerimeter);
154 
160  itkSetMacro(ComputeOrientedBoundingBox, bool);
161  itkGetConstReferenceMacro(ComputeOrientedBoundingBox, bool);
162  itkBooleanMacro(ComputeOrientedBoundingBox);
164 
165 protected:
167  ~BinaryImageToShapeLabelMapFilter() override = default;
168  void
169  PrintSelf(std::ostream & os, Indent indent) const override;
170 
173  void
174  GenerateInputRequestedRegion() override;
175 
177  void
178  EnlargeOutputRequestedRegion(DataObject * itkNotUsed(output)) override;
179 
182  void
183  GenerateData() override;
184 
185 private:
192 }; // end of class
193 } // end namespace itk
194 
195 #ifndef ITK_MANUAL_INSTANTIATION
196 # include "itkBinaryImageToShapeLabelMapFilter.hxx"
197 #endif
198 
199 #endif
itk::Concept::OStreamWritable
Definition: itkConceptChecking.h:636
itk::BinaryImageToShapeLabelMapFilter::m_FullyConnected
bool m_FullyConnected
Definition: itkBinaryImageToShapeLabelMapFilter.h:186
itk::ImageSource::OutputImagePointer
typename OutputImageType::Pointer OutputImagePointer
Definition: itkImageSource.h:91
itk::BinaryImageToShapeLabelMapFilter::OutputImageConstPointer
typename OutputImageType::ConstPointer OutputImageConstPointer
Definition: itkBinaryImageToShapeLabelMapFilter.h:83
itk::BinaryImageToShapeLabelMapFilter::m_InputForegroundValue
InputImagePixelType m_InputForegroundValue
Definition: itkBinaryImageToShapeLabelMapFilter.h:188
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::BinaryImageToLabelMapFilter
Label the connected components in a binary image and produce a collection of label objects.
Definition: itkBinaryImageToLabelMapFilter.h:55
itkShapeLabelMapFilter.h
itk::BinaryImageToShapeLabelMapFilter::m_ComputeFeretDiameter
bool m_ComputeFeretDiameter
Definition: itkBinaryImageToShapeLabelMapFilter.h:189
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::BinaryImageToShapeLabelMapFilter
Converts a binary image to a label map and valuate the shape attributes.
Definition: itkBinaryImageToShapeLabelMapFilter.h:62
itk::ImageToImageFilter::InputImagePointer
typename InputImageType::Pointer InputImagePointer
Definition: itkImageToImageFilter.h:130
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itkBinaryImageToLabelMapFilter.h
itk::BinaryImageToShapeLabelMapFilter::m_ComputePerimeter
bool m_ComputePerimeter
Definition: itkBinaryImageToShapeLabelMapFilter.h:190
itk::BinaryImageToShapeLabelMapFilter::m_ComputeOrientedBoundingBox
bool m_ComputeOrientedBoundingBox
Definition: itkBinaryImageToShapeLabelMapFilter.h:191
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: 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::ImageSource::OutputImagePixelType
typename OutputImageType::PixelType OutputImagePixelType
Definition: itkImageSource.h:93
itk::Concept::Convertible
Definition: itkConceptChecking.h:216
itk::BinaryImageToShapeLabelMapFilter::m_OutputBackgroundValue
OutputImagePixelType m_OutputBackgroundValue
Definition: itkBinaryImageToShapeLabelMapFilter.h:187
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:88
itk::BinaryImageToShapeLabelMapFilter::LabelObjectType
typename OutputImageType::LabelObjectType LabelObjectType
Definition: itkBinaryImageToShapeLabelMapFilter.h:86
itk::ImageToImageFilter::InputImageRegionType
typename InputImageType::RegionType InputImageRegionType
Definition: itkImageToImageFilter.h:132
itk::Concept::EqualityComparable
Definition: itkConceptChecking.h:306
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