ITK  5.1.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 {
61 template <typename TInputImage,
62  typename TOutputImage = LabelMap<ShapeLabelObject<SizeValueType, TInputImage::ImageDimension>>>
63 class ITK_TEMPLATE_EXPORT BinaryImageToShapeLabelMapFilter : public ImageToImageFilter<TInputImage, TOutputImage>
64 {
65 public:
66  ITK_DISALLOW_COPY_AND_ASSIGN(BinaryImageToShapeLabelMapFilter);
68 
74 
76  using InputImageType = TInputImage;
77  using InputImagePointer = typename InputImageType::Pointer;
78  using InputImageConstPointer = typename InputImageType::ConstPointer;
80  using InputImagePixelType = typename InputImageType::PixelType;
81 
82  using OutputImageType = TOutputImage;
83  using OutputImagePointer = typename OutputImageType::Pointer;
84  using OutputImageConstPointer = typename OutputImageType::ConstPointer;
86  using OutputImagePixelType = typename OutputImageType::PixelType;
87  using LabelObjectType = typename OutputImageType::LabelObjectType;
88 
90  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
91  static constexpr unsigned int OutputImageDimension = TInputImage::ImageDimension;
92  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
93 
97 
99  itkNewMacro(Self);
100 
103 
109  itkSetMacro(FullyConnected, bool);
110  itkGetConstReferenceMacro(FullyConnected, bool);
111  itkBooleanMacro(FullyConnected);
113 
114 #ifdef ITK_USE_CONCEPT_CHECKING
115  // Begin concept checking
116  itkConceptMacro(InputEqualityComparableCheck, (Concept::EqualityComparable<InputImagePixelType>));
119  // End concept checking
120 #endif
121 
126  itkSetMacro(OutputBackgroundValue, OutputImagePixelType);
127  itkGetConstMacro(OutputBackgroundValue, OutputImagePixelType);
129 
134  itkSetMacro(InputForegroundValue, InputImagePixelType);
135  itkGetConstMacro(InputForegroundValue, InputImagePixelType);
137 
142  itkSetMacro(ComputeFeretDiameter, bool);
143  itkGetConstReferenceMacro(ComputeFeretDiameter, bool);
144  itkBooleanMacro(ComputeFeretDiameter);
146 
151  itkSetMacro(ComputePerimeter, bool);
152  itkGetConstReferenceMacro(ComputePerimeter, bool);
153  itkBooleanMacro(ComputePerimeter);
155 
161  itkSetMacro(ComputeOrientedBoundingBox, bool);
162  itkGetConstReferenceMacro(ComputeOrientedBoundingBox, bool);
163  itkBooleanMacro(ComputeOrientedBoundingBox);
165 
166 protected:
168  ~BinaryImageToShapeLabelMapFilter() override = default;
169  void
170  PrintSelf(std::ostream & os, Indent indent) const override;
171 
174  void
175  GenerateInputRequestedRegion() override;
176 
178  void
179  EnlargeOutputRequestedRegion(DataObject * itkNotUsed(output)) override;
180 
183  void
184  GenerateData() override;
185 
186 private:
193 }; // end of class
194 } // end namespace itk
195 
196 #ifndef ITK_MANUAL_INSTANTIATION
197 # include "itkBinaryImageToShapeLabelMapFilter.hxx"
198 #endif
199 
200 #endif
itk::Concept::OStreamWritable
Definition: itkConceptChecking.h:634
itk::BinaryImageToShapeLabelMapFilter::m_FullyConnected
bool m_FullyConnected
Definition: itkBinaryImageToShapeLabelMapFilter.h:187
itk::ImageSource::OutputImagePointer
typename OutputImageType::Pointer OutputImagePointer
Definition: itkImageSource.h:91
itk::BinaryImageToShapeLabelMapFilter::OutputImageConstPointer
typename OutputImageType::ConstPointer OutputImageConstPointer
Definition: itkBinaryImageToShapeLabelMapFilter.h:84
itk::BinaryImageToShapeLabelMapFilter::m_InputForegroundValue
InputImagePixelType m_InputForegroundValue
Definition: itkBinaryImageToShapeLabelMapFilter.h:189
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:54
itk::BinaryImageToLabelMapFilter
Label the connected components in a binary image and produce a collection of label objects.
Definition: itkBinaryImageToLabelMapFilter.h:56
itkShapeLabelMapFilter.h
itk::BinaryImageToShapeLabelMapFilter::m_ComputeFeretDiameter
bool m_ComputeFeretDiameter
Definition: itkBinaryImageToShapeLabelMapFilter.h:190
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:63
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:191
itk::BinaryImageToShapeLabelMapFilter::m_ComputeOrientedBoundingBox
bool m_ComputeOrientedBoundingBox
Definition: itkBinaryImageToShapeLabelMapFilter.h:192
itk::ImageSource::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition: itkImageSource.h:92
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:64
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkArray.h:26
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:214
itk::BinaryImageToShapeLabelMapFilter::m_OutputBackgroundValue
OutputImagePixelType m_OutputBackgroundValue
Definition: itkBinaryImageToShapeLabelMapFilter.h:188
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:86
itk::BinaryImageToShapeLabelMapFilter::LabelObjectType
typename OutputImageType::LabelObjectType LabelObjectType
Definition: itkBinaryImageToShapeLabelMapFilter.h:87
itk::ImageToImageFilter::InputImageRegionType
typename InputImageType::RegionType InputImageRegionType
Definition: itkImageToImageFilter.h:132
itk::Concept::EqualityComparable
Definition: itkConceptChecking.h:304
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