Hi Prabhu,
I have stumped into another problem... in one of my functions, I call:
cells = array2vtkCellArray(ids)
This, in turn, calls the method set_id_type_array, which obviously
doesn't exist anywhere except in a pyrex (?) compiled extension for
tvtk. I am not a C/C++ guru, and it is not very clear to me what this
function does. Is this really the only way to deal with numpy+VTK? I
know tvtk is tested on it and can do everything, but what I basically
only need is array_handler module methods, nothing more.
I'll try to download tvtk, but that would fairly slow my development
pace, as I don't know almost anything about it :-(
Andrea.
On 1/20/07, Prabhu Ramachandran <[EMAIL PROTECTED]> wrote:
> >>>>> "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
>
>
--
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77/
-------------------------------------------------------------------------
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