[Insight-users] about itk and python

Gaëtan Lehmann gaetan.lehmann at jouy.inra.fr
Tue Jun 16 17:31:45 EDT 2009


Le 16 juin 09 à 22:39, Lic. José M. Rodriguez Bacallao a écrit :

> hi folks,

Hi,

Disclaimer: as an ITK and WrapITK developer, the content of this mail  
may not be absolutely fair :o)

> I am new to vtk and itk and I begining to love all the
> goodies of itk

Welcome to ITK! ITK is one of the best (if not the best) tool for  
image analysis.

> , right now, I'm triying to develop a dicom viewer with
> itk, vtk and python

I think there are a couple of dicom viewers around. Have you looked at  
them?
It's often a better idea to reuse the code available…

> (my preferred language) so, I have a couple of
> questions to make.
>
> 1- How about the quality of wrappers (WrapITK vs standard)

That's worth than that: you have the choice between 3 methods:
* CSwig: the first one. It doesn't provide as much classes as the  
others, but is usable even with quite old configuration and compilers
* WrapITK stable, which comes with ITK. That's a rework of CSwig to  
provide a more consistent set of template instantiations, many more  
classes, and a better integration with python - see http://www.insight-journal.org/browse/publication/85
* WrapITK unstable, hosted at googlecode. Faster, cleaner, better  
integration with python and java, nearly no method not usable in itk  
objects, but not as well tested as the others. I'm fixing the last  
bugs on windows to make a release. See http://code.google.com/p/wrapitk/wiki/Release030

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

With lazy loading, WrapITK (both stable and unstable versions) is able  
to load the modules on demand, so "import itk" is very fast.
WrapITK unstable provide way smaller binaries than the stable version,  
so it loads a lot faster.

With CSwig, "import InsightToolkit" loads everything, so it's quite  
long. However, if your program needs a lot of classes in different  
modules, CSwig may be faster than WrapITK (because it provides less  
classes).

On memory usage, in the worst case (everything is loaded), WrapITK  
stable is the worst one for sure. I'm not sure how CSwig and WrapITK  
unstable compare.

> 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'm not used to using dicom, so I don't know how you can know what  
would be the best type for your images. I hope someone else will be  
able to help.
However, once you'll have found that, it is quite easy to change the  
type used with python - you only have to change the "image_type" in  
the code above. It can be done without any problem at runtime

>
> PS: sorry for my english, it's not so good.

It seems to be good enough for a french native speaker ;-)

Regards,

Gaëtan

>
> -- 
> Lic. José M. Rodriguez Bacallao
> Centro de Biofisica Medica
> -----------------------------------------------------------------
> Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos  
> lo mismo.
>
> Recuerda: El arca de Noe fue construida por aficionados, el titanic
> por profesionales
> -----------------------------------------------------------------
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> 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

-- 
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
http://voxel.jouy.inra.fr  http://www.itk.org
http://www.mandriva.org  http://www.bepo.fr

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 203 bytes
Desc: Ceci est une signature ?lectronique PGP
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090616/2dc1ce46/attachment-0001.pgp>


More information about the Insight-users mailing list