[Insight-developers] Re: [Insight-users] Problem with ConnectVTKITK

Brad King brad.king at kitware.com
Wed, 18 Feb 2004 17:58:34 -0500


Charl P. Botha wrote:
> Rodrigo Trujillo wrote:
> 
>> Traceback (most recent call last):
>>   File "C:\Documents and 
>> Settings\ailton\Desktop\Testes\RecursiveGaussian.py", line 46, in ?
>>     vtkitk.ConnectVTKToITKF3(vtkExporter, itkImporter.GetPointer())
>> TypeError: Type error. Expected 
>> _p_itk__VTKImageImportTitk__ImageTfloat_3_t_vtkFloatingPointType_t
> 
> 
> Durnit!  I can reproduce this error with the 
> CannyEdgeDetectionImageFilterConnectVTKITK.py example and recent ITK and 
> VTK CVS.  Swig is actually mangling the vtkFloatingType as part of its 
> text representation... the fact that the type is available during 
> building is not sufficient.
> 
> My current thoughts are to make vtkSystemIncludes.h available to swig 
> during the .i -> .cxx parsing so that vtkFloatingPointType is correctly 
> interpreted as either float or double.  Any other ideas on this?
> 
> As far as I can sniff, Swig should handle the typedef correctly and 
> mangle it as 'float' or 'double'.  *crosses fingers*

I've committed changes to itk::VTKImageImport and itk::VTKImageExport 
that remove the second template argument altogether while still 
providing compatibility for both versions of VTK.  This issue is now 
completely hidden from the wrapping, and the ConnectVTKITK.h code gets 
much simpler again.

This solves the problem, so I've placed the changes on both the ITK 1.6 
branch and the main tree.  The fix should be included when ITK 1.6.1 is 
released.

-Brad