ITK  4.13.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:
62 
64  typedef TImage ImageType;
65  typedef typename ImageType::Pointer ImagePointer;
66  typedef typename ImageType::ConstPointer ImageConstPointer;
67  typedef typename ImageType::PixelType PixelType;
68  typedef typename ImageType::IndexType IndexType;
69  typedef typename ImageType::LabelObjectType LabelObjectType;
70  typedef typename LabelObjectType::Pointer LabelObjectPointer;
71 
73  itkStaticConstMacro(ImageDimension, unsigned int, TImage::ImageDimension);
74 
76  itkNewMacro(Self);
77 
80 
81 #ifdef ITK_USE_CONCEPT_CHECKING
82  // Begin concept checking
83 /* itkConceptMacro(InputEqualityComparableCheck,
84  (Concept::EqualityComparable<InputImagePixelType>));
85  itkConceptMacro(IntConvertibleToInputCheck,
86  (Concept::Convertible<int, InputImagePixelType>));
87  itkConceptMacro(InputOStreamWritableCheck,
88  (Concept::OStreamWritable<InputImagePixelType>));*/
89 // End concept checking
90 #endif
91 
92 #ifdef STRICT
93 #undef STRICT
94 #endif
95  typedef enum {
96  KEEP = 0,
97  AGGREGATE = 1,
98  PACK = 2,
99  STRICT = 3
100  } MethodChoice;
101 
103  itkSetMacro(Method, MethodChoice);
104  itkGetConstReferenceMacro(Method, MethodChoice);
106 
107 protected:
109  ~MergeLabelMapFilter() ITK_OVERRIDE {}
110 
111  void GenerateData() ITK_OVERRIDE;
112 
113  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
114 
115  MethodChoice m_Method;
116 
117 private:
118  ITK_DISALLOW_COPY_AND_ASSIGN(MergeLabelMapFilter);
119 
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
InPlaceLabelMapFilter< TImage > Superclass
Light weight base class for most itk classes.
ImageType::LabelObjectType LabelObjectType
Merges several Label Maps.
ImageType::IndexType IndexType
SmartPointer< Self > Pointer
ImageType::ConstPointer ImageConstPointer
ImageType::PixelType PixelType
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
SmartPointer< const Self > ConstPointer
LabelObjectType::Pointer LabelObjectPointer