[ITK-users] SimpleITK not saving Origin when creating new images?

Matias Montroull matimontg at gmail.com
Wed Mar 8 18:13:26 EST 2017


Thank you, I will try the mha format. I need the individual dcm though. I'm
not sure if SimpleITK has a method to extract the dcm files from the mha
and keep the origin of each file once I save it?

El mié., 8 de mar. de 2017 a la(s) 16:27, Francois Budin <
francois.budin at kitware.com> escribió:

> 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
>
>
> --
Matias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20170308/d0c0cc34/attachment.html>


More information about the Insight-users mailing list