[Insight-users] Custom ITK class wrapping

Zachary Pincus zpincus at stanford.edu
Sun Dec 4 16:33:55 EST 2005


Gatean -

Thanks for posting this information. Your approach looks very  
intriguing. If I might ask a couple of questions:

First, could you provide a little information about how your wrappers  
work and how they differ from the ITK model? I can vaguely follow  
what's going on in the ITK code, but I'm not at all sure how things  
work with the codebase you've pointed me to.

Second, is this work slated for inclusion in ITK at any point? All  
other things being equal, I tend to prefer using toolchains that I  
know will continue to be supported. (But of course, not all other  
things are equal...) Failing that, are these wrappers known to work  
on OS X?

Third, could you explain what "the dynamic type selection with the  
new itk python module" does? It seems like it could be useful.

Finally, do you know if this wrapping method works with the "numeric  
python" interface that I've heard rumors of -- allowing easy  
conversion of ITK images into Numeric Python arrays? I don't know a  
whole lot about this, but it is something that I think I'll need to  
get working.

Thanks for your time -- and for the work on this alternate wrapping  
strategy.

Zach



On Dec 4, 2005, at 3:31 AM, Gaetan Lehmann wrote:

>
> Hi,
>
> Benoit Regrain and I have done some work on itk wrappers which  
> should make
> what you want to do easier.
> The work is available at
> http://voxel.jouy.inra.fr/darcs/itk-mima2/Insight/Wrapping/CSwig/  
> for the itk
> wrapping, and at http://voxel.jouy.inra.fr/darcs/itkvtk/ for an  
> example of
> external classes wrapping (the itk-vtk image filters).
>
> I think it can make things easier for several reasons:
> + there is a lots more classes wrapped
> + you can remove some classes (to decrease the bin size) just by  
> removing the
> corresponding wrap_?.cmake files.
> + you can select types you want to wrap, and so decrease the size  
> of the
> binary
> + you can wrap some custom classes
>
> you may also find some very nice features like the dynamic type  
> selection with
> the new itk python module
>
> I hope you will find it useful, and will contribute some new  
> wrappers :-)
> All feedbacks are also welcome
>
> Regards,
>
> Gaetan
>
> On Sunday 04 December 2005 11:41, Zachary Pincus wrote:
>> Hi folks -
>>
>> Sorry to send this to both the users and developers list, but I'm
>> hoping to get some advice on relatively deep ITK magic, so I'm not
>> sure where best to ask.
>>
>> My basic question is if anyone can give me any advice, tips, or
>> warnings about creating a custom python wrapping library for ITK.
>>
>> The basics of my problem are twofold:
>> (1) I wish to wrap some custom C++ classes I've written
>> (2) I've never managed to get the default python wrapper library to
>> work on OS X, due to some sort of loader issues with huge libraries.
>> (Perhaps this is fixed in the newest ITK releases, or under OS X
>> 10.4? I haven't tried in a while.)
>>
>> At any rate, I'd like to wrap a narrow subset of ITK and my custom
>> code into a (relatively) small python wrapper library. I know this
>> isn't a "supported" procedure, and a lot of very confusing stuff is
>> going on to get CMake, cswig, gccxml, and the rest to all cooperate
>> and make things work. If anyone could give me a rundown of the basic
>> issues involved here, and where I should start, I would be pretty
>> grateful.
>>
>> I've read through some of the contents of $ITK_ROOT/Wrapping, and it
>> by and large makes sense -- but any details or hard-won insight into
>> how to make this work in my own project would be really appreciated.
>>
>> Thanks,
>>
>> Zach
>> _______________________________________________
>> Insight-developers mailing list
>> Insight-developers at itk.org
>> http://www.itk.org/mailman/listinfo/insight-developers
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users



More information about the Insight-users mailing list