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,
44class ITK_TEMPLATE_EXPORT AttributeKeepNObjectsLabelMapFilter : public InPlaceLabelMapFilter<TImage>
45{
46public:
47 ITK_DISALLOW_COPY_AND_MOVE(AttributeKeepNObjectsLabelMapFilter);
48
54
56 using ImageType = TImage;
57 using ImagePointer = typename ImageType::Pointer;
58 using ImageConstPointer = typename ImageType::ConstPointer;
59 using PixelType = typename ImageType::PixelType;
60 using IndexType = typename ImageType::IndexType;
61 using LabelObjectType = typename ImageType::LabelObjectType;
62
63 using AttributeAccessorType = TAttributeAccessor;
64 using AttributeValueType = typename AttributeAccessorType::AttributeValueType;
65
67 static constexpr unsigned int ImageDimension = TImage::ImageDimension;
68
70 itkNewMacro(Self);
71
73 itkOverrideGetNameOfClassMacro(AttributeKeepNObjectsLabelMapFilter);
74
75 /*itkConceptMacro(InputEqualityComparableCheck,
76 (Concept::EqualityComparable<InputImagePixelType>));
77 itkConceptMacro(IntConvertibleToInputCheck,
78 (Concept::Convertible<int, InputImagePixelType>));
79 itkConceptMacro(InputOStreamWritableCheck,
80 (Concept::OStreamWritable<InputImagePixelType>));*/
81
88 itkSetMacro(ReverseOrdering, bool);
89 itkGetConstReferenceMacro(ReverseOrdering, bool);
90 itkBooleanMacro(ReverseOrdering);
96 itkSetMacro(NumberOfObjects, SizeValueType);
97 itkGetConstReferenceMacro(NumberOfObjects, SizeValueType);
99protected:
102
103 void
104 GenerateData() override;
105
106 void
107 PrintSelf(std::ostream & os, Indent indent) const override;
108
110 {
111 public:
112 bool
113 operator()(const typename LabelObjectType::Pointer & a, const typename LabelObjectType::Pointer & b)
114 {
115 return m_Accessor(a) < m_Accessor(b);
116 }
120
121 private:
123 };
124
126 {
127 public:
128 bool
129 operator()(const typename LabelObjectType::Pointer & a, const typename LabelObjectType::Pointer & b)
130 {
131 return m_Accessor(a) > m_Accessor(b);
132 }
134 : m_Accessor()
135 {}
136
137 private:
139 };
140
141private:
144
145}; // end of class
146
147} // end namespace itk
148
149#ifndef ITK_MANUAL_INSTANTIATION
150# include "itkAttributeKeepNObjectsLabelMapFilter.hxx"
151#endif
152
153#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