[Insight-users] SetImportPointer and python

Guimond, Alexandre alexandre.guimond at siemens.com
Wed Oct 25 04:38:32 EDT 2006


Hi. i'm starting to use itk using the python bindings. i'm running into
an error when using the ImportImageFilter and setting the image data.
>From vtk, i though that this could be a string and that i could use the
"tostring()" function of arrays, but that doesn't seem to be the case:
 
        iimport = itk.itkImportImageFilterF3_New()
        iimport.SetRegion( region )
        iimport.SetOrigin( origin )
        iimport.SetSpacing( spacing )
        iimport.SetImportPointer( self.data.tostring(), prod, True )
 
the error is:
 
    iimport.SetImportPointer( self.data.tostring(), prod, True )
  File "itkImportImageFilter.py", line 530, in SetImportPointer
TypeError: Type error. Got , expected _p_float
 
i'm not sure what data the SetImportPointer needs. I've tried to use the
SwigExtras.FArrayClass but i get the same problem there setting the data
in the frompointer function.
 
Does anybody have experience with this?  
 
thx for your help,
 
alex

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20061025/32c6073f/attachment.htm


More information about the Insight-users mailing list