>>>>> "Andrea" == Andrea Gavana <[EMAIL PROTECTED]> writes:

    Andrea> Hi all, sorry if this is the wrong forum to post, but I
    Andrea> know that Prabu has done a lot of work in developing this
    Andrea> part of tvtk. I am trying to use the array2vtk and
    Andrea> vtk2array functions in array_handler. They actually use
    Andrea> some misterious (for me) "empty_array" variable, imported
    Andrea> from array_ext.  Ok, my problem is that I have Python 2.5,

empty_array is identical to numpy.empty.  That functionality did not
exist in earlier versions of Numeric so it was created in
array_ext*.*.

    Andrea> numpy (no more Numeric), VTK nightly build, and I have no
    Andrea> idea on where to get array_ext.pyd for Python 2.5. The
    Andrea> main problem is that I don't know what "empty_array" is so
    Andrea> I am stuck in searching for that array_ext.pyd extension.
    Andrea> Is there a way avoid importing array_ext and doing the
    Andrea> same thing directly in Python? If this is not the case,
    Andrea> does anyone know where to get that module (for Python

empty_array is not the only function in array_ext*.  The other one is
a function that converts a numpy array to a format suitable for a
vtkIdTypeArray.  These are defined in tvtk/src/array_ext_sp.pyx (sp
stands for scipy since this predates the numpy name).  So you can use
the source and see what is being done.  If you have no need for the id
type array stuff you can easily modify array_handler to use numpy's
empty and it should work.

    Andrea> 2.5)? Is there any other solution to fastly convert a VTK
    Andrea> array to a numpy array and vice-versa?

Easiest way is to use tvtk since it works and is tested.

prabhu


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
MayaVi-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mayavi-users

Reply via email to