[Insight-users] about itk and python

Julien Lamy lamy at unistra.fr
Wed Jun 17 04:46:01 EDT 2009


Lic. José M. Rodriguez Bacallao a écrit :
> hi folks, I am new to vtk and itk and I begining to love all the
> goodies of itk, right now, I'm triying to develop a dicom viewer with
> itk, vtk and python (my preferred language) so, I have a couple of
> questions to make.
> 
> 1- How about the quality of wrappers (WrapITK vs standard)

After trying the three available wrappers (CSwig, WrapITK shipped with 
ITK, and WrapITK from Google Code), I would definitely go with WrapITK, 
preferably the Google Code version : they are much closer to Python than 
the CSwig wrappers, and exploits more features of Python (have a look at 
the Google Code page for some examples).

> 2- How about memory consumption and load times of the wrappers.

They have become fast : WrapITK is definitely an improvement over CSwig, 
and the latest version of WrapITK takes this one step further. As to 
memory usage, I haven't done any kind of benchmark.

> 3- I need to read several DICOM files, from various modalities, how do
> I read all of them if I need to now the image type first, for example:
> 
> import itk
> image_type = itk.Image[itk.SS, 2]
> file_name = 'IM66,dcm' #this is a CT image
> reader = itk.ImageFileReader[image_type].New()
> reader.SetFileName( file_name )
> reader.Update()
> 
> what if I need to read a RGB dicom image?

I haven't tried this, but you might take a look at the DICOM examples 
from the ITK software guide (section 7.12.5) : create a DICOM image IO, 
get the metadata, and, based on those metadata, create your reader with 
the correct image type.

-- 
Julien


More information about the Insight-users mailing list