[Insight-users] Performance issues for single slices

Luis Ibanez luis . ibanez at kitware . com
Wed, 18 Jun 2003 12:01:56 -0400


Hi Nils,

29 seconds for this image size seems to be pretty slow.
You can certainly get better timing.

Note that the GradientMagnitude filters applies the
equivalent of convolution.  Depending on the sigma
value, you may get better performance with the filter:

    GradientMagnitudeRecursiveGaussianImageFilter.

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

The RecursiveGaussian is better when using large sigma values.

----

Also, make sure that you compile your code for 'release'
(are your using Windows ? or Unix ?). On Unix you can select
this from CMake. On Window you simply select the build
configuration from VisualStudio IDE.

-----

ITK filters should only be profiled in 'release' since
in debug they are not taking advantage of the possibilities
for inlining templated code.

----

BTW for profiling code, ITK offers the convenience classes

itk::TimeProbe and itk::TimeProbesCollector

http://www . itk . org/Insight/Doxygen/html/classitk_1_1TimeProbe . html
http://www . itk . org/Insight/Doxygen/html/classitk_1_1TimeProbesCollectorBase . html

They make very easy the task of computing time consumed
by a block of lines of code. Time is reported in 'seconds'.



Regards,


    Luis


----------------------
Nils Hanssen wrote:
> Hi Luis,
> 
> thanks for the detailed answer. Sounds very plausible :)
> 
> I changed the pipeline to use 2D-images and the calculation time for the
> gradient magnitude reduced to 29 sec (before: 39 sec) for the 1984x1024
> float image.
> 
> Is that the typical computation time for images of that size?
> 
> 
> Regards,
> Nils
> 
>