ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkAttributeKeepNObjectsLabelMapFilter.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 itkAttributeKeepNObjectsLabelMapFilter_h
19#define itkAttributeKeepNObjectsLabelMapFilter_h
20
23
24namespace itk
25{
42template <typename TImage,
43 typename TAttributeAccessor =
45class ITK_TEMPLATE_EXPORT AttributeKeepNObjectsLabelMapFilter : public InPlaceLabelMapFilter<TImage>
46{
47public:
48 ITK_DISALLOW_COPY_AND_MOVE(AttributeKeepNObjectsLabelMapFilter);
49
55
57 using ImageType = TImage;
58 using ImagePointer = typename ImageType::Pointer;
59 using ImageConstPointer = typename ImageType::ConstPointer;
60 using PixelType = typename ImageType::PixelType;
61 using IndexType = typename ImageType::IndexType;
62 using LabelObjectType = typename ImageType::LabelObjectType;
63
64 using AttributeAccessorType = TAttributeAccessor;
65 using AttributeValueType = typename AttributeAccessorType::AttributeValueType;
66
68 static constexpr unsigned int ImageDimension = TImage::ImageDimension;
69
71 itkNewMacro(Self);
72
74 itkOverrideGetNameOfClassMacro(AttributeKeepNObjectsLabelMapFilter);
75
76 /*itkConceptMacro(InputEqualityComparableCheck,
77 (Concept::EqualityComparable<InputImagePixelType>));
78 itkConceptMacro(IntConvertibleToInputCheck,
79 (Concept::Convertible<int, InputImagePixelType>));
80 itkConceptMacro(InputOStreamWritableCheck,
81 (Concept::OStreamWritable<InputImagePixelType>));*/
82
88 itkSetMacro(ReverseOrdering, bool);
89 itkGetConstReferenceMacro(ReverseOrdering, bool);
90 itkBooleanMacro(ReverseOrdering);
92
96 itkSetMacro(NumberOfObjects, SizeValueType);
97 itkGetConstReferenceMacro(NumberOfObjects, SizeValueType);
99
100protected:
103
104 void
105 GenerateData() override;
106
107 void
108 PrintSelf(std::ostream & os, Indent indent) const override;
109
111 {
112 public:
113 bool
114 operator()(const typename LabelObjectType::Pointer & a, const typename LabelObjectType::Pointer & b)
115 {
116 return m_Accessor(a) < m_Accessor(b);
117 }
121
122 private:
124 };
125
127 {
128 public:
129 bool
130 operator()(const typename LabelObjectType::Pointer & a, const typename LabelObjectType::Pointer & b)
131 {
132 return m_Accessor(a) > m_Accessor(b);
133 }
135 : m_Accessor()
136 {}
137
138 private:
140 };
141
142private:
145
146}; // end of class
147
148} // end namespace itk
149
150#ifndef ITK_MANUAL_INSTANTIATION
151# include "itkAttributeKeepNObjectsLabelMapFilter.hxx"
152#endif
153
154#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)
typename AttributeAccessorType::AttributeValueType AttributeValueType
~AttributeKeepNObjectsLabelMapFilter() override=default
void PrintSelf(std::ostream &os, Indent indent) const override
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....
unsigned long SizeValueType
Definition itkIntTypes.h:86