ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkAttributeRelabelLabelMapFilter.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 itkAttributeRelabelLabelMapFilter_h
19 #define itkAttributeRelabelLabelMapFilter_h
20 
23 
24 namespace itk {
42 template<typename TImage, typename TAttributeAccessor=
43  typename Functor::AttributeLabelObjectAccessor< typename TImage::LabelObjectType > >
44 class ITK_TEMPLATE_EXPORT AttributeRelabelLabelMapFilter :
45  public InPlaceLabelMapFilter<TImage>
46 {
47 public:
53 
55  typedef TImage ImageType;
56  typedef typename ImageType::Pointer ImagePointer;
57  typedef typename ImageType::ConstPointer ImageConstPointer;
58  typedef typename ImageType::PixelType PixelType;
59  typedef typename ImageType::IndexType IndexType;
60  typedef typename ImageType::LabelObjectType LabelObjectType;
61 
62  typedef TAttributeAccessor AttributeAccessorType;
64 
66  itkStaticConstMacro(ImageDimension, unsigned int,
67  TImage::ImageDimension);
68 
70  itkNewMacro(Self);
71 
73  itkTypeMacro(AttributeRelabelLabelMapFilter,
75 
76 #ifdef ITK_USE_CONCEPT_CHECKING
77  // Begin concept checking
78 /* itkConceptMacro(InputEqualityComparableCheck,
79  (Concept::EqualityComparable<InputImagePixelType>));
80  itkConceptMacro(IntConvertibleToInputCheck,
81  (Concept::Convertible<int, InputImagePixelType>));
82  itkConceptMacro(InputOStreamWritableCheck,
83  (Concept::OStreamWritable<InputImagePixelType>));*/
84  // End concept checking
85 #endif
86 
92  itkSetMacro( ReverseOrdering, bool );
93  itkGetConstReferenceMacro( ReverseOrdering, bool );
94  itkBooleanMacro( ReverseOrdering );
96 
97 protected:
100 
101  void GenerateData() ITK_OVERRIDE;
102 
103  void PrintSelf(std::ostream& os, Indent indent) const ITK_OVERRIDE;
104 
106  {
107  public:
108  bool operator()( const typename LabelObjectType::Pointer & a, const typename LabelObjectType::Pointer & b )
109  {
110  return m_Accessor( a ) < m_Accessor( b );
111  }
112  ReverseComparator(): m_Accessor() {}
113  private:
115  };
116 
118  {
119  public:
120  bool operator()( const typename LabelObjectType::Pointer & a, const typename LabelObjectType::Pointer & b )
121  {
122  return m_Accessor( a ) > m_Accessor( b );
123  }
124  Comparator(): m_Accessor() {}
125  private:
127  };
128 
129 private:
130  ITK_DISALLOW_COPY_AND_ASSIGN(AttributeRelabelLabelMapFilter);
131 
132  bool m_ReverseOrdering;
133 
134 }; // end of class
135 
136 } // end namespace itk
137 
138 #ifndef ITK_MANUAL_INSTANTIATION
139 #include "itkAttributeRelabelLabelMapFilter.hxx"
140 #endif
141 
142 #endif
Light weight base class for most itk classes.
bool operator()(const typename LabelObjectType::Pointer &a, const typename LabelObjectType::Pointer &b)
bool operator()(const typename LabelObjectType::Pointer &a, const typename LabelObjectType::Pointer &b)
AttributeAccessorType::AttributeValueType AttributeValueType
Base class for filters that takes an image as input and overwrites that image as the output...
relabel objects according to their shape attributes
Control indentation during Print() invocation.
Definition: itkIndent.h:49