[Insight-users] Type error in CannyEdgeDetectionImageFilterConnectVTKITK.py

Wilbur C. K. Wong wilburckwong at gmail.com
Wed Jan 23 03:04:29 EST 2008


Dear all,

Python binding of ITK and VTK is new to me.  I want to use python
script to connect ITK with VTK.  From the mailing list archive, I
learnt that there is an example script named
CannyEdgeDetectionImageFilterConnectVTKITK.py that demonstrate how the
connection can be done.  Therefore, I execute the following command:

python CannyEdgeDetectionImageFilterConnectVTKITK.py
Traceback (most recent call last):
  File "CannyEdgeDetectionImageFilterConnectVTKITK.py", line 42, in <module>
    CVIPy.ConnectVTKToITKF2(vtkExporter, itkImporter.GetPointer())
TypeError: Type error. Got
_p_itk__VTKImageImportTitk__ImageTfloat_2u_t_t, expected
_p_itk__VTKImageImportTitk__ImageTfloat_2_t_t

FYI, I build ITK, VTK, CableSwig on my Linux machine with cmake
version 2.5-20080111 and Python 2.5.1.  To my understanding, there is
a type mismatch, _p_itk__VTKImageImportTitk__ImageTfloat_2u_t_t vs
_p_itk__VTKImageImportTitk__ImageTfloat_2_t_t.  The only difference in
the typename is that there is a "u" after "...float_2" in the former
type.

Please advice how can I solve the type mismatch problem.

Best regards,
Wilbur


More information about the Insight-users mailing list