Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkAnisotropicDiffusionFunction.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkAnisotropicDiffusionFunction.h,v $
00005   Language:  C++
00006   Date:      $Date: 2004/02/20 22:51:00 $
00007   Version:   $Revision: 1.17 $
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 __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   { /* do nothing */ }
00203 
00204 protected:
00205   AnisotropicDiffusionFunction()
00206   {
00207     m_AverageGradientMagnitudeSquared = 0.0;
00208     m_ConductanceParameter     = 1.0;     // default value
00209     m_TimeStep                 = 0.125f;  // default value
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&); //purposely not implemented
00223   void operator=(const Self&); //purposely not implemented
00224 
00225   double m_AverageGradientMagnitudeSquared;
00226   double m_ConductanceParameter;
00227   TimeStepType    m_TimeStep;
00228 };
00229 
00230 }// end namespace itk
00231 
00232 #endif
00233 

Generated at Sun Sep 23 11:50:09 2007 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000