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,
47 typename TAttributeAccessor =
49class ITK_TEMPLATE_EXPORT AttributeUniqueLabelMapFilter : public InPlaceLabelMapFilter<TImage>
50{
51public:
52 ITK_DISALLOW_COPY_AND_MOVE(AttributeUniqueLabelMapFilter);
53
59
61 using ImageType = TImage;
62 using ImagePointer = typename ImageType::Pointer;
63 using ImageConstPointer = typename ImageType::ConstPointer;
64 using PixelType = typename ImageType::PixelType;
65 using IndexType = typename ImageType::IndexType;
66 using LabelObjectType = typename ImageType::LabelObjectType;
67
68 using AttributeAccessorType = TAttributeAccessor;
69 using AttributeValueType = typename AttributeAccessorType::AttributeValueType;
70
71 using LineType = typename LabelObjectType::LineType;
72
74 static constexpr unsigned int ImageDimension = TImage::ImageDimension;
75
77 itkNewMacro(Self);
78
80 itkOverrideGetNameOfClassMacro(AttributeUniqueLabelMapFilter);
81
82 /* itkConceptMacro(InputEqualityComparableCheck,
83 (Concept::EqualityComparable<InputImagePixelType>));
84 itkConceptMacro(IntConvertibleToInputCheck,
85 (Concept::Convertible<int, InputImagePixelType>));
86 itkConceptMacro(InputOStreamWritableCheck,
87 (Concept::OStreamWritable<InputImagePixelType>));*/
88
95 itkSetMacro(ReverseOrdering, bool);
96 itkGetConstReferenceMacro(ReverseOrdering, bool);
97 itkBooleanMacro(ReverseOrdering);
99protected:
101 ~AttributeUniqueLabelMapFilter() override = default;
102
103 void
104 GenerateData() override;
105
106 void
107 PrintSelf(std::ostream & os, Indent indent) const override;
108
110
111private:
113 {
114 using LineType = typename LabelObjectType::LineType;
115
117 : line(l)
118 , labelObject(lo)
119 {}
122 };
123
125 {
126 public:
127 bool
129 {
130 for (int i = ImageDimension - 1; i >= 0; i--)
131 {
132 if (lla.line.GetIndex()[i] > llb.line.GetIndex()[i])
133 {
134 return true;
135 }
136 if (lla.line.GetIndex()[i] < llb.line.GetIndex()[i])
137 {
138 return false;
139 }
140 }
141 return false;
142 }
143 };
144
145}; // end of class
146
147} // end namespace itk
148
149#ifndef ITK_MANUAL_INSTANTIATION
150# include "itkAttributeUniqueLabelMapFilter.hxx"
151#endif
152
153#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....