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 } 00093 00098 virtual void ReleaseGlobalDataPointer(void *GlobalData) const 00099 { delete (GlobalDataStruct *) GlobalData; } 00100 00102 void SetTimeStep( const TimeStepType & t ) 00103 { m_TimeStep = t; } 00104 00106 const TimeStepType &GetTimeStep() const 00107 { return m_TimeStep; } 00108 00111 virtual PixelType ComputeUpdate(const NeighborhoodType &neighborhood, 00112 void * globalData, 00113 const FloatOffsetType& offset = FloatOffsetType(0.0) 00114 ); 00115 00116 protected: 00117 00120 00121 struct GlobalDataStruct 00122 { 00123 GlobalDataStruct() 00124 { 00125 m_MaxChange = NumericTraits<ScalarValueType>::Zero; 00126 } 00127 ~GlobalDataStruct() {} 00128 00129 ScalarValueType m_MaxChange; 00130 }; 00132 00133 CurvatureFlowFunction(); 00134 ~CurvatureFlowFunction() {} 00135 00136 private: 00137 CurvatureFlowFunction(const Self&); //purposely not implemented 00138 void operator=(const Self&); //purposely not implemented 00139 00140 TimeStepType m_TimeStep; 00141 00142 00143 }; 00144 00145 }// end namespace itk 00146 00147 #ifndef ITK_MANUAL_INSTANTIATION 00148 #include "itkCurvatureFlowFunction.txx" 00149 #endif 00150 00151 #endif