ITK  4.2.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< class TImage >
53 class ITK_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 
83 /* itkConceptMacro(InputEqualityComparableCheck,
84  (Concept::EqualityComparable<InputImagePixelType>));
85  itkConceptMacro(IntConvertibleToInputCheck,
86  (Concept::Convertible<int, InputImagePixelType>));
87  itkConceptMacro(InputOStreamWritableCheck,
88  (Concept::OStreamWritable<InputImagePixelType>));*/
89 
91 #endif
92 
93 #ifdef STRICT
94 #undef STRICT
95 #endif
96  typedef enum {
97  KEEP = 0,
98  AGGREGATE = 1,
99  PACK = 2,
100  STRICT = 3
101  } MethodChoice;
102 
104  itkSetMacro(Method, MethodChoice);
105  itkGetConstReferenceMacro(Method, MethodChoice);
106 protected:
110 
111  void GenerateData();
112 
113  void PrintSelf(std::ostream & os, Indent indent) const;
114 
116 
117 private:
118  MergeLabelMapFilter(const Self &); //purposely not implemented
119  void operator=(const Self &); //purposely not implemented
120 
121  void MergeWithKeep();
122 
123  void MergeWithAggregate();
124 
125  void MergeWithPack();
126 
127  void MergeWithStrict();
128 }; // end of class
129 } // end namespace itk
130 
131 #ifndef ITK_MANUAL_INSTANTIATION
132 #include "itkMergeLabelMapFilter.hxx"
133 #endif
134 
135 #endif
136