New classes: vtkImageImport, vtkImageExport

David Gobbi dgobbi at irus.rri.on.ca
Mon Jul 12 16:21:13 EDT 1999


This is a question primarily for the Kitware folks.

I have two imaging classes to donate, but I'm not sure whether 
they belong in vtk/imaging or vtk/contrib.  They provide standard
mechanisms for transferring images between either C++ arrays 
or Python arrays and the VTK imaging pipeline.

class vtkImageImport:
  GetOutput()                   -- connect to VTK pipeline
  SetImportVoidPointer(void *)  -- set a C pointer or python string
  (other methods similar to vtkImageReader)

class vtkImageExport:
  SetInput(vtkImageCache *)       -- connect to VTK imaging pipeline
  SetInput(vtkStructuredPoints *) -- connect to VTK graphics pipeline
  GetExportMemorySize()           -- get amount of memory image requires
  SetExportVoidPointer(void *)    -- C pointer / python string to write to
  Export()                        -- execute pipeline and export image
  (other methods similar to vtkImageWriter)

Writing images back and forth between python and VTK is very useful,
particularly because python libraries such as PIL and Python-Magick
support a wide range of image formats.  

 - David

--David Gobbi, MSc                    dgobbi at irus.rri.on.ca
  Advanced Imaging Research Group
  Robarts Research Institute, University of Western Ontario



-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------





More information about the vtkusers mailing list