ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkMergeLabelMapFilter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkMergeLabelMapFilter_h
00019 #define __itkMergeLabelMapFilter_h
00020 
00021 #include "itkInPlaceLabelMapFilter.h"
00022 
00023 namespace itk
00024 {
00052 template< class TImage >
00053 class ITK_EXPORT MergeLabelMapFilter:
00054   public InPlaceLabelMapFilter< TImage >
00055 {
00056 public:
00058   typedef MergeLabelMapFilter             Self;
00059   typedef InPlaceLabelMapFilter< TImage > Superclass;
00060   typedef SmartPointer< Self >            Pointer;
00061   typedef SmartPointer< const Self >      ConstPointer;
00062 
00064   typedef TImage                              ImageType;
00065   typedef typename ImageType::Pointer         ImagePointer;
00066   typedef typename ImageType::ConstPointer    ImageConstPointer;
00067   typedef typename ImageType::PixelType       PixelType;
00068   typedef typename ImageType::IndexType       IndexType;
00069   typedef typename ImageType::LabelObjectType LabelObjectType;
00070   typedef typename LabelObjectType::Pointer   LabelObjectPointer;
00071 
00073   itkStaticConstMacro(ImageDimension, unsigned int, TImage::ImageDimension);
00074 
00076   itkNewMacro(Self);
00077 
00079   itkTypeMacro(MergeLabelMapFilter, InPlaceLabelMapFilter);
00080 
00081 #ifdef ITK_USE_CONCEPT_CHECKING
00082 
00083 /*  itkConceptMacro(InputEqualityComparableCheck,
00084     (Concept::EqualityComparable<InputImagePixelType>));
00085   itkConceptMacro(IntConvertibleToInputCheck,
00086     (Concept::Convertible<int, InputImagePixelType>));
00087   itkConceptMacro(InputOStreamWritableCheck,
00088     (Concept::OStreamWritable<InputImagePixelType>));*/
00089 
00091 #endif
00092 
00093 #ifdef STRICT
00094 #undef STRICT
00095 #endif
00096   typedef enum {
00097     KEEP = 0,
00098     AGGREGATE = 1,
00099     PACK = 2,
00100     STRICT = 3
00101     } MethodChoice;
00102 
00104   itkSetMacro(Method, MethodChoice);
00105   itkGetConstReferenceMacro(Method, MethodChoice);
00106 protected:
00107   MergeLabelMapFilter();
00108   ~MergeLabelMapFilter() {}
00110 
00111   void GenerateData();
00112 
00113   void PrintSelf(std::ostream & os, Indent indent) const;
00114 
00115   MethodChoice m_Method;
00116 
00117 private:
00118   MergeLabelMapFilter(const Self &); //purposely not implemented
00119   void operator=(const Self &);      //purposely not implemented
00120 
00121   void MergeWithKeep();
00122 
00123   void MergeWithAggregate();
00124 
00125   void MergeWithPack();
00126 
00127   void MergeWithStrict();
00128 }; // end of class
00129 } // end namespace itk
00130 
00131 #ifndef ITK_MANUAL_INSTANTIATION
00132 #include "itkMergeLabelMapFilter.hxx"
00133 #endif
00134 
00135 #endif
00136