Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkLevelSet.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkLevelSet.h,v $
00005   Language:  C++
00006   Date:      $Date: 2006/02/06 22:01:56 $
00007   Version:   $Revision: 1.6 $
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 __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:
00047 
00049   typedef LevelSetNode Self;
00050 
00052   typedef TPixel PixelType;
00053 
00055   itkStaticConstMacro(SetDimension, unsigned int, VSetDimension);
00056 
00058   typedef Index<VSetDimension> IndexType;
00059 
00061   bool operator> ( const Self& node ) const
00062     { return m_Value > node.m_Value; }
00063 
00065   bool operator< ( const Self& node ) const
00066     { return m_Value < node.m_Value; }
00067 
00069   bool operator<= ( const Self& node ) const
00070     { return m_Value <= node.m_Value; }
00071 
00073   bool operator>= ( const Self& node ) const
00074     { return m_Value >= node.m_Value; }
00075 
00078   Self& operator= ( const Self& rhs )
00079     {
00080       if( this == &rhs ) {return *this;}
00081 
00082       m_Value = rhs.m_Value;
00083       m_Index = rhs.m_Index;
00084       return *this;
00085     }
00086 
00088   PixelType& GetValue()
00089     { return m_Value; };
00090   const PixelType& GetValue() const
00091     { return m_Value; };
00092   void SetValue( const PixelType& input )
00093     { m_Value = input; };
00095 
00097   IndexType& GetIndex()
00098     { return m_Index; }
00099   const IndexType& GetIndex() const
00100     { return m_Index; }
00101   void SetIndex( const IndexType& input )
00102     { m_Index = input; };
00104 
00106   LevelSetNode() : m_Value( NumericTraits<PixelType>::Zero ) {
00107     m_Index.Fill( 0 );
00108     };
00110 
00112   LevelSetNode(const Self &node) : m_Value( node.m_Value ), m_Index( node.m_Index ) {};
00113 
00114 private:
00115   PixelType       m_Value;
00116   IndexType       m_Index;
00117   
00118 };
00119 
00133 template<class TLevelSet>
00134 class ITK_EXPORT LevelSetTypeDefault
00135 {
00136  public:
00138   typedef LevelSetTypeDefault Self;
00139   typedef TLevelSet LevelSetImageType;
00140 
00141   
00143   itkStaticConstMacro(SetDimension, unsigned int, TLevelSet::ImageDimension);
00144 
00146   typedef typename TLevelSet::Pointer LevelSetPointer;
00147   typedef typename TLevelSet::ConstPointer LevelSetConstPointer;
00148 
00150   typedef typename TLevelSet::PixelType PixelType;
00151 
00153   typedef
00154       LevelSetNode<PixelType, itkGetStaticConstMacro(SetDimension)> NodeType;
00155 
00157   typedef VectorContainer<unsigned int,NodeType> NodeContainer;
00158 
00160   typedef typename NodeContainer::Pointer NodeContainerPointer;
00161 };
00162 
00163 
00179 template < 
00180 class TPixel,
00181 unsigned int VAuxDimension = 1,
00182 unsigned int VSetDimension = 2
00183 >
00184 class ITK_EXPORT AuxVarTypeDefault
00185 {
00186  public:
00188   typedef AuxVarTypeDefault Self;
00189 
00191   typedef TPixel AuxValueType;
00192 
00194   itkStaticConstMacro(AuxDimension, unsigned int, VAuxDimension);
00195 
00197   itkStaticConstMacro(SetDimension, unsigned int, VSetDimension);
00198 
00200   typedef Vector<TPixel,VAuxDimension> AuxValueVectorType;
00201 
00203   typedef VectorContainer<unsigned int,AuxValueVectorType> AuxValueContainer;
00204 
00206   typedef Image<AuxValueType, VSetDimension> AuxImageType;
00207 
00209   typedef typename AuxImageType::Pointer AuxImagePointer;
00210   typedef typename AuxImageType::ConstPointer AuxImageConstPointer;
00211 };
00212 
00213 
00214 } // end namespace itk
00215 
00216 #endif
00217 

Generated at Wed Nov 5 22:38:57 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000