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: 2003/09/10 14:29:14 $
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 _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   const PixelType& GetValue() const
00090     { return m_Value; };
00091   void SetValue( const PixelType& input )
00092     { m_Value = input; };
00093 
00095   IndexType& GetIndex()
00096     { return m_Index; }
00097   const IndexType& GetIndex() const
00098     { return m_Index; }
00099   void SetIndex( const IndexType& input )
00100     { m_Index = input; };
00101 
00103   LevelSetNode() : m_Value( NumericTraits<PixelType>::Zero ) {
00104     m_Index.Fill( 0 );
00105     };
00106 
00108   LevelSetNode(const Self &node) : m_Value( node.m_Value ), m_Index( node.m_Index ) {};
00109   
00110 private:
00111   PixelType       m_Value;
00112   IndexType       m_Index;
00113   
00114 };
00115 
00129 template<class TLevelSet>
00130 class ITK_EXPORT LevelSetTypeDefault
00131 {
00132  public:
00134   typedef LevelSetTypeDefault Self;
00135   typedef TLevelSet LevelSetImageType;
00136   
00137   
00139   itkStaticConstMacro(SetDimension, unsigned int, TLevelSet::ImageDimension);
00140 
00142   typedef typename TLevelSet::Pointer LevelSetPointer;
00143   typedef typename TLevelSet::ConstPointer LevelSetConstPointer;
00144 
00146   typedef typename TLevelSet::PixelType PixelType;
00147   
00149   typedef
00150       LevelSetNode<PixelType, itkGetStaticConstMacro(SetDimension)> NodeType;
00151 
00153   typedef VectorContainer<unsigned int,NodeType> NodeContainer;
00154 
00156   typedef typename NodeContainer::Pointer NodeContainerPointer;
00157 };
00158 
00159 
00175 template < 
00176 class TPixel,
00177 unsigned int VAuxDimension = 1,
00178 unsigned int VSetDimension = 2
00179 >
00180 class ITK_EXPORT AuxVarTypeDefault
00181 {
00182  public:
00184   typedef AuxVarTypeDefault Self;
00185   
00187   typedef TPixel AuxValueType;
00188 
00190   itkStaticConstMacro(AuxDimension, unsigned int, VAuxDimension);
00191 
00193   itkStaticConstMacro(SetDimension, unsigned int, VSetDimension);
00194 
00196   typedef Vector<TPixel,VAuxDimension> AuxValueVectorType;
00197 
00199   typedef VectorContainer<unsigned int,AuxValueVectorType> AuxValueContainer;
00200 
00202   typedef Image<AuxValueType, VSetDimension> AuxImageType;
00203 
00205   typedef typename AuxImageType::Pointer AuxImagePointer;
00206   typedef typename AuxImageType::ConstPointer AuxImageConstPointer;
00207 };
00208 
00209 
00210 } // namespace itk
00211 
00212 #endif

Generated at Wed May 24 23:33:54 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000