Importing large arrays from numpy inyo VTK does not work.
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
Importing large arrays from numpy into VTK does not work. This was already mentioned on the users list, and reproduced by David Gobbi.
Example 1:
from numpy import zeros import vtk
a = zeros(2**32 - 1).astype(uint8) #to create a massive array im = vtk.vtkImageImport() #believe this is the standard method to convert to vtk im.CopyImportVoidPointer(a.tostring(),a.size) #do conversion
throws the following error: Traceback (most recent call last): File "", line 1, in SystemError: error return without exception set
Example 2:
from vtk.util import numpy_support as vn import vtk import numpy
a = numpy.zeros(2**32-1, numpy.uint8) aV = vn.numpy_to_vtk(pp, deep=False)
The last line throws the error: Traceback (most recent call last): File "", line 1, in File "P:\vtk-5.6.1\x64\Wrapping\Python\vtk\util\numpy_support.py", line 165, in numpy_to_vtk result_array.SetVoidArray(z_flat, len(z_flat), 1) OverflowError: size does not fit in an int