[ITK] [ITK-users] SimpleITK not saving Origin when creating new images?
Francois Budin
francois.budin at kitware.com
Wed Mar 8 14:27:08 EST 2017
Hello Matias,
There are currently some limitations with what ITK can write in DICOM
images. If you do not need to save a DICOM, you could save your image in a
different format such at Nifti (.nii.gz), Meta (.mha), or NRRD (.nrrd), and
the new origin will be saved.
Hope this helps,
Francois
On Tue, Mar 7, 2017 at 8:34 PM, Matias Montroull <matimontg at gmail.com>
wrote:
> Hi,
>
> I have this simple code that creates blank images and I set the origin to
> 256 256, however, the resulting image doesn't seem to have the Origin set
> to what I specify, or at least I don't see it in the image tags..
>
> for (int i = 0; i < 160; i++)
> {
> itk.simple.Image image = new itk.simple.Image(512, 512,
> itk.simple.PixelIDValueEnum.sitkInt16);
> image.SetOrigin(new VectorDouble(new Double[]
> {256,256,0}));
>
> itk.simple.ImageFileWriter writer_usuario = new
> ImageFileWriter();
> writer_usuario.SetFileName("C:/temp/" + i + ".dcm");
> writer_usuario.Execute(image);
> }
>
> any clue?
>
> Thanks,
> …
> --
> Matias
>
> _____________________________________
> 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/community/attachments/20170308/558094e7/attachment-0001.html>
-------------- next part --------------
_____________________________________
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