On Wed, May 04, 2011 at 02:46:06AM +0000, Cheng, Roseanne wrote:
> I just started playing with Mayavi!  It wins. 

Thanks!

> I've been working with the volume_slicer.py example and I would like to
> load a structured points VTK file instead of the defined array. 

In this specific example, structured points will be a problem, as the
module used to do the visualization is an ImagePlaneWidget, that only
works with ImageData. The example can partly be adapted to use a
ScalarCutPlane, but not completly, and it will be slower.

In general, to open a VTK file, and turn it in a Mayavi source, you can
always do::

    from enthought.mayavi import mlab
    src = mlab.pipeline.open('file.vtk')

> I can't seem to figure out how to load a VTK file into an array.

Not all VTK files can be transformed in a single array. However, given
the code above, you can retrieve the data as describe in 
http://github.enthought.com/mayavi/mayavi/data.html#inspecting-the-internals-of-the-data-structures

Not that if you simply want to use Mayavi as a file reader, and not
display anything, it might be useful to give 'figure=False' to
pipeline.open, as described in:
http://github.enthought.com/mayavi/mayavi/data.html#headless-use-of-mayavi-for-the-algorithms-without-visualization

> Is that what I should do in the first place?

It's perfectly reasonnable to want to shortcut this step, and simply use
the source created by the file loading.

> Also, how do you print all four windows into a png file?

You cannot do that. Each window is a different VTK interactor, and we
have no code to plug them together. Sorry.

HTH,

Gael

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
MayaVi-users mailing list
MayaVi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mayavi-users

Reply via email to