ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkMergeLabelMapFilter.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 itkMergeLabelMapFilter_h
19#define itkMergeLabelMapFilter_h
20
22#include "ITKLabelMapExport.h"
23
24namespace itk
25{
26// See https://docs.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/compiler-error-c2059?view=vs-2019
27#ifdef STRICT
28# define TEMPINPLACELABELMAPSTRICT STRICT
29# undef STRICT
30#endif
36{
37public:
41 enum class ChoiceMethod : uint8_t
42 {
43 KEEP = 0,
45 PACK = 2,
47 };
48};
49// Define how to print enumeration
50extern ITKLabelMap_EXPORT std::ostream &
51 operator<<(std::ostream & out, const MergeLabelMapFilterEnums::ChoiceMethod value);
52
54#if !defined(ITK_LEGACY_REMOVE)
57// We need to expose the enum values at the class level
58// for backwards compatibility
59static constexpr ChoiceMethodEnum KEEP = ChoiceMethodEnum::KEEP;
60static constexpr ChoiceMethodEnum AGGREGATE = ChoiceMethodEnum::AGGREGATE;
61static constexpr ChoiceMethodEnum PACK = ChoiceMethodEnum::PACK;
62static constexpr ChoiceMethodEnum STRICT = ChoiceMethodEnum::STRICT;
63#endif
64
65#ifdef TEMPINPLACELABELMAPSTRICT
66# define STRICT TEMPINPLACELABELMAPSTRICT
67# undef TEMPINPLACELABELMAPSTRICT
68#endif
100template <typename TImage>
101class ITK_TEMPLATE_EXPORT MergeLabelMapFilter : public InPlaceLabelMapFilter<TImage>
102{
103public:
104 ITK_DISALLOW_COPY_AND_MOVE(MergeLabelMapFilter);
105
111
113 using ImageType = TImage;
114 using ImagePointer = typename ImageType::Pointer;
115 using ImageConstPointer = typename ImageType::ConstPointer;
116 using PixelType = typename ImageType::PixelType;
117 using IndexType = typename ImageType::IndexType;
118 using LabelObjectType = typename ImageType::LabelObjectType;
119 using LabelObjectPointer = typename LabelObjectType::Pointer;
120
122 static constexpr unsigned int ImageDimension = TImage::ImageDimension;
123
125 itkNewMacro(Self);
126
128 itkOverrideGetNameOfClassMacro(MergeLabelMapFilter);
129
130#if !defined(ITK_LEGACY_REMOVE)
132 using MethodChoice = ChoiceMethodEnum;
133#endif
134
135 /*itkConceptMacro(InputEqualityComparableCheck,
136 (Concept::EqualityComparable<InputImagePixelType>));
137 itkConceptMacro(IntConvertibleToInputCheck,
138 (Concept::Convertible<int, InputImagePixelType>));
139 itkConceptMacro(InputOStreamWritableCheck,
140 (Concept::OStreamWritable<InputImagePixelType>));*/
141
142#ifdef STRICT
143# undef STRICT
144#endif
145
147 itkSetMacro(Method, ChoiceMethodEnum);
148 itkGetConstReferenceMacro(Method, ChoiceMethodEnum);
150
151protected:
153 ~MergeLabelMapFilter() override = default;
154
155 void
156 GenerateData() override;
157
158 void
159 PrintSelf(std::ostream & os, Indent indent) const override;
160
162
163private:
164 void
166
167 void
169
170 void
172
173 void
175}; // end of class
176} // end namespace itk
177
178#ifndef ITK_MANUAL_INSTANTIATION
179# include "itkMergeLabelMapFilter.hxx"
180#endif
181
182#endif
Control indentation during Print() invocation.
Definition itkIndent.h:50
Contains all enum classes used by MergeLabelMapFilter class.
InPlaceLabelMapFilter< TImage > Superclass
SmartPointer< const Self > ConstPointer
typename ImageType::Pointer ImagePointer
typename ImageType::ConstPointer ImageConstPointer
static constexpr unsigned int ImageDimension
void PrintSelf(std::ostream &os, Indent indent) const override
~MergeLabelMapFilter() override=default
void GenerateData() override
typename ImageType::IndexType IndexType
typename ImageType::PixelType PixelType
typename ImageType::LabelObjectType LabelObjectType
typename LabelObjectType::Pointer LabelObjectPointer
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, typename AnatomicalOrientation::CoordinateEnum value)
MergeLabelMapFilterEnums::ChoiceMethod ChoiceMethodEnum