[Insight-users] ITK image to Numpy matrix and viceversa

Bradley Lowekamp blowekamp at mail.nih.gov
Tue Jan 29 09:20:28 EST 2013


Hello Paolo,

I have used the the following external module for get numpy support for WrapITK:

https://github.com/tobiasmaier/itkPyBuffer


From the root ITK source dir just clone the repo into the Modules/External directory:

git clone git://github.com/tobiasmaier/itkPyBuffer.git Modules/External/

Rerun ccmake, and turn on this module. And recompile.


While you are waiting you can check to see if SimpleITK has the functionality you need.
I'd like to point out that SimpleITK has built in support for numpy, and has binary eggs available for download. 
http://www.itk.org/Wiki/ITK/Release_4/SimpleITK

Brad

On Jan 29, 2013, at 8:46 AM, Paolo Zaffino <p.zaffino at yahoo.it> wrote:

> Dear ITK community,
> 
> I compiled ITK 4.3.1 with the Python support and all went fine.
> I am able to run ITK functions from Python, but I'm also interested in converting an ITK image into a Numpy matrix and viceversa.
> How can I do this?
> 
> Thank you very much.
> Regards.
> Paolo
> _____________________________________
> 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://www.itk.org/mailman/listinfo/insight-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130129/fcda4e9d/attachment.htm>


More information about the Insight-users mailing list