[ITK-users] Creating 3D dome using ITK
Francois Budin
francois.budin at kitware.com
Thu May 11 14:01:15 EDT 2017
Hello Sidharta,
I agree. The easiest way for you to get the image you want is to generate
it with a spacing of 1, and then change the spacing directly on the
generated image:
my_image->SetSpacing(my_new_spacing);
If you want your ellipse to have the same scale (covers the same number of
pixels) in your image that has spacing=1 and in your image that has spacing
Y, you need to set the transform to:
transform->Scale(spacing[0])
Hope this helps,
Francois
On Thu, May 11, 2017 at 8:58 AM, sidharta <sidharta.gupta93 at gmail.com>
wrote:
> Dear Francois,
>
> Thank you for your reply.
>
> Is it also possible to change the spacing explicitly in the final image? As
> in using "SpatialObjectToImageFilter" I get the ellipse in an image with
> spacing and after that I change the spacing to what I want from 1.
>
> <http://itk-users.7.n7.nabble.com/file/n38227/dome.png>
>
> Because I tried that and I get the desired image with the correct spacing
> but then the program crashes.
>
> P.S. To my understanding (correct me if I am wrong), if initially the
> spacing is 1.0 and everything works, I should scale the ellipse by setting
> "transform->Scale(1 / spacing[0])", where spacing[0] is the desired
> spacing.
> Then, I would also have to change the translation vectors accordingly
> (which
> I am still trying to figure out so that the image size is exactly what I
> want it to be).
>
>
> Thank you for your time.
> Sidharta
>
>
>
> --
> View this message in context: http://itk-users.7.n7.nabble.
> com/Creating-3D-dome-using-ITK-tp38201p38227.html
> Sent from the ITK - Users mailing list archive at Nabble.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.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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20170511/98bde239/attachment.html>
More information about the Insight-users
mailing list