[vtkusers] VTK Python using SWIG wrapped vtkImageData * was: Re: [Insight-users] Issue building ITK-4 with Module_ItkVtkGlue ON

Matt McCormick matt.mccormick at kitware.com
Wed Jan 11 17:38:16 EST 2012


Hi Félix,

I do not believe VTK uses SWIG for its wrapping.  Someone from the VTK
mailing list may have a pointer on where to go from here.

Thanks,
Matt

On Wed, Jan 11, 2012 at 5:33 PM, Félix C. Morency
<felix.morency at gmail.com> wrote:
> Hi Matt,
>
> I managed to build the ITKVtkGlue Python wrapper successfully hacking
> VtkGlue based on the ExternalProjects/VtkItkGlue in the source tree.
> The problem I now face is that the GetOutput() method of the
> ImageToVTKImageFilter class returns a pointer to vtkImageData. When I
> call the method from Python, the resulting object is
>
>  <Swig Object of type 'vtkImageData *' at 0x7fbdc8043e10>
>
> SetInput() methods from VTK require a vtkImageData as its parameter,
> not a swig object pointing to a vtkImageData. I guess I am missing
> some proxy class and/or type declaration somewhere. Since I know
> nothing about SWIG bindings and that I'm fairly new to the ITK
> architecture, could you please point me in the right direction on
> completing the ItkVtkGlue Python bindings for ITK-4? Is it the right
> approach?
>
> Thank you,
> -Félix
>
> On Wed, Jan 11, 2012 at 9:38 AM, Matt McCormick
> <matt.mccormick at kitware.com> wrote:
>> Hi Felix,
>>
>> I have not personally tried the ITKVtkGlue Python wrapping recently,
>> and it may need some testing.  Please post a fix to Gerrit for any
>> bugs you find.
>>
>> Thanks,
>> Matt
>>
>> On Wed, Jan 11, 2012 at 9:22 AM, Félix C. Morency
>> <felix.morency at gmail.com> wrote:
>>> Matt,
>>>
>>> ITK-4 seems to build fine with the latest VTK master and the
>>> ItkVtkGlue module. However, the Python wrapper for the ItkVtkGlue
>>> module doesn't seem to be generated. I started to investigate without
>>> any luck so far. The BUILD_WRAPPER variable in ItkVtkGlue CMakeLists
>>> is set to OFF but changing it to ON doesn't give the expected result.
>>> Do you have any idea on how to fix this issue?
>>>
>>> Thank,
>>> -Felix
>>>
>>> On Tue, Jan 10, 2012 at 11:19 AM, Matt McCormick
>>> <matt.mccormick at kitware.com> wrote:
>>>> Hi Felix,
>>>>
>>>> This is an issue with VTK.  Build VTK Git master, then set VTK_DIR to
>>>> point to the build.
>>>>
>>>> Hope this helps,
>>>> Matt
>>>>
>>>> On Tue, Jan 10, 2012 at 11:16 AM, Félix C. Morency
>>>> <felix.morency at gmail.com> wrote:
>>>>> Hi,
>>>>>
>>>>> I'm trying to build ITK-4 (cloned from Git, using tag v4.0.0) with the
>>>>> following options on Ubuntu 11.10 x86_64:
>>>>>
>>>>> https://gist.github.com/1589805
>>>>>
>>>>> Everything builds fine with make -j6. Unfortunately, the following
>>>>> error rise when I turn Module_ItkVtkGlue ON:
>>>>>
>>>>> https://gist.github.com/1589805
>>>>>
>>>>> Does anyone know how to fix this issue? I also tried with yesterday
>>>>> master branch without any luck. The problem also occurs when using
>>>>> make without the -j flag. I need the ItkVtkGlue module to be able to
>>>>> use the conversion filters (ImageToVTKImageFilter, etc).
>>>>>
>>>>> My co-worker also happens to have this issue under Windows 7 x86.
>>>>> _____________________________________
>>>>> Powered by www.kitware.com
>>>>>
>>>>> Visit other Kitware open-source projects at
>>>>> http://www.kitware.com/opensource/opensource.html
>>>>>
>>>>> Kitware offers ITK Training Courses, for more information visit:
>>>>> http://www.kitware.com/products/protraining.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



More information about the vtkusers mailing list