00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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&);
00140 void operator=(const Self&);
00141
00142 TimeStepType m_TimeStep;
00143
00144
00145 };
00146
00147 }
00148
00149 #ifndef ITK_MANUAL_INSTANTIATION
00150 #include "itkCurvatureFlowFunction.txx"
00151 #endif
00152
00153 #endif
00154