[vtkusers] [KWWidgets] How do I write a TCL-wrappable C++ function that will take an ITK image as an argument?

kent williams nkwmailinglists at gmail.com
Fri Jun 26 12:25:45 EDT 2009


Yeah I know that VTK wrapping is very specific and tailored to the
needs of the VTK library.  It's also not a feature that is
well-documented anywhere. Whenever I google 'vtk wrapping' my own
questions about how VTK wrapping works are prominent in the search
results, not any actual documentation, and looking in VTK/Wrapping
doesn't give me much insight either.

The question is simply how WOULD one go about passing ITK Images back
and forth between TCL and C++. If VTK Wrapping isn't the answer, then
I'll look elsewhere.


On Fri, Jun 26, 2009 at 11:07 AM, Sebastien
BARRE<sebastien.barre at kitware.com> wrote:
> At 6/26/2009 11:56 AM, kent williams wrote:
>
>> What I'd like to know is what the method would be to directly accept
>> an ITK image as a parameter to a VTK-wrapped class method.
>
> Long story short Kent, unless I missed some VTK wrapping development in VTK,
> no, it can not wrap ITK parameters, sorry. The VTK Tcl wrappers are
> generated by a parser in VTK that handles a very specific syntax based on
> macros in vtkSetGet.h; It has no knowledge of ITK. The ITK Tcl wrappers (if
> they still exist) are very different, mostly to handle templated C++, if I
> recall.
>
>> I'm suspecting it will end up being something as dreadful as this:
>>
>> void SetImage(void *Image)
>> {
>
> You can not pass an arbitrary pointer either, I don't think it will be
> wrapped.
> "Everything is a string in Tcl".  You could pass the address of the pointer
> as a string, and do your own hacking there to find the corresponding ITK
> objects, but I wouldn't advise that...
>
> Now I'm not sure why your back and forth is costly. At the end of the day,
> the image should be stored the same way, so you don't even need to
> copy/transfer the data around, you could devise a class that just wraps and
> unwraps around that pointer. Isn't that what vtkITKImage does?
>
>



More information about the vtkusers mailing list