[Insight-users] EllipseSpatialObject, GroupSpatialObject & SpatialObjectToImageFilter performance

Dan Mueller dan.muel at gmail.com
Tue Nov 9 10:17:16 EST 2010


Hi Sergio,

SpatialObjectToImageFilter is known to be slow. This is because it
steps over the image and asks each and every spatial object whether or
not it overlaps the current pixel.

Consider using an approach which rather than stepping over the image,
steps over the objects. itkGenerateMaskImageFilter (part of
ManagedITK) does exactly this and *may* improve performance:
    http://code.google.com/p/manageditk/source/browse/trunk/Source/Modules/IntensityFilters/itkGenerateMaskImageFilter.h
    http://code.google.com/p/manageditk/source/browse/trunk/Source/Modules/IntensityFilters/itkGenerateMaskImageFilter.txx

HTH

Cheers, Dan

On 9 November 2010 13:12, Sergio Vera <sergio.vera at alma3d.com> wrote:
> Hello There,
>
> I'm generating an image with a sphere at a specific point using
> EllipseSpatialObject for the sphere, GroupSpatialObject to put the sphere in
> a desired place in the image and SpatialObjectToImageFilter to generate the
> sphere image (in fact is a mask image).
> However, even if the image is not too big, the execution speed of the
> pipeline is really really slow.
> The image that we generate is 256x256x136 with spacing 0.7,0.7,0.8 and the
> sphere generated has about 27 pixels of radius.
> In debug version, the generation of the sphere costs 1700 segs, and release
> versions 220 seconds. Certaninly, too much time to just generate a mask
> image of a spheical region.
> Does anybody had experienced such times with the generagion of spheres? What
> I'm doing wrong...
> Is there any other (fastest) way to generate an spherical / elliptical mask
> image?
> Regards & Thanks
>
> --
> Sergio Vera
>
>  Alma IT Systems
>  C/ Vilana, 4B, 4º 1ª
>  08022 Barcelona
>  T. (+34) 932 380 592
>  www.alma3d.com
>
> _____________________________________
> 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.html
>
> 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://www.itk.org/mailman/listinfo/insight-users
>
>


More information about the Insight-users mailing list