[ITK-users] [ITK] Imagebase:: A spacing of 0 is not allowed.

Nicolas Gallego nicgallego at gmail.com
Mon Jun 16 06:30:07 EDT 2014


Hello Ajjwal,

It seams that you are trying to shrink you image by a rational factor
(floating point value 0.3), but the itk::ShrinkImageFilter is intendend to
shrink by integer factors.
So I guess some rounding to zero is happening in between.

If you need factor like 0.3 you should use probably the
Itk::ResampleImageFilter, and make sure to compute the output information
(size, spacing, origin and direction) yourself.

I hope it helps

Nicolás Gallego-Ortiz
Université catholique de Louvain, Belgium


2014-06-14 15:42 GMT+02:00 UJJWAL aryan <meetukme at gmail.com>:

> Hi,
>
> I am attaching a small snippet of a code I was writing. However on running
> the code I get the following error :
>
> terminate called after throwing an instance of 'itk::ExceptionObject'
>   what():  /usr/local/include/ITK-4.5/itkImageBase.hxx:184:
> itk::ERROR: Image(0x189eab0): A spacing of 0 is not allowed: Spacing is
> [0, 0]
> Aborted (core dumped)
>
> Could someone please point out what am I missing here ?
>
> --
> Ujjwal
> IIIT Hyderabad
> Mob - 8142265628
> ujjwal at research.iiit.ac.in
>
>
>
> _____________________________________
> 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
>
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/mailman/listinfo/community
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20140616/54d5d64a/attachment.html>


More information about the Insight-users mailing list