ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkLabelImageToShapeLabelMapFilter.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 itkLabelImageToShapeLabelMapFilter_h
19 #define itkLabelImageToShapeLabelMapFilter_h
20 
21 #include "itkShapeLabelObject.h"
23 #include "itkShapeLabelMapFilter.h"
24 
25 namespace itk
26 {
47 template< typename TInputImage, typename TOutputImage =
48  LabelMap< ShapeLabelObject< typename TInputImage::PixelType,
49  TInputImage::ImageDimension > > >
50 class ITK_TEMPLATE_EXPORT LabelImageToShapeLabelMapFilter:
51  public ImageToImageFilter< TInputImage, TOutputImage >
52 {
53 public:
54  ITK_DISALLOW_COPY_AND_ASSIGN(LabelImageToShapeLabelMapFilter);
55 
61 
63  using InputImageType = TInputImage;
64  using InputImagePointer = typename InputImageType::Pointer;
65  using InputImageConstPointer = typename InputImageType::ConstPointer;
67  using InputImagePixelType = typename InputImageType::PixelType;
68 
69  using OutputImageType = TOutputImage;
70  using OutputImagePointer = typename OutputImageType::Pointer;
71  using OutputImageConstPointer = typename OutputImageType::ConstPointer;
73  using OutputImagePixelType = typename OutputImageType::PixelType;
74  using LabelObjectType = typename OutputImageType::LabelObjectType;
75 
77  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
78  static constexpr unsigned int OutputImageDimension = TInputImage::ImageDimension;
79  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
80 
81  using LabelizerType =
87 
89  itkNewMacro(Self);
90 
93 
94 #ifdef ITK_USE_CONCEPT_CHECKING
95  // Begin concept checking
96  itkConceptMacro( InputEqualityComparableCheck,
98  itkConceptMacro( IntConvertibleToInputCheck,
100  itkConceptMacro( InputOStreamWritableCheck,
102  // End concept checking
103 #endif
104 
109  itkSetMacro(BackgroundValue, OutputImagePixelType);
110  itkGetConstMacro(BackgroundValue, OutputImagePixelType);
112 
117  itkSetMacro(ComputeFeretDiameter, bool);
118  itkGetConstReferenceMacro(ComputeFeretDiameter, bool);
119  itkBooleanMacro(ComputeFeretDiameter);
121 
126  itkSetMacro(ComputePerimeter, bool);
127  itkGetConstReferenceMacro(ComputePerimeter, bool);
128  itkBooleanMacro(ComputePerimeter);
130 
136  itkSetMacro(ComputeOrientedBoundingBox, bool);
137  itkGetConstReferenceMacro(ComputeOrientedBoundingBox, bool);
138  itkBooleanMacro(ComputeOrientedBoundingBox);
140 
141 
142 protected:
144  ~LabelImageToShapeLabelMapFilter() override = default;
145  void PrintSelf(std::ostream & os, Indent indent) const override;
146 
149  void GenerateInputRequestedRegion() override;
150 
152  void EnlargeOutputRequestedRegion( DataObject *itkNotUsed(output) ) override;
153 
156  void GenerateData() override;
157 
158 private:
163 }; // end of class
164 } // end namespace itk
165 
166 #ifndef ITK_MANUAL_INSTANTIATION
167 #include "itkLabelImageToShapeLabelMapFilter.hxx"
168 #endif
169 
170 #endif
convert a labeled image to a label collection image
typename OutputImageType::Pointer OutputImagePointer
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Converts a label image to a label map and valuates the shape attributes.
Base class for all process objects that output image data.
typename OutputImageType::ConstPointer OutputImageConstPointer
typename OutputImageType::PixelType OutputImagePixelType
typename InputImageType::PixelType InputImagePixelType
typename OutputImageType::LabelObjectType LabelObjectType
typename InputImageType::Pointer InputImagePointer
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
typename InputImageType::RegionType InputImageRegionType
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
#define itkConceptMacro(name, concept)
typename InputImageType::ConstPointer InputImageConstPointer
The valuator class for the ShapeLabelObject.
Base class for all data objects in ITK.
Templated n-dimensional image class.
Definition: itkImage.h:75