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:
00140 typedef AnisotropicDiffusionFunction Self;
00141 typedef FiniteDifferenceFunction<TImage> Superclass;
00142 typedef SmartPointer<Self> Pointer;
00143 typedef SmartPointer<const Self> ConstPointer;
00144
00146 itkTypeMacro( AnisotropicDiffusionFunction, FiniteDifferenceFunction );
00147
00149 typedef typename Superclass::ImageType ImageType;
00150 typedef typename Superclass::PixelType PixelType;
00151 typedef typename Superclass::RadiusType RadiusType;
00152 typedef typename Superclass::NeighborhoodType NeighborhoodType;
00153 typedef typename Superclass::TimeStepType TimeStepType;
00154 typedef typename Superclass::FloatOffsetType FloatOffsetType;
00155
00157 itkStaticConstMacro(ImageDimension, unsigned int,Superclass::ImageDimension);
00158
00164 virtual void CalculateAverageGradientMagnitudeSquared(ImageType *) = 0;
00165
00169 void SetTimeStep(const TimeStepType &t)
00170 { m_TimeStep = t; }
00171 const TimeStepType &GetTimeStep() const
00172 { return m_TimeStep; }
00173
00175 void SetConductanceParameter(const double &c)
00176 { m_ConductanceParameter = c; }
00177 const double &GetConductanceParameter() const
00178 { return m_ConductanceParameter; }
00179
00181 const double &GetAverageGradientMagnitudeSquared() const
00182 { return m_AverageGradientMagnitudeSquared; }
00183 void SetAverageGradientMagnitudeSquared(const double &c)
00184 { m_AverageGradientMagnitudeSquared = c; }
00185
00188 virtual TimeStepType ComputeGlobalTimeStep(void *itkNotUsed(GlobalData)) const
00189 { return this->GetTimeStep(); }
00190
00193 virtual void *GetGlobalDataPointer() const
00194 { return 0; }
00195
00197 virtual void ReleaseGlobalDataPointer(void *itkNotUsed(GlobalData)) const
00198 { }
00199
00200 protected:
00201 AnisotropicDiffusionFunction()
00202 {
00203 m_AverageGradientMagnitudeSquared = 0.0;
00204 m_ConductanceParameter = 1.0;
00205 m_TimeStep = 0.125f;
00206 }
00207 ~AnisotropicDiffusionFunction() {}
00208
00209 void PrintSelf(std::ostream& os, Indent indent) const
00210 {
00211 Superclass::PrintSelf(os,indent);
00212 os << indent << "TimeStep: " << m_TimeStep << std::endl;
00213 os << indent << "ConductanceParameter: " << m_ConductanceParameter <<
00214 std::endl;
00215 }
00216
00217 private:
00218 AnisotropicDiffusionFunction(const Self&);
00219 void operator=(const Self&);
00220
00221 double m_AverageGradientMagnitudeSquared;
00222 double m_ConductanceParameter;
00223 TimeStepType m_TimeStep;
00224 };
00225
00226 }
00227
00228 #endif