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
94 itkSetMacro(ReverseOrdering, bool);
95 itkGetConstReferenceMacro(ReverseOrdering, bool);
96 itkBooleanMacro(ReverseOrdering);
98
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 {
118 this->line = l;
119 this->labelObject = lo;
120 }
123 };
124
126 {
127 public:
128 bool
130 {
131 for (int i = ImageDimension - 1; i >= 0; i--)
132 {
133 if (lla.line.GetIndex()[i] > llb.line.GetIndex()[i])
134 {
135 return true;
136 }
137 if (lla.line.GetIndex()[i] < llb.line.GetIndex()[i])
138 {
139 return false;
140 }
141 }
142 return false;
143 }
144 };
145
146}; // end of class
147
148} // end namespace itk
149
150#ifndef ITK_MANUAL_INSTANTIATION
151# include "itkAttributeUniqueLabelMapFilter.hxx"
152#endif
153
154#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....