[Insight-users] itk typemaps again !
Gaetan Lehmann
gaetan.lehmann at jouy.inra.fr
Thu Jul 28 08:43:16 EDT 2005
Hi Brad,
I'm again with typemaps in ITK (with a little more experience than last
time).
I have wrapped ImageToVTKImageFilter and VTKImageToImageFilter and have
sucessfully define typemaps for vtkImageExport and vtkImageData
(http://voxel.jouy.inra.fr/darcs/itkvtk/).
Now I try to do a little more: I want to add typemaps for
std::vector<...>. It's very simple with swig and works well
(http://www.swig.org/Doc1.3/Library.html):
%include "std_vector.i"
%template(DoubleVector) std::vector<double>;
is enough to wrap vector<double>. But I can't make it work with ITK.
The class DoubleVector is defined, so I can say the %template directive
does something. However, the type of object returned by an itk method is
different of type of DoubleVector.
DoubleVector -> _p_std__vectorTdouble_t
itk method -> _p_std__vectorTdouble_std__allocatorTdouble_t_t
In a pure SWIG program, this is not the case. All are of type
_p_std__vectorTdouble_std__allocatorTdouble_t_t.
Do you know if that difference of type can explain why typemap don't work ?
And do you know why we have this difference of type with cableswig and not
with swig alone ?
Regards,
Gaetan
--
Gaetan Lehmann <gaetan.lehmann at jouy.inra.fr>
Tel: +33 1 34 65 29 66
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
Web: http://voxel.jouy.inra.fr
More information about the Insight-users
mailing list