[Insight-users] Performance issues for single slices

Nils Hanssen hanssen at caesar . de
Fri, 20 Jun 2003 09:36:42 +0200


Hi Luis,


I am using Windows and all the measurements were done in 'release'.

When I use the GradientMagnitudeRecursiveGaussianImageFilter, it takes only
3 seconds now (with a sigma of 1.0f) for the 1984x1024 slice in 2
dimensions. That's fine.

The Sigmoid on the same slice takes about 19 seconds. Isn't that far too
slow? Maybe something is wrong with the pipeline?!


Regards,
Nils


> 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_1GradientMa
gnitudeRecursiveGaussianImageFilter.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_1TimeProbes
CollectorBase.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
>
>