VTK internal error messages

Randall Hopper aa8vb at ipass.net
Sun Apr 30 15:38:16 EDT 2000


David Gobbi:
 |Randall Hopper:
 |> Is there a better way to bulk-load floating-point data into VTK from a
 |> scripting language (without having to loop through every grid cell)?
 |
 |Unfortunately no.  The SetVoidArray() method is meant specifically for
 |moving large chunks of data into VTK.  For image data (including
 |structured points) you can use the vtkImageImport() class, or even
 |the vtkImageImportFromArray.py pseudo-class that is in vtk/python.

Unfortunately this isn't part of an imaging pipeline, so SetVoidArray still
sounds like my best option (possibly wrapped into a separate class).

 |For python, in particular, I think that it's best if you hide
 |any code that uses SetVoidArray() in helper classes like
 |vtkImageImportFromArray.py.  You also have to be very careful
 |with the .tostring() method... what guarantees to you have that
 |Python won't garbage-collect the string before VTK is done with it?

I saw the caveat about that in the archives.  So I keep the tostring() data
attached to a data object.  It's a pain, but the best I could do with the
available methods... (iterating over all cells isn't really an option).

Rather than cooking a new object for every import case, it seems like what
we really need is a LoadVoidArray() method that "copies" the data into VTK
(unlike SetVoidArray) and puts it under a VTK reference count.  The client
can then dispose of their data block.

With this, VTK can still remain out-of-the-loop of all the machinizations
users need to go through to coerce data into VTK format, and at the same
time still allow users to bulk load data into VTK.

Thanks,

Randall

-- 
Randall Hopper
aa8vb at ipass.net
--------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at public.kitware.com>. For help, send message body containing
"info vtkusers" to the same address.
--------------------------------------------------------------------



More information about the vtkusers mailing list