[vtkusers] vtkImageExportToArray.py Bug

toon Huysmans denhuys at hotmail.com
Fri Oct 6 17:59:52 EDT 2006


Hi Luis,

I think there is a bug in 
VTK/Wrapping/Python/vtk/util/vtkImageExportToArray.py: it does not work for 
images which have a datatype length different from 1 byte.

The changed lines are marked with #####:

def GetArray(self):
       ...
        if (numComponents > 1):
            dim = dim + (numComponents,)
        size = dim[0]*dim[1]*dim[2]*numComponents  #####

        if _NEW_NUMERIC:
            imArray = Numeric.zeros((size,),self.__typeDict[type])  #####
            self.__export.Export(imArray)
       ...

the problem was that an imArray was located always of the type 
Numeric.UnsignedInt8!

Regards,

Toon Huysmans.





More information about the vtkusers mailing list