Sorry, I'm a newb. I forgot to Cc the listserv. Thanks for any help from any
of you guys.
-Roseanne
________________________________________
From: Cheng, Roseanne
Sent: Wednesday, May 04, 2011 11:17 AM
To: Gael Varoquaux
Subject: RE: [MayaVi-users] volume_slicer.py
Hi Gael,
I've been trying to extract the data points using
from enthought.mayavi import mlab
src = mlab.pipeline.open('file.vtk')
field = mlab.pipeline.delaunay3d(src)
but when I probe the data with
mlab.pipeline.probe_data(field, .5, .5, .5)
I get
ValueError: The object given has no points data of type scalars
Also with dataset = field.outputs[0] and dataset.points it returns nothing. Am
I doing this right? The header of my VTK file is
# vtk DataFile Version 2.0
3D Density
ASCII
DATASET STRUCTURED_POINTS
DIMENSIONS 16 16 16
ORIGIN -2 -2 -2
SPACING 0.25 0.25 0.25
POINT_DATA 4096
SCALARS Density float
LOOKUP_TABLE default
Thanks!
Roseanne
________________________________________
From: Gael Varoquaux [[email protected]]
Sent: Wednesday, May 04, 2011 1:24 AM
To: Cheng, Roseanne
Cc: [email protected]
Subject: Re: [MayaVi-users] volume_slicer.py
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/mayavi-users