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

Luis Ibanez luis.ibanez at kitware.com
Sun Aug 15 11:18:11 EDT 2004


Hi Bing,


You missed the itkDenseFiniteDifferenceImageFilter class
in the hierarchy of the itkAnisotropicDiffusionImageFilter.

http://www.itk.org/Insight/Doxygen/html/classitk_1_1DenseFiniteDifferenceImageFilter.html

This class implements the CalculateChange() method.


If you look at the .h header file of the itkAnisotropic
DiffusionImageFilter or consult its Doxygen documentation

http://www.itk.org/Insight/Doxygen/html/classitk_1_1AnisotropicDiffusionImageFilter.html


You will notice that the hierarchy is:


     itkFiniteDifferenceImageFilter
                   |
                   |
   itkDenseFiniteDifferenceImageFilter
                   |
                   |
    itkAnisotropicDiffusionImageFilter





   Regards,



      Luis



---------------------------
Bing Jian wrote:

> 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!
> 






More information about the Insight-users mailing list