ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkAttributeSelectionLabelMapFilter.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 itkAttributeSelectionLabelMapFilter_h
19#define itkAttributeSelectionLabelMapFilter_h
20
23#include <set>
24
25
26namespace itk
27{
50template <typename TImage,
51 typename TAttributeAccessor =
53class ITK_TEMPLATE_EXPORT AttributeSelectionLabelMapFilter : public InPlaceLabelMapFilter<TImage>
54{
55public:
56 ITK_DISALLOW_COPY_AND_MOVE(AttributeSelectionLabelMapFilter);
57
63
65 using ImageType = TImage;
66 using ImagePointer = typename ImageType::Pointer;
67 using ImageConstPointer = typename ImageType::ConstPointer;
68 using PixelType = typename ImageType::PixelType;
69 using IndexType = typename ImageType::IndexType;
70 using LabelObjectType = typename ImageType::LabelObjectType;
71
72 using AttributeAccessorType = TAttributeAccessor;
73 using AttributeValueType = typename AttributeAccessorType::AttributeValueType;
74
75 using AttributeSetType = typename std::set<AttributeValueType>;
76
78 static constexpr unsigned int ImageDimension = TImage::ImageDimension;
79
81 itkNewMacro(Self);
82
84 itkOverrideGetNameOfClassMacro(AttributeSelectionLabelMapFilter);
85
86 /* itkConceptMacro(InputEqualityComparableCheck,
87 (Concept::EqualityComparable<InputImagePixelType>));
88 itkConceptMacro(IntConvertibleToInputCheck,
89 (Concept::Convertible<int, InputImagePixelType>));
90 itkConceptMacro(InputOStreamWritableCheck,
91 (Concept::OStreamWritable<InputImagePixelType>));*/
92
96 const AttributeSetType &
98 {
99 return m_AttributeSet;
100 }
101 void
103 {
104 m_AttributeSet = set;
105 this->Modified();
106 }
107
108
113 itkGetConstMacro(Exclude, bool);
114 itkSetMacro(Exclude, bool);
115 itkBooleanMacro(Exclude);
117
119 void
121 {
122 this->ClearAttributeSet();
123 this->AddAttribute(attr);
124 }
125
126
127 void
129 {
130 if (!m_AttributeSet.empty())
131 {
132 m_AttributeSet.clear();
133 this->Modified();
134 }
135 }
136
137 void
139 {
140 const typename AttributeSetType::size_type size = m_AttributeSet.size();
141 m_AttributeSet.insert(attr);
142 if (size != m_AttributeSet.size())
143 {
144 this->Modified();
145 }
146 }
147
148protected:
151
152 void
153 GenerateData() override;
154
155 void
156 PrintSelf(std::ostream & os, Indent indent) const override;
157
158private:
160 bool m_Exclude{};
161
162}; // end of class
163
164} // end namespace itk
165
166#ifndef ITK_MANUAL_INSTANTIATION
167# include "itkAttributeSelectionLabelMapFilter.hxx"
168#endif
169
170#endif
void PrintSelf(std::ostream &os, Indent indent) const override
typename std::set< AttributeValueType > AttributeSetType
typename AttributeAccessorType::AttributeValueType AttributeValueType
~AttributeSelectionLabelMapFilter() override=default
Control indentation during Print() invocation.
Definition itkIndent.h:50
virtual void Modified() const
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....