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: 2005/10/31 22:13:46 $
00007   Version:   $Revision: 1.19 $
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::NeighborhoodType NeighborhoodType;
00064   typedef typename Superclass::FloatOffsetType FloatOffsetType;
00065   typedef typename Superclass::TimeStepType TimeStepType;
00066 
00068   itkStaticConstMacro(ImageDimension, unsigned int,Superclass::ImageDimension);
00069 
00080   virtual TimeStepType ComputeGlobalTimeStep(void *GlobalData) const;
00081 
00087   virtual void *GetGlobalDataPointer() const
00088   {  
00089     GlobalDataStruct *ans = new GlobalDataStruct();
00090     ans->m_MaxChange   = NumericTraits<ScalarValueType>::Zero;
00091     return ans; 
00092   }
00094 
00099   virtual void ReleaseGlobalDataPointer(void *GlobalData) const
00100   { delete (GlobalDataStruct *) GlobalData; }
00101 
00103   void SetTimeStep( const TimeStepType & t )
00104   { m_TimeStep = t; }
00105 
00107   const TimeStepType &GetTimeStep() const
00108   { return m_TimeStep; }
00109 
00112   virtual PixelType ComputeUpdate(const NeighborhoodType &neighborhood,
00113                                   void * globalData,
00114                                   const FloatOffsetType& offset = FloatOffsetType(0.0)
00115     );
00116 
00117 protected:
00118 
00121 
00122   struct GlobalDataStruct
00123   {
00124     GlobalDataStruct()
00125     {
00126       m_MaxChange = NumericTraits<ScalarValueType>::Zero;
00127     }
00128     ~GlobalDataStruct() {}
00130 
00131     ScalarValueType m_MaxChange;
00132   };
00134 
00135   CurvatureFlowFunction();
00136   ~CurvatureFlowFunction() {}
00137 
00138 private:
00139   CurvatureFlowFunction(const Self&); //purposely not implemented
00140   void operator=(const Self&); //purposely not implemented
00141 
00142   TimeStepType       m_TimeStep;
00143   
00144   
00145 };
00146 
00147 }// end namespace itk
00148 
00149 #ifndef ITK_MANUAL_INSTANTIATION
00150 #include "itkCurvatureFlowFunction.txx"
00151 #endif
00152 
00153 #endif
00154 

Generated at Sun Sep 23 12:18:58 2007 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000