00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkMergeLabelMapFilter.h,v $ 00005 Language: C++ 00006 Date: $Date: 2009-07-28 14:23:40 $ 00007 Version: $Revision: 1.5 $ 00008 00009 Copyright (c) Insight Software Consortium. All rights reserved. 00010 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 #ifndef __itkMergeLabelMapFilter_h 00018 #define __itkMergeLabelMapFilter_h 00019 00020 #include "itkInPlaceLabelMapFilter.h" 00021 00022 namespace itk { 00042 template<class TImage > 00043 class ITK_EXPORT MergeLabelMapFilter : 00044 public InPlaceLabelMapFilter<TImage> 00045 { 00046 public: 00048 typedef MergeLabelMapFilter Self; 00049 typedef InPlaceLabelMapFilter<TImage> Superclass; 00050 typedef SmartPointer<Self> Pointer; 00051 typedef SmartPointer<const Self> ConstPointer; 00052 00054 typedef TImage ImageType; 00055 typedef typename ImageType::Pointer ImagePointer; 00056 typedef typename ImageType::ConstPointer ImageConstPointer; 00057 typedef typename ImageType::PixelType PixelType; 00058 typedef typename ImageType::IndexType IndexType; 00059 typedef typename ImageType::LabelObjectType LabelObjectType; 00060 typedef typename LabelObjectType::Pointer LabelObjectPointer; 00061 00063 itkStaticConstMacro( ImageDimension, unsigned int, TImage::ImageDimension ); 00064 00066 itkNewMacro( Self ); 00067 00069 itkTypeMacro( MergeLabelMapFilter, InPlaceLabelMapFilter ); 00070 00071 #ifdef ITK_USE_CONCEPT_CHECKING 00072 00073 /* itkConceptMacro(InputEqualityComparableCheck, 00074 (Concept::EqualityComparable<InputImagePixelType>)); 00075 itkConceptMacro(IntConvertibleToInputCheck, 00076 (Concept::Convertible<int, InputImagePixelType>)); 00077 itkConceptMacro(InputOStreamWritableCheck, 00078 (Concept::OStreamWritable<InputImagePixelType>));*/ 00079 00081 #endif 00082 00083 #ifdef STRICT 00084 #undef STRICT 00085 #endif 00086 typedef enum { 00087 KEEP = 0, 00088 AGGREGATE = 1, 00089 PACK = 2, 00090 STRICT = 3 00091 } MethodChoice; 00092 00093 itkSetMacro( Method, MethodChoice ); 00094 itkGetConstReferenceMacro( Method, MethodChoice ); 00095 00096 protected: 00097 MergeLabelMapFilter(); 00098 ~MergeLabelMapFilter() {}; 00099 00100 void GenerateData(); 00101 00102 void PrintSelf(std::ostream& os, Indent indent) const; 00103 00104 typedef typename ImageType::LabelObjectContainerType LabelObjectContainerType; 00105 typedef typename LabelObjectType::LineContainerType LineContainerType; 00106 typedef typename LineContainerType::const_iterator LineContainerIterator; 00107 00108 MethodChoice m_Method; 00109 00110 private: 00111 MergeLabelMapFilter( const Self& ); //purposely not implemented 00112 void operator=( const Self& ); //purposely not implemented 00113 00114 void MergeWithKeep(); 00115 void MergeWithAggregate(); 00116 void MergeWithPack(); 00117 void MergeWithStrict(); 00118 00119 }; // end of class 00120 00121 } // end namespace itk 00122 00123 #ifndef ITK_MANUAL_INSTANTIATION 00124 #include "itkMergeLabelMapFilter.txx" 00125 #endif 00126 00127 #endif 00128