ITK  5.2.0
Insight Toolkit
itkAttributeRelabelLabelMapFilter.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 itkAttributeRelabelLabelMapFilter_h
19 #define itkAttributeRelabelLabelMapFilter_h
20 
23 
24 namespace itk
25 {
43 template <typename TImage,
44  typename TAttributeAccessor =
45  typename Functor::AttributeLabelObjectAccessor<typename TImage::LabelObjectType>>
46 class ITK_TEMPLATE_EXPORT AttributeRelabelLabelMapFilter : public InPlaceLabelMapFilter<TImage>
47 {
48 public:
49  ITK_DISALLOW_COPY_AND_MOVE(AttributeRelabelLabelMapFilter);
50 
56 
58  using ImageType = TImage;
59  using ImagePointer = typename ImageType::Pointer;
60  using ImageConstPointer = typename ImageType::ConstPointer;
61  using PixelType = typename ImageType::PixelType;
62  using IndexType = typename ImageType::IndexType;
63  using LabelObjectType = typename ImageType::LabelObjectType;
64 
65  using AttributeAccessorType = TAttributeAccessor;
67 
69  static constexpr unsigned int ImageDimension = TImage::ImageDimension;
70 
72  itkNewMacro(Self);
73 
76 
77 #ifdef ITK_USE_CONCEPT_CHECKING
78  // Begin concept checking
79  /* itkConceptMacro(InputEqualityComparableCheck,
80  (Concept::EqualityComparable<InputImagePixelType>));
81  itkConceptMacro(IntConvertibleToInputCheck,
82  (Concept::Convertible<int, InputImagePixelType>));
83  itkConceptMacro(InputOStreamWritableCheck,
84  (Concept::OStreamWritable<InputImagePixelType>));*/
85  // End concept checking
86 #endif
87 
93  itkSetMacro(ReverseOrdering, bool);
94  itkGetConstReferenceMacro(ReverseOrdering, bool);
95  itkBooleanMacro(ReverseOrdering);
97 
98 protected:
100  ~AttributeRelabelLabelMapFilter() override = default;
101 
102  void
103  GenerateData() override;
104 
105  void
106  PrintSelf(std::ostream & os, Indent indent) const override;
107 
109  {
110  public:
111  bool
112  operator()(const typename LabelObjectType::Pointer & a, const typename LabelObjectType::Pointer & b)
113  {
114  return m_Accessor(a) < m_Accessor(b);
115  }
117  : m_Accessor()
118  {}
119 
120  private:
122  };
123 
125  {
126  public:
127  bool
128  operator()(const typename LabelObjectType::Pointer & a, const typename LabelObjectType::Pointer & b)
129  {
130  return m_Accessor(a) > m_Accessor(b);
131  }
133  : m_Accessor()
134  {}
135 
136  private:
138  };
139 
140 private:
142 
143 }; // end of class
144 
145 } // end namespace itk
146 
147 #ifndef ITK_MANUAL_INSTANTIATION
148 # include "itkAttributeRelabelLabelMapFilter.hxx"
149 #endif
150 
151 #endif
itk::AttributeRelabelLabelMapFilter< TImage, Functor::LabelLabelObjectAccessor< TImage::LabelObjectType > >::PixelType
typename ImageType::PixelType PixelType
Definition: itkAttributeRelabelLabelMapFilter.h:61
itk::AttributeRelabelLabelMapFilter::ReverseComparator::ReverseComparator
ReverseComparator()
Definition: itkAttributeRelabelLabelMapFilter.h:116
itk::AttributeRelabelLabelMapFilter< TImage, Functor::LabelLabelObjectAccessor< TImage::LabelObjectType > >::ImageConstPointer
typename ImageType::ConstPointer ImageConstPointer
Definition: itkAttributeRelabelLabelMapFilter.h:60
itk::AttributeRelabelLabelMapFilter< TImage, Functor::LabelLabelObjectAccessor< TImage::LabelObjectType > >::IndexType
typename ImageType::IndexType IndexType
Definition: itkAttributeRelabelLabelMapFilter.h:62
itk::InPlaceLabelMapFilter
Base class for filters that takes an image as input and overwrites that image as the output.
Definition: itkInPlaceLabelMapFilter.h:83
itk::AttributeRelabelLabelMapFilter< TImage, Functor::LabelLabelObjectAccessor< TImage::LabelObjectType > >::AttributeValueType
typename AttributeAccessorType::AttributeValueType AttributeValueType
Definition: itkAttributeRelabelLabelMapFilter.h:66
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::AttributeRelabelLabelMapFilter::m_ReverseOrdering
bool m_ReverseOrdering
Definition: itkAttributeRelabelLabelMapFilter.h:141
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::AttributeRelabelLabelMapFilter::ReverseComparator::m_Accessor
AttributeAccessorType m_Accessor
Definition: itkAttributeRelabelLabelMapFilter.h:121
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itkAttributeLabelObject.h
itk::AttributeRelabelLabelMapFilter::Comparator::operator()
bool operator()(const typename LabelObjectType::Pointer &a, const typename LabelObjectType::Pointer &b)
Definition: itkAttributeRelabelLabelMapFilter.h:128
itkInPlaceLabelMapFilter.h
itk::AttributeRelabelLabelMapFilter< TImage, Functor::LabelLabelObjectAccessor< TImage::LabelObjectType > >::ImageType
TImage ImageType
Definition: itkAttributeRelabelLabelMapFilter.h:58
itk::AttributeRelabelLabelMapFilter::Comparator::Comparator
Comparator()
Definition: itkAttributeRelabelLabelMapFilter.h:132
itk::AttributeRelabelLabelMapFilter< TImage, Functor::LabelLabelObjectAccessor< TImage::LabelObjectType > >::LabelObjectType
typename ImageType::LabelObjectType LabelObjectType
Definition: itkAttributeRelabelLabelMapFilter.h:63
itk::AttributeRelabelLabelMapFilter::ReverseComparator
Definition: itkAttributeRelabelLabelMapFilter.h:108
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::AttributeRelabelLabelMapFilter< TImage, Functor::LabelLabelObjectAccessor< TImage::LabelObjectType > >::ImagePointer
typename ImageType::Pointer ImagePointer
Definition: itkAttributeRelabelLabelMapFilter.h:59
itk::AttributeRelabelLabelMapFilter::Comparator::m_Accessor
AttributeAccessorType m_Accessor
Definition: itkAttributeRelabelLabelMapFilter.h:137
itk::Functor::LabelLabelObjectAccessor
Definition: itkLabelObjectAccessors.h:37
itk::AttributeRelabelLabelMapFilter
relabel objects according to their shape attributes
Definition: itkAttributeRelabelLabelMapFilter.h:46
itk::AttributeRelabelLabelMapFilter::AttributeAccessorType
TAttributeAccessor AttributeAccessorType
Definition: itkAttributeRelabelLabelMapFilter.h:65
itk::AttributeRelabelLabelMapFilter::Comparator
Definition: itkAttributeRelabelLabelMapFilter.h:124
itk::AttributeRelabelLabelMapFilter::ReverseComparator::operator()
bool operator()(const typename LabelObjectType::Pointer &a, const typename LabelObjectType::Pointer &b)
Definition: itkAttributeRelabelLabelMapFilter.h:112
itk::Functor::LabelLabelObjectAccessor::AttributeValueType
typename LabelObjectType::LabelType AttributeValueType
Definition: itkLabelObjectAccessors.h:41