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: 2002/09/11 19:57:13 $
00007   Version:   $Revision: 1.3 $
00008 
00009   Copyright (c) 2002 Insight 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   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 } // namespace itk
00207 
00208 #endif

Generated at Fri May 21 01:15:00 2004 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000