ITK  6.0.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 * https://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
24namespace itk
25{
43template <typename TImage,
44 typename TAttributeAccessor =
45 typename Functor::AttributeLabelObjectAccessor<typename TImage::LabelObjectType>>
46class ITK_TEMPLATE_EXPORT AttributeRelabelLabelMapFilter : public InPlaceLabelMapFilter<TImage>
47{
48public:
49 ITK_DISALLOW_COPY_AND_MOVE(AttributeRelabelLabelMapFilter);
50
56
58 using ImageType = TImage;
61 using PixelType = typename ImageType::PixelType;
63 using LabelObjectType = typename ImageType::LabelObjectType;
64
65 using AttributeAccessorType = TAttributeAccessor;
66 using AttributeValueType = typename AttributeAccessorType::AttributeValueType;
67
69 static constexpr unsigned int ImageDimension = TImage::ImageDimension;
70
72 itkNewMacro(Self);
73
75 itkOverrideGetNameOfClassMacro(AttributeRelabelLabelMapFilter);
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);
98protected:
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
140private:
141 bool m_ReverseOrdering{};
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
bool operator()(const typename LabelObjectType::Pointer &a, const typename LabelObjectType::Pointer &b)
bool operator()(const typename LabelObjectType::Pointer &a, const typename LabelObjectType::Pointer &b)
relabel objects according to their shape attributes
typename ImageType::LabelObjectType LabelObjectType
typename ImageType::ConstPointer ImageConstPointer
~AttributeRelabelLabelMapFilter() override=default
typename AttributeAccessorType::AttributeValueType AttributeValueType
void PrintSelf(std::ostream &os, Indent indent) const override
Base class for filters that takes an image as input and overwrites that image as the output.
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....