ITK  5.2.0
Insight Toolkit
itkShapeRelabelImageFilter.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 itkShapeRelabelImageFilter_h
19 #define itkShapeRelabelImageFilter_h
20 
21 #include "itkShapeLabelObject.h"
23 #include "itkShapeLabelMapFilter.h"
26 
27 namespace itk
28 {
45 template <typename TInputImage>
46 class ITK_TEMPLATE_EXPORT ShapeRelabelImageFilter : public ImageToImageFilter<TInputImage, TInputImage>
47 {
48 public:
49  ITK_DISALLOW_COPY_AND_MOVE(ShapeRelabelImageFilter);
50 
56 
58  using InputImageType = TInputImage;
59  using OutputImageType = TInputImage;
60  using InputImagePointer = typename InputImageType::Pointer;
61  using InputImageConstPointer = typename InputImageType::ConstPointer;
63  using InputImagePixelType = typename InputImageType::PixelType;
64  using OutputImagePointer = typename OutputImageType::Pointer;
65  using OutputImageConstPointer = typename OutputImageType::ConstPointer;
67  using OutputImagePixelType = typename OutputImageType::PixelType;
68 
70  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
71  static constexpr unsigned int OutputImageDimension = TInputImage::ImageDimension;
72  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
73 
82 
84  itkNewMacro(Self);
85 
88 
89 #ifdef ITK_USE_CONCEPT_CHECKING
90  // Begin concept checking
94  // End concept checking
95 #endif
96 
101  itkSetMacro(BackgroundValue, OutputImagePixelType);
102  itkGetConstMacro(BackgroundValue, OutputImagePixelType);
104 
110  itkGetConstMacro(ReverseOrdering, bool);
111  itkSetMacro(ReverseOrdering, bool);
112  itkBooleanMacro(ReverseOrdering);
114 
118  itkGetConstMacro(Attribute, AttributeType);
119  itkSetMacro(Attribute, AttributeType);
120  void
121  SetAttribute(const std::string & s)
122  {
123  this->SetAttribute(LabelObjectType::GetAttributeFromName(s));
124  }
126 
127 protected:
129  ~ShapeRelabelImageFilter() override = default;
130  void
131  PrintSelf(std::ostream & os, Indent indent) const override;
132 
136  void
137  GenerateInputRequestedRegion() override;
138 
140  void
141  EnlargeOutputRequestedRegion(DataObject * itkNotUsed(output)) override;
142 
145  void
146  GenerateData() override;
147 
148 private:
152 }; // end of class
153 } // end namespace itk
154 
155 #ifndef ITK_MANUAL_INSTANTIATION
156 # include "itkShapeRelabelImageFilter.hxx"
157 #endif
158 
159 #endif
itkLabelImageToLabelMapFilter.h
itk::ShapeRelabelImageFilter::OutputImagePointer
typename OutputImageType::Pointer OutputImagePointer
Definition: itkShapeRelabelImageFilter.h:64
itk::Concept::OStreamWritable
Definition: itkConceptChecking.h:634
itk::ShapeRelabelImageFilter::InputImagePixelType
typename InputImageType::PixelType InputImagePixelType
Definition: itkShapeRelabelImageFilter.h:63
itk::ShapeRelabelImageFilter::InputImagePointer
typename InputImageType::Pointer InputImagePointer
Definition: itkShapeRelabelImageFilter.h:60
itk::LabelImageToLabelMapFilter
convert a labeled image to a label collection image
Definition: itkLabelImageToLabelMapFilter.h:49
itk::ShapeRelabelImageFilter::m_ReverseOrdering
bool m_ReverseOrdering
Definition: itkShapeRelabelImageFilter.h:150
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ShapeRelabelImageFilter::SetAttribute
void SetAttribute(const std::string &s)
Definition: itkShapeRelabelImageFilter.h:121
itk::ShapeLabelMapFilter
The valuator class for the ShapeLabelObject.
Definition: itkShapeLabelMapFilter.h:53
itk::ShapeRelabelImageFilter::OutputImageConstPointer
typename OutputImageType::ConstPointer OutputImageConstPointer
Definition: itkShapeRelabelImageFilter.h:65
itk::LabelMap
Templated n-dimensional image to store labeled objects.
Definition: itkLabelMap.h:70
itk::ShapeRelabelImageFilter::OutputImagePixelType
typename OutputImageType::PixelType OutputImagePixelType
Definition: itkShapeRelabelImageFilter.h:67
itkShapeLabelMapFilter.h
itk::ShapeRelabelImageFilter::m_BackgroundValue
OutputImagePixelType m_BackgroundValue
Definition: itkShapeRelabelImageFilter.h:149
itkShapeLabelObject.h
itk::ShapeRelabelImageFilter::InputImageType
TInputImage InputImageType
Definition: itkShapeRelabelImageFilter.h:58
itk::ImageToImageFilter
Base class for filters that take an image as input and produce an image as output.
Definition: itkImageToImageFilter.h:108
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::ShapeRelabelImageFilter::m_Attribute
AttributeType m_Attribute
Definition: itkShapeRelabelImageFilter.h:151
itk::ShapeRelabelImageFilter::AttributeType
typename LabelObjectType::AttributeType AttributeType
Definition: itkShapeRelabelImageFilter.h:79
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::ShapeRelabelLabelMapFilter
Relabels objects according to their shape attributes.
Definition: itkShapeRelabelLabelMapFilter.h:45
itkShapeRelabelLabelMapFilter.h
itk::ShapeRelabelImageFilter::InputImageConstPointer
typename InputImageType::ConstPointer InputImageConstPointer
Definition: itkShapeRelabelImageFilter.h:61
itk::ShapeRelabelImageFilter::OutputImageType
TInputImage OutputImageType
Definition: itkShapeRelabelImageFilter.h:59
itk::ShapeRelabelImageFilter::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition: itkShapeRelabelImageFilter.h:66
itk::ShapeRelabelImageFilter::InputImageRegionType
typename InputImageType::RegionType InputImageRegionType
Definition: itkShapeRelabelImageFilter.h:62
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:64
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ShapeLabelObject
A Label object to store the common attributes related to the shape of the object.
Definition: itkShapeLabelObject.h:43
itk::Concept::Convertible
Definition: itkConceptChecking.h:214
itk::LabelMapToLabelImageFilter
Converts a LabelMap to a labeled image.
Definition: itkLabelMapToLabelImageFilter.h:46
itk::ShapeRelabelImageFilter
relabel objects according to their shape attributes
Definition: itkShapeRelabelImageFilter.h:46
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:86
itk::ShapeLabelObject::AttributeType
typename Superclass::AttributeType AttributeType
Definition: itkShapeLabelObject.h:74
itkLabelMapToLabelImageFilter.h
itk::Concept::EqualityComparable
Definition: itkConceptChecking.h:304
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293