[ITK] [ITK-users] SimpleITK: Pass Image from C++ to Python

Bradley Lowekamp blowekamp at mail.nih.gov
Thu Aug 6 10:37:29 EDT 2015


Hello Klaus,

Sorry for the very delayed response.

I would like to know more about your application requirements.

I have implemented an initial prorotype of a public method in the _SimpleITK Python library which allows conversions from the SWIG PyObject to the SimpleITK Image class. This should allow pulling Image objects created in Python SimpleITK  into a C++ application. A similar method can be created to go the other way too.

I believe this is the interface you need, and just wanted to verify your requirements.

Here is the proof of concept branch:
https://github.com/blowekamp/SimpleITK/commits/AddCXXConvertInterfaceToPythonLibrary


HTH,
Brad


On Jun 27, 2015, at 9:24 AM, Klaus <drechsler at gmx.net> wrote:

> Hi,
> 
> I have a C++ application which I use to do all major image processing
> stuff, UI and so on.  I embedded python as scripting language to quickly
> test new ideas. Currently I am using temporary files and pass file paths
> back and forth as a quick and dirty solution to pass images from one
> language to the other.  However, I would like to directly pass a sitk
> (or itk) image from c++ as parameter to a python method/function call.
> 
> Is there a straight forward (and efficient) way to achieve this?
> 
> Thank you!
> 
> Klaus
> _____________________________________
> 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

_____________________________________
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