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

itkLevelSetNode.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkLevelSetNode.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-02-05 19:05:00 $
00007   Version:   $Revision: 1.3 $
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 __itkLevelSetNode_h
00018 #define __itkLevelSetNode_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     {
00108     m_Index.Fill( 0 );
00109     }
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 
00120 } // end namespace itk
00121 
00122 #endif
00123 

Generated at Tue Sep 15 03:51:09 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000