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

itkCurvatureFlowFunction.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkCurvatureFlowFunction.h,v $
00005   Language:  C++
00006   Date:      $Date: 2008-10-23 16:15:23 $
00007   Version:   $Revision: 1.21 $
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 __itkCurvatureFlowFunction_h
00018 #define __itkCurvatureFlowFunction_h
00019 
00020 #include "itkFiniteDifferenceFunction.h"
00021 #include "itkMacro.h"
00022 
00023 namespace itk {
00024 
00040 template <class TImage>
00041 class ITK_EXPORT CurvatureFlowFunction :
00042     public FiniteDifferenceFunction<TImage>
00043 {
00044 public:
00046   typedef CurvatureFlowFunction            Self;
00047   typedef FiniteDifferenceFunction<TImage> Superclass;
00048   typedef SmartPointer<Self>               Pointer;
00049   typedef SmartPointer<const Self>         ConstPointer;
00050 
00052   itkNewMacro(Self);
00053 
00055   itkTypeMacro( CurvatureFlowFunction,
00056                 FiniteDifferenceFunction );
00057 
00059   typedef typename Superclass::ImageType              ImageType;
00060   typedef typename Superclass::PixelType              PixelType;
00061   typedef typename Superclass::RadiusType             RadiusType;
00062   typedef PixelType                                   ScalarValueType;
00063   typedef typename Superclass::PixelRealType          PixelRealType;
00064   typedef typename Superclass::NeighborhoodType       NeighborhoodType;
00065   typedef typename Superclass::NeighborhoodScalesType NeighborhoodScalesType;
00066   typedef typename Superclass::FloatOffsetType        FloatOffsetType;
00067   typedef typename Superclass::TimeStepType           TimeStepType;
00068 
00070   itkStaticConstMacro(ImageDimension, unsigned int,Superclass::ImageDimension);
00071 
00082   virtual TimeStepType ComputeGlobalTimeStep(void *GlobalData) const;
00083 
00089   virtual void *GetGlobalDataPointer() const
00090     {  
00091     GlobalDataStruct *ans = new GlobalDataStruct();
00092     ans->m_MaxChange   = NumericTraits<ScalarValueType>::Zero;
00093     return ans; 
00094     }
00096 
00101   virtual void ReleaseGlobalDataPointer(void *GlobalData) const
00102     { delete (GlobalDataStruct *) GlobalData; }
00103 
00105   void SetTimeStep( const TimeStepType & t )
00106     { m_TimeStep = t; }
00107 
00109   const TimeStepType &GetTimeStep() const
00110     { return m_TimeStep; }
00111 
00114   virtual PixelType ComputeUpdate(const NeighborhoodType &neighborhood,
00115                                   void * globalData,
00116                                   const FloatOffsetType& offset = FloatOffsetType(0.0)
00117     );
00118 
00119 protected:
00120 
00123 
00124   struct GlobalDataStruct
00125     {
00126     GlobalDataStruct()
00127       {
00128       m_MaxChange = NumericTraits<ScalarValueType>::Zero;
00129       }
00130     ~GlobalDataStruct() {}
00132 
00133     ScalarValueType m_MaxChange;
00134     };
00136 
00137   CurvatureFlowFunction();
00138   ~CurvatureFlowFunction() {}
00139 
00140 private:
00141   CurvatureFlowFunction(const Self&); //purposely not implemented
00142   void operator=(const Self&); //purposely not implemented
00143 
00144   TimeStepType       m_TimeStep;
00145   
00146   
00147 };
00148 
00149 }// end namespace itk
00150 
00151 #ifndef ITK_MANUAL_INSTANTIATION
00152 #include "itkCurvatureFlowFunction.txx"
00153 #endif
00154 
00155 #endif
00156 

Generated at Thu May 28 09:45:20 2009 for ITK by doxygen 1.5.5 written by Dimitri van Heesch, © 1997-2000