[vtk-developers] VTK-Python: Numeric Array <-> ImageData.

Prabhu Ramachandran prabhu at aero.iitm.ernet.in
Mon Dec 9 15:07:19 EST 2002


Hi folks,

Quick update.

>>>>> "DG" == David Gobbi <dgobbi at imaging.robarts.ca> writes:

    DG> 1) Since vtkConstants.py contains the same constants of
    DG> vtkSystemIncluces.h, maybe the vtk/__init__.py should do a
    DG> "from vtk.util.vtkConstants import *" so that people
    DG> automatically have access to these constants (just like they
    DG> do in C++)

Done.

    DG> 2) There are a whole bunch of missing calls to
    DG> 'UpdateInformation' in vtkImageExportToArray (these were also
    DG> missing in the original code) before calls to GetWholeExtent()
    DG> etc.

AFAIK there was only one required and I've added it.  Very likely I
goofed though. :(

    DG> 3) Testing on multiple files doesn't make the test more
[snip]
    DG>    At minimum the tests should include: 1 test on unsigned
    DG> char greyscale, 1 test on short greyscale, 1 test on unsigned
    DG> char color

Status quo.

    DG> It would also be nifty if it checked for Numeric versions
    DG> greater than 20 and did the direct array->void* trick that
    DG> Berk mentioned instead of wasting memory by converting to a
    DG> string first.

Done!  I check to see if the version is > 20.0 and if so use the
trick.  If not it defaults to old behaviour.

Please check it out and let me know if there are problems or
enhancements.  I'll announce the availability of this code on vtkusers
sometime later.

cheers,
prabhu



More information about the vtk-developers mailing list