[ITK] [ITK-users] VectorImage vs image of vectors

Bradley Lowekamp blowekamp at mail.nih.gov
Mon Nov 3 09:58:35 EST 2014


Hello,

What specific Gaussian filter are you running?

One common cause of an VectorImage algorithm being overly slow is that there is an over use of temporaries which require excessive memory allocation done on a per-pixel basis. Because the Image of Vectors is templated on the size of the vector, the pixel can be stored on the stack, and not required the allocation. With this considered many slow algorithms can fairly easily be improved by reusing temporaries, or writing a specilized method for the VectorImage.

Brad

On Nov 3, 2014, at 9:39 AM, Olivier Commowick <Olivier.Commowick at inria.fr> wrote:

> Hello all,
> 
> I encountered some weird behavior in ITK. For some reason, I have in my code some vector images that I need to smooth using a Gaussian filter. It appears that whether the image is stored as a VectorImage or an Image of itk Vectors is actually extremely important in terms of performance for this task. Namely, if using VectorImages, the processing time can be much worse (30s vs 1s with an image of vectors). My problem is that I cannot really use the templated itk::Image <itk::Vectors <Type, Size> , Ndim > since I do not know Size at compilation time.
> 
> Looking deeper into the code, I have two questions for whoever would know about these images: 
> - the first one is on the Variable length vector: it seems to me that the operator= method always starts by destroying current data, even if the vector size is the same. It doesn’t seem really efficient so I was wondering if there was any reason for that
> - the second one is on the VectorImage itself: is there something in it that would justify the computation times to be much worse ?
> 
> If someone has any info on which image type I should be using or why VectorImage would be slowGeer, I would be grateful.
> 
> Thanks in advance
> 
> ---
> 
> Olivier Commowick, Ph.D.
> Research Scientist
> INRIA Rennes - Bretagne Atlantique, VISAGES Team
> Campus de Beaulieu
> 35042 Rennes
> FRANCE
> 
> Phone: +33 2 99 84 25 92
> Email: Olivier.Commowick at inria.fr
> Web: http://olivier.commowick.org/
> 
> 
> 
> 
> 
> _____________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
> 
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/insight-users

_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users


More information about the Community mailing list