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::RadiusType RadiusType;
00153 typedef typename Superclass::NeighborhoodType NeighborhoodType;
00154 typedef typename Superclass::TimeStepType TimeStepType;
00155 typedef typename Superclass::FloatOffsetType FloatOffsetType;
00156
00158 itkStaticConstMacro(ImageDimension, unsigned int,Superclass::ImageDimension);
00159
00165 virtual void CalculateAverageGradientMagnitudeSquared(ImageType *) = 0;
00166
00170 void SetTimeStep(const TimeStepType &t)
00171 { m_TimeStep = t; }
00172 const TimeStepType &GetTimeStep() const
00173 { return m_TimeStep; }
00175
00177 void SetConductanceParameter(const double &c)
00178 { m_ConductanceParameter = c; }
00179 const double &GetConductanceParameter() const
00180 { return m_ConductanceParameter; }
00182
00184 const double &GetAverageGradientMagnitudeSquared() const
00185 { return m_AverageGradientMagnitudeSquared; }
00186 void SetAverageGradientMagnitudeSquared(const double &c)
00187 { m_AverageGradientMagnitudeSquared = c; }
00189
00192 virtual TimeStepType ComputeGlobalTimeStep(void *itkNotUsed(GlobalData)) const
00193 { return this->GetTimeStep(); }
00194
00197 virtual void *GetGlobalDataPointer() const
00198 { return 0; }
00199
00201 virtual void ReleaseGlobalDataPointer(void *itkNotUsed(GlobalData)) const
00202 { }
00203
00204 protected:
00205 AnisotropicDiffusionFunction()
00206 {
00207 m_AverageGradientMagnitudeSquared = 0.0;
00208 m_ConductanceParameter = 1.0;
00209 m_TimeStep = 0.125f;
00210 }
00211 ~AnisotropicDiffusionFunction() {}
00212
00213 void PrintSelf(std::ostream& os, Indent indent) const
00214 {
00215 Superclass::PrintSelf(os,indent);
00216 os << indent << "TimeStep: " << m_TimeStep << std::endl;
00217 os << indent << "ConductanceParameter: " << m_ConductanceParameter <<
00218 std::endl;
00219 }
00220
00221 private:
00222 AnisotropicDiffusionFunction(const Self&);
00223 void operator=(const Self&);
00224
00225 double m_AverageGradientMagnitudeSquared;
00226 double m_ConductanceParameter;
00227 TimeStepType m_TimeStep;
00228 };
00229
00230 }
00231
00232 #endif
00233