ITK  5.0.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, typename TOutputImage =
61  LabelMap< ShapeLabelObject< SizeValueType, TInputImage::ImageDimension > > >
62 class ITK_TEMPLATE_EXPORT BinaryImageToShapeLabelMapFilter:
63  public ImageToImageFilter< TInputImage, TOutputImage >
64 {
65 public:
66  ITK_DISALLOW_COPY_AND_ASSIGN(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 
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,
118  itkConceptMacro( IntConvertibleToInputCheck,
120  itkConceptMacro( InputOStreamWritableCheck,
122  // End concept checking
123 #endif
124 
129  itkSetMacro(OutputBackgroundValue, OutputImagePixelType);
130  itkGetConstMacro(OutputBackgroundValue, OutputImagePixelType);
132 
137  itkSetMacro(InputForegroundValue, InputImagePixelType);
138  itkGetConstMacro(InputForegroundValue, InputImagePixelType);
140 
145  itkSetMacro(ComputeFeretDiameter, bool);
146  itkGetConstReferenceMacro(ComputeFeretDiameter, bool);
147  itkBooleanMacro(ComputeFeretDiameter);
149 
154  itkSetMacro(ComputePerimeter, bool);
155  itkGetConstReferenceMacro(ComputePerimeter, bool);
156  itkBooleanMacro(ComputePerimeter);
158 
164  itkSetMacro(ComputeOrientedBoundingBox, bool);
165  itkGetConstReferenceMacro(ComputeOrientedBoundingBox, bool);
166  itkBooleanMacro(ComputeOrientedBoundingBox);
168 
169 protected:
171  ~BinaryImageToShapeLabelMapFilter() override = default;
172  void PrintSelf(std::ostream & os, Indent indent) const override;
173 
176  void GenerateInputRequestedRegion() override;
177 
179  void EnlargeOutputRequestedRegion( DataObject *itkNotUsed(output) ) override;
180 
183  void 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
typename OutputImageType::Pointer OutputImagePointer
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Base class for all process objects that output image data.
typename OutputImageType::PixelType OutputImagePixelType
typename InputImageType::PixelType InputImagePixelType
typename InputImageType::Pointer InputImagePointer
typename OutputImageType::LabelObjectType LabelObjectType
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
typename InputImageType::RegionType InputImageRegionType
Label the connected components in a binary image and produce a collection of label objects...
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Converts a binary image to a label map and valuate the shape attributes.
#define itkConceptMacro(name, concept)
typename InputImageType::ConstPointer InputImageConstPointer
The valuator class for the ShapeLabelObject.
Base class for all data objects in ITK.
typename OutputImageType::ConstPointer OutputImageConstPointer
Templated n-dimensional image class.
Definition: itkImage.h:75