[Insight-users] Implementations of CalculateChange() and ApplyUpdate()

Bing Jian bjian at cise.ufl.edu
Sun Aug 15 01:01:56 EDT 2004


Hi, there,

   I am reading the source code of AnisotropicDiffusionImageFilter
but feel very confused on one thing.

   In the GenerateData() of its superclass FiniteDifferenceImageFilter,
I see following code in itkFiniteDifferenceImageFilter.txx:
     ...
     dt = this->CalculateChange();
    this->ApplyUpdate(dt);
     ...

and the definitions of CalculateChange() and ApplyUpdate() in
itkFiniteDifferenceImageFilter.h

  /** This method is defined by a subclass to apply changes to the
output
   * from an update buffer and a time step value "dt".
   * \param dt Time step value. */
  virtual void ApplyUpdate(TimeStepType dt) = 0;

  /** This method is defined by a subclass to populate an update
buffer
   * with changes for the pixels in the output.  It returns a time
   * step value to be used for the update.
   * \returns A time step to use in updating the output with the
changes
   * calculated from this method. */
  virtual TimeStepType CalculateChange() = 0;


 Obviously, these two member functions are declared here as pure
virtual functions and are supposed to be implemented in a subclass.
But I feel surprised because I can not find the corresponding
implementations in all of its children AnisotropicDiffusionImageFilter,
GradientAnisotropic and CurvatureAnisotropic. So strange!

Also from online documentation for FiniteDifferenceImageFilter,
http://www.itk.org/Doxygen14/html/classitk_1_1FiniteDifferenceImageFilter.html#b4

  template<class TInputImage, class TOutputImage>
virtual void itk::FiniteDifferenceImageFilter< TInputImage,
TOutputImage >::ApplyUpdate 	(  	TimeStepType  	dt 	 )
[protected, pure virtual]


This method is defined by a subclass to apply changes to the output
from an update buffer and a time step value "dt".

Parameters:
    	dt 	Time step value.

Implemented in itk::ParallelSparseFieldLevelSetImageFilter<
TInputImage, TOutputImage >, itk::SparseFieldLevelSetImageFilter<
TInputImage, TOutputImage >, itk::FiniteDifferenceSparseImageFilter<
TInputImageType, TSparseOutputImageType >,
itk::SparseFieldLevelSetImageFilter< TInputImage, Image<
TOutputPixelType,::itk::GetImageDimension< TInputImage
>::ImageDimension > >, and itk::FiniteDifferenceSparseImageFilter<
TInputImage, TSparseOutputImage >.


No AnisotropicDiffusionFilter appears in above list. That makes me
really confused. Am I missing something?

Many thanks in advance!

-- 
Best wishes,
Bing Jian
bjian at cise.ufl.edu




More information about the Insight-users mailing list