[Insight-users] WrapITK Pointers in C++

Gaëtan Lehmann gaetan.lehmann at jouy.inra.fr
Tue Jul 24 06:04:48 EDT 2007


Hi Marcel,

Le 24 juil. 07 à 11:56, Marcel Luethi a écrit :

> Hi,
>
> I am using WrapITK for most of the simpler ITK tasks.
> First, thanks a lot for this wonderful contribution. It really makes
> working with ITK very enjoyable.
>

Thanks a lot for the positive report :-)

> I frequently encounter the problem that I have to loop over all the
> voxels of an image and apply an itk function (e.g. image.SetPixel 
> (...))
> to every voxel. Calling a wrapped function seems to be very expensive.
> That is why I would like to write the code (i.e. the corresponding for
> loops) in C++, using e.g. scipy.weave.
>
> For VTK, type converters for weave exist (weave.converters.vtk_spec)
> that makes this task trivial and elegant.
> I would like to do something similar for itk. However, I am struggling
> with type conversion. Can anybody tell me how the itk classes are
> represented in Python? It seems that they are not simple SWIG  
> Pointers.
> How would I access a WrapITK objects from c++? Has anybody already  
> tried
> to do something similar?

WrapITK has an external projec called PyBuffer which can be used to  
convert itk images to numarray arrays.
Would it be ok for you?

Gaëtan

--
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



-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: =?ISO-8859-1?Q?Ceci_est_une_signature_=E9lectronique_PGP?=
Url : http://public.kitware.com/pipermail/insight-users/attachments/20070724/2a6f3e34/PGP.pgp


More information about the Insight-users mailing list