ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkShapeRelabelImageFilter.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 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:
47  public ImageToImageFilter< TInputImage, TInputImage >
48 {
49 public:
55 
57  typedef TInputImage InputImageType;
58  typedef TInputImage OutputImageType;
59  typedef typename InputImageType::Pointer InputImagePointer;
60  typedef typename InputImageType::ConstPointer InputImageConstPointer;
61  typedef typename InputImageType::RegionType InputImageRegionType;
62  typedef typename InputImageType::PixelType InputImagePixelType;
63  typedef typename OutputImageType::Pointer OutputImagePointer;
64  typedef typename OutputImageType::ConstPointer OutputImageConstPointer;
65  typedef typename OutputImageType::RegionType OutputImageRegionType;
66  typedef typename OutputImageType::PixelType OutputImagePixelType;
67 
69  itkStaticConstMacro(InputImageDimension, unsigned int,
70  TInputImage::ImageDimension);
71  itkStaticConstMacro(OutputImageDimension, unsigned int,
72  TInputImage::ImageDimension);
73  itkStaticConstMacro(ImageDimension, unsigned int,
74  TInputImage::ImageDimension);
76 
86 
88  itkNewMacro(Self);
89 
91  itkTypeMacro(ShapeRelabelImageFilter,
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 
118  itkGetConstMacro(ReverseOrdering, bool);
119  itkSetMacro(ReverseOrdering, bool);
120  itkBooleanMacro(ReverseOrdering);
122 
126  itkGetConstMacro(Attribute, AttributeType);
127  itkSetMacro(Attribute, AttributeType);
128  void SetAttribute(const std::string & s)
129  {
130  this->SetAttribute( LabelObjectType::GetAttributeFromName(s) );
131  }
133 
134 protected:
136  ~ShapeRelabelImageFilter() ITK_OVERRIDE {}
137  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
138 
142  void GenerateInputRequestedRegion() ITK_OVERRIDE;
143 
145  void EnlargeOutputRequestedRegion( DataObject *itkNotUsed(output) ) ITK_OVERRIDE;
146 
149  void GenerateData() ITK_OVERRIDE;
150 
151 private:
152  ITK_DISALLOW_COPY_AND_ASSIGN(ShapeRelabelImageFilter);
153 
154  OutputImagePixelType m_BackgroundValue;
155  bool m_ReverseOrdering;
156  AttributeType m_Attribute;
157 }; // end of class
158 } // end namespace itk
159 
160 #ifndef ITK_MANUAL_INSTANTIATION
161 #include "itkShapeRelabelImageFilter.hxx"
162 #endif
163 
164 #endif
InputImageType::RegionType InputImageRegionType
convert a labeled image to a label collection image
Relabels objects according to their shape attributes.
OutputImageType::PixelType OutputImagePixelType
Light weight base class for most itk classes.
ShapeLabelObject< InputImagePixelType, itkGetStaticConstMacro(ImageDimension) > LabelObjectType
void SetAttribute(const std::string &s)
OutputImageType::Pointer OutputImagePointer
relabel objects according to their shape attributes
InputImageType::PixelType InputImagePixelType
OutputImageType::RegionType OutputImageRegionType
Superclass::AttributeType AttributeType
InputImageType::ConstPointer InputImageConstPointer
A Label object to store the common attributes related to the shape of the object. ...
Image< typename OutputImageType::PixelType, itkGetStaticConstMacro(OutputImageDimension) > ShapeLabelFilterOutput
ImageToImageFilter< TInputImage, TInputImage > Superclass
ShapeRelabelLabelMapFilter< LabelMapType > RelabelType
LabelMapToLabelImageFilter< LabelMapType, OutputImageType > BinarizerType
LabelObjectType::AttributeType AttributeType
InputImageType::Pointer InputImagePointer
Base class for filters that take an image as input and produce an image as output.
OutputImageType::ConstPointer OutputImageConstPointer
ShapeLabelMapFilter< LabelMapType, ShapeLabelFilterOutput > LabelObjectValuatorType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Templated n-dimensional image to store labeled objects.
Definition: itkLabelMap.h:70
SmartPointer< const Self > ConstPointer
LabelImageToLabelMapFilter< InputImageType, LabelMapType > LabelizerType
#define itkConceptMacro(name, concept)
The valuator class for the ShapeLabelObject.
Base class for all data objects in ITK.
Templated n-dimensional image class.
Definition: itkImage.h:75
LabelMap< LabelObjectType > LabelMapType
Converts a LabelMap to a labeled image.