[vtkusers] Importing Numarray object with vtkImageImport

Mathieu Malaterre Mathieu.Malaterre at creatis.insa-lyon.fr
Thu Jun 26 04:55:25 EDT 2003


Bruno,

	Please go into:

  VTK / Wrapping / Python / vtk / util

And look for vtkImageImportFromArray.py

HTH
mathieu

Bruno wrote:
> Hi,
> 
> I'm trying to import a Numarray object passing it direct do
> vtkImageImport
> it is like:
> 
> import numarray
> a = numarray.array([...], 'type')
> i = vtkImageImport()
> ...
> i.CopyImportVoidPointer(a, size)
> 
> TypeError: argument 1 must be string or read-only buffer, not NumArray
> 
> I knowm that's possible to do it with Numeric python(and it was
> mentioned
> in this list as the 'Numeric trick' some months ago), but when I try
> with Numarray, that what happens. But if I do:
> 
> i.CopyImportVoidPointer(a._data, size)
> 
> it works!!! How can I do to direct pass the numarray object, whithout
> messing whith the protected methods (a._data)??? Do I have to change the
> 
> numarray implementation or the vtkImageImport.cxx class??
> 
> thank's...
> 
> Bruno Sousa Martin
> Centro de Pesquisas Renato Archer
> Campinas - Sao Paulo - Brasil
> 
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 


-- 
Mathieu Malaterre
CREATIS
28 Avenue du Doyen LEPINE
B.P. Lyon-Montchat
69394 Lyon Cedex 03
http://www.creatis.insa-lyon.fr/~malaterre/




More information about the vtkusers mailing list