ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkAttributeUniqueLabelMapFilter.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 itkAttributeUniqueLabelMapFilter_h
19#define itkAttributeUniqueLabelMapFilter_h
20
23
24namespace itk
25{
46template <typename TImage,
48class ITK_TEMPLATE_EXPORT AttributeUniqueLabelMapFilter : public InPlaceLabelMapFilter<TImage>
49{
50public:
51 ITK_DISALLOW_COPY_AND_MOVE(AttributeUniqueLabelMapFilter);
52
58
60 using ImageType = TImage;
61 using ImagePointer = typename ImageType::Pointer;
62 using ImageConstPointer = typename ImageType::ConstPointer;
63 using PixelType = typename ImageType::PixelType;
64 using IndexType = typename ImageType::IndexType;
65 using LabelObjectType = typename ImageType::LabelObjectType;
66
67 using AttributeAccessorType = TAttributeAccessor;
68 using AttributeValueType = typename AttributeAccessorType::AttributeValueType;
69
70 using LineType = typename LabelObjectType::LineType;
71
73 static constexpr unsigned int ImageDimension = TImage::ImageDimension;
74
76 itkNewMacro(Self);
77
79 itkOverrideGetNameOfClassMacro(AttributeUniqueLabelMapFilter);
80
81 /* itkConceptMacro(InputEqualityComparableCheck,
82 (Concept::EqualityComparable<InputImagePixelType>));
83 itkConceptMacro(IntConvertibleToInputCheck,
84 (Concept::Convertible<int, InputImagePixelType>));
85 itkConceptMacro(InputOStreamWritableCheck,
86 (Concept::OStreamWritable<InputImagePixelType>));*/
87
94 itkSetMacro(ReverseOrdering, bool);
95 itkGetConstReferenceMacro(ReverseOrdering, bool);
96 itkBooleanMacro(ReverseOrdering);
98protected:
100 ~AttributeUniqueLabelMapFilter() override = default;
101
102 void
103 GenerateData() override;
104
105 void
106 PrintSelf(std::ostream & os, Indent indent) const override;
107
109
110private:
112 {
113 using LineType = typename LabelObjectType::LineType;
114
116 : line(l)
117 , labelObject(lo)
118 {}
121 };
122
124 {
125 public:
126 bool
128 {
129 for (int i = ImageDimension - 1; i >= 0; i--)
130 {
131 if (lla.line.GetIndex()[i] > llb.line.GetIndex()[i])
132 {
133 return true;
134 }
135 if (lla.line.GetIndex()[i] < llb.line.GetIndex()[i])
136 {
137 return false;
138 }
139 }
140 return false;
141 }
142 };
143
144}; // end of class
145
146} // end namespace itk
147
148#ifndef ITK_MANUAL_INSTANTIATION
149# include "itkAttributeUniqueLabelMapFilter.hxx"
150#endif
151
152#endif
bool operator()(const LineOfLabelObject &lla, const LineOfLabelObject &llb)
void PrintSelf(std::ostream &os, Indent indent) const override
typename AttributeAccessorType::AttributeValueType AttributeValueType
typename ImageType::ConstPointer ImageConstPointer
~AttributeUniqueLabelMapFilter() override=default
typename LabelObjectType::LineType LineType
typename ImageType::LabelObjectType LabelObjectType
Control indentation during Print() invocation.
Definition itkIndent.h:50
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....