[ITK] [ITK-users] ITK PyBuffer get physical point coordinates

Lowekamp, Bradley (NIH/NLM/LHC) [C] blowekamp at mail.nih.gov
Thu Apr 27 17:16:17 EDT 2017


Hi!

You can generate an image of the physical locations of each pixel with the PhysicalPointImageSource filter:
https://itk.org/Doxygen/html/classitk_1_1PhysicalPointImageSource.html

Very recently added is the SetReferenceImage, which can be use to copy the meta data from one image to the parameters of this filter. If your version is not super recent then you can manually set the Size, Spacing, Origin, Direction and StartIndex.

After you generate the point image you should be able to convert to with the same method.

HTH,
Brad


On Apr 27, 2017, at 4:58 PM, D'Isidoro Fabio <fisidoro at ethz.ch<mailto:fisidoro at ethz.ch>> wrote:

Hallo,

I know it’s possible to get a numpy array of an itk image with:

itk.PyBuffer[ImageType].GetArrayFromImage(Image)

Is it by any chance also possible to obtain a (flattended) numpy array of the physical coordinates of the image pixels too?

Thank you!

_____________________________________
Powered by www.kitware.com<http://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<mailto:Community at itk.org>
http://public.kitware.com/mailman/listinfo/community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20170427/be5e7fb8/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