[vtkusers] Extract Data from vtkImageReslice to numpy array

Peter Bloomfield peter.bloomfield at camhpet.ca
Tue Jun 30 09:54:39 EDT 2009


Hello,

I am new to VTK, so if this has been asked before I apologise.

I am trying to use VTK from within Python. I successfully downloaded and 
compiled VTK V5.4.2 including the python wrappings/bindings, and issuing 
'import vtk' from within python works good.

Initially I want to do is take a volume of data (float), re-slice it in an 
arbitrary orientation and then extract the re-sliced plane from vtk and return 
it to a numpy array.

I am using vtk.vtkImageReslice(), but do not know how to get the data out from 
here.

Does anyone have any suggestions of how I can achieve this? I have tried 
looking at vtkImageExportToArray but have no idea how to use this from within 
python. 

Many thanks


Peter



More information about the vtkusers mailing list