00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _itkLevelSet_h
00018 #define _itkLevelSet_h
00019
00020 #include "itkIndex.h"
00021 #include "itkImage.h"
00022 #include "itkVectorContainer.h"
00023 #include "itkVector.h"
00024
00025 namespace itk
00026 {
00027
00043 template<class TPixel, unsigned int VSetDimension = 2>
00044 class ITK_EXPORT LevelSetNode
00045 {
00046 public:
00048 typedef LevelSetNode Self;
00049
00051 typedef TPixel PixelType;
00052
00054 itkStaticConstMacro(SetDimension, unsigned int, VSetDimension);
00055
00057 typedef Index<VSetDimension> IndexType;
00058
00060 bool operator> ( const Self& node ) const
00061 { return m_Value > node.m_Value; }
00062
00064 bool operator< ( const Self& node ) const
00065 { return m_Value < node.m_Value; }
00066
00068 bool operator<= ( const Self& node ) const
00069 { return m_Value <= node.m_Value; }
00070
00072 bool operator>= ( const Self& node ) const
00073 { return m_Value >= node.m_Value; }
00074
00077 Self& operator= ( const Self& rhs )
00078 {
00079 if( this == &rhs ) {return *this;}
00080
00081 m_Value = rhs.m_Value;
00082 m_Index = rhs.m_Index;
00083 return *this;
00084 }
00085
00087 PixelType& GetValue()
00088 { return m_Value; };
00089 void SetValue( const PixelType& input )
00090 { m_Value = input; };
00091
00093 IndexType& GetIndex()
00094 { return m_Index; }
00095 void SetIndex( const IndexType& input )
00096 { m_Index = input; };
00097
00099 LevelSetNode() : m_Value( NumericTraits<PixelType>::Zero ) {
00100 m_Index.Fill( 0 );
00101 };
00102
00104 LevelSetNode(const Self &node) : m_Value( node.m_Value ), m_Index( node.m_Index ) {};
00105
00106 private:
00107 PixelType m_Value;
00108 IndexType m_Index;
00109
00110 };
00111
00125 template<class TLevelSet>
00126 class ITK_EXPORT LevelSetTypeDefault
00127 {
00128 public:
00130 typedef LevelSetTypeDefault Self;
00131 typedef TLevelSet LevelSetImageType;
00132
00133
00135 itkStaticConstMacro(SetDimension, unsigned int, TLevelSet::ImageDimension);
00136
00138 typedef typename TLevelSet::Pointer LevelSetPointer;
00139 typedef typename TLevelSet::ConstPointer LevelSetConstPointer;
00140
00142 typedef typename TLevelSet::PixelType PixelType;
00143
00145 typedef
00146 LevelSetNode<PixelType, itkGetStaticConstMacro(SetDimension)> NodeType;
00147
00149 typedef VectorContainer<unsigned int,NodeType> NodeContainer;
00150
00152 typedef typename NodeContainer::Pointer NodeContainerPointer;
00153 };
00154
00155
00171 template <
00172 class TPixel,
00173 unsigned int VAuxDimension = 1,
00174 unsigned int VSetDimension = 2
00175 >
00176 class ITK_EXPORT AuxVarTypeDefault
00177 {
00178 public:
00180 typedef AuxVarTypeDefault Self;
00181
00183 typedef TPixel AuxValueType;
00184
00186 itkStaticConstMacro(AuxDimension, unsigned int, VAuxDimension);
00187
00189 itkStaticConstMacro(SetDimension, unsigned int, VSetDimension);
00190
00192 typedef Vector<TPixel,VAuxDimension> AuxValueVectorType;
00193
00195 typedef VectorContainer<unsigned int,AuxValueVectorType> AuxValueContainer;
00196
00198 typedef Image<AuxValueType, VSetDimension> AuxImageType;
00199
00201 typedef typename AuxImageType::Pointer AuxImagePointer;
00202 typedef typename AuxImageType::ConstPointer AuxImageConstPointer;
00203 };
00204
00205
00206 }
00207
00208 #endif