[Insight-users] Reading DICOMs using Python wrapping

Bradley Lowekamp blowekamp at mail.nih.gov
Thu Jan 10 23:00:35 EST 2013


Hello Willi,

I am going to assume that you are talking about transferring an image between the SimpleITK in Python to WrapITK in Python.

There is currently no direct support for this. You would need to use numpy as an intermediate step. For this to be possible SimpleITK and WrapITK need to be compiled against the same ITK library, so that the ITK common library is shared between them. So this will never be able to work with binary distributed built SimpleITK distribution. However, the SimpleITK superbuild does have the option to built ITK with WrapITK enabled and ITK with shared libraries. This will gets us half way there. What is left to do is write the SWIG code to convert the ITK image embedded in SimpleITK image to WrapITK. 

Is has been a low priority because I don't anticipate many people wanting to compile all of WrapITK and SimpleITK. There is an issue in Jira for this task:

https://issues.itk.org/jira/browse/SIMPLEITK-131

If there are many people interested in combining these two please let me know by e-mail or simply voting on the Jira issue.

Brad

On Jan 10, 2013, at 10:33 AM, Willi Huber <surfersparadise85-itk at yahoo.com> wrote:

> Is there a way to transfer SimpleITK images to ITK and vice versa?
> 
> Von: Willi Huber <surfersparadise85-itk at yahoo.com>
> An: Bradley Lowekamp <blowekamp at mail.nih.gov> 
> CC: "insight-users at itk.org" <insight-users at itk.org> 
> Gesendet: 1:57 Donnerstag, 10.Januar 2013
> Betreff: Re: [Insight-users] Reading DICOMs using Python wrapping
> 
> Hello Brad,
> 
> thanks for your fast reply. Yeah I didn't think about having enabled all pixel types during compilation. Sorry.
> 
> I tried SimpleITK now with the drawback that I have to give a sorted list of files to the ImageSeriesReader. In other words I assume the volume is created as stack in the order of the files given.
> Unfortunately the public static functions GetGDCMSeriesIDs are not available in Python. Why is this?
> 
> Cheers,
> Willi 
> 
> Von: Bradley Lowekamp <blowekamp at mail.nih.gov>
> An: Willi Huber <surfersparadise85-itk at yahoo.com> 
> CC: "insight-users at itk.org" <insight-users at itk.org> 
> Gesendet: 13:58 Dienstag, 8.Januar 2013
> Betreff: Re: [Insight-users] Reading DICOMs using Python wrapping
> 
> Hello,
> 
> You need to recompile you WrapITK to support the pixel types you need.
> 
> While you are waiting for that you should try a built distribution of SimpleITK 0.6rc1!
> 
> SimpleITK is compiled for just about all pixel types.
> 
> The ImageSeriesReader has a couple methods the get the GDCM series files names that can be feed into the reader to read.
> 
> SimpleITK also has the GetArrayFromImage function which convert the SimpleITK image into a numpy array. It should be easy to convert that into a VTK image, just a little bit of attention is going to be needed to get the meta-data converted correctly. We really should create a utility library to aid in this type of conversion.
> 
> Brad
> 
> On Jan 7, 2013, at 11:58 PM, Willi Huber <surfersparadise85-itk at yahoo.com> wrote:
> 
>> Hello all,
>> 
>> I am using python(x,y) and I want to work on some dicom volumes in ITK and VTK.
>> 
>> My idea was to use ITK for reading the data and if necessary transfer them to VTK using the glue. My problem now is that itk only supports itk.UC and/or itk.US as datatype for reading in python wrapped ITK which is not sufficient.
>> Does it make sense to allow more datatypes for another users point of view. 
>> If not it would be nice if someone could give me a hint how to easily transfer raw data to ITK using GDCM.
>> 
>> Cheers,
>> Willi
>> _____________________________________
>> 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
> 
> 
> 
> 
> _____________________________________
> 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/20130110/725fad43/attachment.htm>


More information about the Insight-users mailing list