ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkMergeLabelMapFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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  * http://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 
23 namespace itk
24 {
52 template< typename TImage >
53 class ITK_TEMPLATE_EXPORT MergeLabelMapFilter:
54  public InPlaceLabelMapFilter< TImage >
55 {
56 public:
57  ITK_DISALLOW_COPY_AND_ASSIGN(MergeLabelMapFilter);
58 
64 
66  using ImageType = TImage;
67  using ImagePointer = typename ImageType::Pointer;
68  using ImageConstPointer = typename ImageType::ConstPointer;
69  using PixelType = typename ImageType::PixelType;
70  using IndexType = typename ImageType::IndexType;
71  using LabelObjectType = typename ImageType::LabelObjectType;
72  using LabelObjectPointer = typename LabelObjectType::Pointer;
73 
75  static constexpr unsigned int ImageDimension = TImage::ImageDimension;
76 
78  itkNewMacro(Self);
79 
82 
83 #ifdef ITK_USE_CONCEPT_CHECKING
84  // Begin concept checking
85 /* itkConceptMacro(InputEqualityComparableCheck,
86  (Concept::EqualityComparable<InputImagePixelType>));
87  itkConceptMacro(IntConvertibleToInputCheck,
88  (Concept::Convertible<int, InputImagePixelType>));
89  itkConceptMacro(InputOStreamWritableCheck,
90  (Concept::OStreamWritable<InputImagePixelType>));*/
91 // End concept checking
92 #endif
93 
94 #ifdef STRICT
95 #undef STRICT
96 #endif
97  typedef enum {
98  KEEP = 0,
99  AGGREGATE = 1,
100  PACK = 2,
101  STRICT = 3
102  } MethodChoice;
103 
105  itkSetMacro(Method, MethodChoice);
106  itkGetConstReferenceMacro(Method, MethodChoice);
108 
109 protected:
111  ~MergeLabelMapFilter() override = default;
112 
113  void GenerateData() override;
114 
115  void PrintSelf(std::ostream & os, Indent indent) const override;
116 
118 
119 private:
120  void MergeWithKeep();
121 
122  void MergeWithAggregate();
123 
124  void MergeWithPack();
125 
126  void MergeWithStrict();
127 }; // end of class
128 } // end namespace itk
129 
130 #ifndef ITK_MANUAL_INSTANTIATION
131 #include "itkMergeLabelMapFilter.hxx"
132 #endif
133 
134 #endif
typename ImageType::ConstPointer ImageConstPointer
Light weight base class for most itk classes.
typename ImageType::IndexType IndexType
typename ImageType::PixelType PixelType
Merges several Label Maps.
typename ImageType::LabelObjectType LabelObjectType
Base class for filters that takes an image as input and overwrites that image as the output...
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename LabelObjectType::Pointer LabelObjectPointer
typename ImageType::Pointer ImagePointer