00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkLevelSetFunction_h_
00018 #define __itkLevelSetFunction_h_
00019
00020 #include "itkLevelSetFunctionBase.h"
00021
00022 namespace itk {
00023
00062 template <class TImageType>
00063 class ITK_EXPORT LevelSetFunction
00064 : public LevelSetFunctionBase<TImageType>
00065 {
00066 public:
00068 typedef LevelSetFunction Self;
00069 typedef LevelSetFunctionBase<TImageType> Superclass;
00070 typedef SmartPointer<Self> Pointer;
00071 typedef SmartPointer<const Self> ConstPointer;
00072
00074 itkNewMacro(Self);
00075
00077 itkTypeMacro( LevelSetFunction, LevelSetFunctionBase );
00078
00080 typedef typename Superclass::ImageType ImageType;
00081
00083 itkStaticConstMacro(ImageDimension, unsigned int,Superclass::ImageDimension);
00084
00086 typedef typename Superclass::PixelType PixelType;
00087 typedef typename Superclass::TimeStepType TimeStepType;
00088 typedef typename Superclass::ScalarValueType ScalarValueType;
00089 typedef typename Superclass::RadiusType RadiusType;
00090 typedef typename Superclass::NeighborhoodType NeighborhoodType;
00091 typedef typename Superclass::VectorType VectorType;
00092 typedef typename Superclass::FloatOffsetType FloatOffsetType;
00093
00095 virtual PixelType ComputeUpdate(const NeighborhoodType &neighborhood,
00096 void *globalData,
00097 const FloatOffsetType& = FloatOffsetType(0.0)) const;
00098
00105 virtual TimeStepType ComputeGlobalTimeStep(void *GlobalData) const;
00106
00112 virtual void *GetGlobalDataPointer() const
00113 {
00114 GlobalDataStruct *ans = new GlobalDataStruct();
00115 ans->m_MaxAdvectionChange = NumericTraits<ScalarValueType>::Zero;
00116 ans->m_MaxPropagationChange = NumericTraits<ScalarValueType>::Zero;
00117 return ans;
00118 }
00119
00123 virtual void Initialize(const RadiusType &r);
00124
00129 virtual void ReleaseGlobalDataPointer(void *GlobalData) const
00130 { delete (GlobalDataStruct *) GlobalData; }
00131
00132 protected:
00135 struct GlobalDataStruct
00136 {
00137 ScalarValueType m_MaxAdvectionChange;
00138 ScalarValueType m_MaxPropagationChange;
00139 };
00140
00141 LevelSetFunction() {}
00142 ~LevelSetFunction() {}
00143 void PrintSelf(std::ostream& os, Indent indent) const
00144 {
00145 Superclass::PrintSelf(os, indent );
00146 os << indent << "WaveDT: " << m_WaveDT << std::endl;
00147 os << indent << "DT: " << m_DT << std::endl;
00148 }
00149
00151 static double m_WaveDT;
00152 static double m_DT;
00153
00154 private:
00155 LevelSetFunction(const Self&);
00156 void operator=(const Self&);
00157
00159 std::slice x_slice[ImageDimension];
00160
00162 ::size_t m_Center;
00163
00165 ::size_t m_xStride[ImageDimension];
00166 };
00167
00168 }
00169
00170 #ifndef ITK_MANUAL_INSTANTIATION
00171 #include "itkLevelSetFunction.txx"
00172 #endif
00173
00174 #endif
00175