00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkAnisotropicDiffusionFunction_h_
00018 #define __itkAnisotropicDiffusionFunction_h_
00019
00020
00021 #include "itkFiniteDifferenceFunction.h"
00022
00023 namespace itk {
00024
00134 template <class TImage>
00135 class ITK_EXPORT AnisotropicDiffusionFunction :
00136 public FiniteDifferenceFunction<TImage>
00137 {
00138 public:
00139
00141 typedef AnisotropicDiffusionFunction Self;
00142 typedef FiniteDifferenceFunction<TImage> Superclass;
00143 typedef SmartPointer<Self> Pointer;
00144 typedef SmartPointer<const Self> ConstPointer;
00145
00147 itkTypeMacro( AnisotropicDiffusionFunction, FiniteDifferenceFunction );
00148
00150 typedef typename Superclass::ImageType ImageType;
00151 typedef typename Superclass::PixelType PixelType;
00152 typedef typename Superclass::PixelRealType PixelrealType;
00153 typedef typename Superclass::RadiusType RadiusType;
00154 typedef typename Superclass::NeighborhoodType NeighborhoodType;
00155 typedef typename Superclass::TimeStepType TimeStepType;
00156 typedef typename Superclass::FloatOffsetType FloatOffsetType;
00157
00159 itkStaticConstMacro(ImageDimension, unsigned int,Superclass::ImageDimension);
00160
00166 virtual void CalculateAverageGradientMagnitudeSquared(ImageType *) = 0;
00167
00171 void SetTimeStep(const TimeStepType &t)
00172 { m_TimeStep = t; }
00173 const TimeStepType &GetTimeStep() const
00174 { return m_TimeStep; }
00176
00178 void SetConductanceParameter(const double &c)
00179 { m_ConductanceParameter = c; }
00180 const double &GetConductanceParameter() const
00181 { return m_ConductanceParameter; }
00183
00185 const double &GetAverageGradientMagnitudeSquared() const
00186 { return m_AverageGradientMagnitudeSquared; }
00187 void SetAverageGradientMagnitudeSquared(const double &c)
00188 { m_AverageGradientMagnitudeSquared = c; }
00190
00193 virtual TimeStepType ComputeGlobalTimeStep(void *itkNotUsed(GlobalData)) const
00194 { return this->GetTimeStep(); }
00195
00198 virtual void *GetGlobalDataPointer() const
00199 { return 0; }
00200
00202 virtual void ReleaseGlobalDataPointer(void *itkNotUsed(GlobalData)) const
00203 { }
00204
00205 protected:
00206 AnisotropicDiffusionFunction()
00207 {
00208 m_AverageGradientMagnitudeSquared = 0.0;
00209 m_ConductanceParameter = 1.0;
00210 m_TimeStep = 0.125f;
00211 }
00212 ~AnisotropicDiffusionFunction() {}
00213
00214 void PrintSelf(std::ostream& os, Indent indent) const
00215 {
00216 Superclass::PrintSelf(os,indent);
00217 os << indent << "TimeStep: " << m_TimeStep << std::endl;
00218 os << indent << "ConductanceParameter: " << m_ConductanceParameter <<
00219 std::endl;
00220 }
00221
00222 private:
00223 AnisotropicDiffusionFunction(const Self&);
00224 void operator=(const Self&);
00225
00226 double m_AverageGradientMagnitudeSquared;
00227 double m_ConductanceParameter;
00228 TimeStepType m_TimeStep;
00229 };
00230
00231 }
00232
00233 #endif
00234