ITK  5.1.0
Insight Segmentation and Registration Toolkit
itkBinaryImageToShapeLabelMapFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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_ASSIGN(BinaryImageToShapeLabelMapFilter);
66 
72 
74  using InputImageType = TInputImage;
75  using InputImagePointer = typename InputImageType::Pointer;
76  using InputImageConstPointer = typename InputImageType::ConstPointer;
78  using InputImagePixelType = typename InputImageType::PixelType;
79 
80  using OutputImageType = TOutputImage;
81  using OutputImagePointer = typename OutputImageType::Pointer;
82  using OutputImageConstPointer = typename OutputImageType::ConstPointer;
84  using OutputImagePixelType = typename OutputImageType::PixelType;
85  using LabelObjectType = typename OutputImageType::LabelObjectType;
86 
88  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
89  static constexpr unsigned int OutputImageDimension = TInputImage::ImageDimension;
90  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
91 
95 
97  itkNewMacro(Self);
98 
101 
107  itkSetMacro(FullyConnected, bool);
108  itkGetConstReferenceMacro(FullyConnected, bool);
109  itkBooleanMacro(FullyConnected);
111 
112 #ifdef ITK_USE_CONCEPT_CHECKING
113  // Begin concept checking
114  itkConceptMacro(InputEqualityComparableCheck, (Concept::EqualityComparable<InputImagePixelType>));
117  // End concept checking
118 #endif
119 
124  itkSetMacro(OutputBackgroundValue, OutputImagePixelType);
125  itkGetConstMacro(OutputBackgroundValue, OutputImagePixelType);
127 
132  itkSetMacro(InputForegroundValue, InputImagePixelType);
133  itkGetConstMacro(InputForegroundValue, InputImagePixelType);
135 
140  itkSetMacro(ComputeFeretDiameter, bool);
141  itkGetConstReferenceMacro(ComputeFeretDiameter, bool);
142  itkBooleanMacro(ComputeFeretDiameter);
144 
149  itkSetMacro(ComputePerimeter, bool);
150  itkGetConstReferenceMacro(ComputePerimeter, bool);
151  itkBooleanMacro(ComputePerimeter);
153 
159  itkSetMacro(ComputeOrientedBoundingBox, bool);
160  itkGetConstReferenceMacro(ComputeOrientedBoundingBox, bool);
161  itkBooleanMacro(ComputeOrientedBoundingBox);
163 
164 protected:
166  ~BinaryImageToShapeLabelMapFilter() override = default;
167  void
168  PrintSelf(std::ostream & os, Indent indent) const override;
169 
172  void
173  GenerateInputRequestedRegion() override;
174 
176  void
177  EnlargeOutputRequestedRegion(DataObject * itkNotUsed(output)) override;
178 
181  void
182  GenerateData() override;
183 
184 private:
191 }; // end of class
192 } // end namespace itk
193 
194 #ifndef ITK_MANUAL_INSTANTIATION
195 # include "itkBinaryImageToShapeLabelMapFilter.hxx"
196 #endif
197 
198 #endif
itk::Concept::OStreamWritable
Definition: itkConceptChecking.h:634
itk::BinaryImageToShapeLabelMapFilter::m_FullyConnected
bool m_FullyConnected
Definition: itkBinaryImageToShapeLabelMapFilter.h:185
itk::ImageSource::OutputImagePointer
typename OutputImageType::Pointer OutputImagePointer
Definition: itkImageSource.h:91
itk::BinaryImageToShapeLabelMapFilter::OutputImageConstPointer
typename OutputImageType::ConstPointer OutputImageConstPointer
Definition: itkBinaryImageToShapeLabelMapFilter.h:82
itk::BinaryImageToShapeLabelMapFilter::m_InputForegroundValue
InputImagePixelType m_InputForegroundValue
Definition: itkBinaryImageToShapeLabelMapFilter.h:187
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:56
itkShapeLabelMapFilter.h
itk::BinaryImageToShapeLabelMapFilter::m_ComputeFeretDiameter
bool m_ComputeFeretDiameter
Definition: itkBinaryImageToShapeLabelMapFilter.h:188
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:189
itk::BinaryImageToShapeLabelMapFilter::m_ComputeOrientedBoundingBox
bool m_ComputeOrientedBoundingBox
Definition: itkBinaryImageToShapeLabelMapFilter.h:190
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:135
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:186
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:86
itk::BinaryImageToShapeLabelMapFilter::LabelObjectType
typename OutputImageType::LabelObjectType LabelObjectType
Definition: itkBinaryImageToShapeLabelMapFilter.h:85
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:282