[vtk-developers] [VTK 0012730]: Importing large arrays from numpy inyo VTK does not work.

Mantis Bug Tracker mantis at public.kitware.com
Wed Nov 16 06:18:13 EST 2011


The following issue has been SUBMITTED. 
====================================================================== 
http://www.vtk.org/Bug/view.php?id=12730 
====================================================================== 
Reported By:                Bryn Lloyd
Assigned To:                
====================================================================== 
Project:                    VTK
Issue ID:                   12730
Category:                   (No Category)
Reproducibility:            have not tried
Severity:                   minor
Priority:                   normal
Status:                     backlog
Project:                    TBD 
Type:                       incorrect functionality 
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             2011-11-16 06:18 EST
Last Modified:              2011-11-16 06:18 EST
====================================================================== 
Summary:                    Importing large arrays from numpy inyo VTK does not
work.
Description: 
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 "<stdin>", line 1, in <module>
  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 "<stdin>", line 1, in <module>
  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


====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-11-16 06:18 Bryn Lloyd     New Issue                                    
======================================================================




More information about the vtk-developers mailing list