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::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&);
00142 void operator=(const Self&);
00143
00144 TimeStepType m_TimeStep;
00145
00146
00147 };
00148
00149 }
00150
00151 #ifndef ITK_MANUAL_INSTANTIATION
00152 #include "itkCurvatureFlowFunction.txx"
00153 #endif
00154
00155 #endif
00156