On Wed, May 04, 2011 at 04:41:23PM +0000, Cheng, Roseanne wrote:
> Still having (causing) trouble...So in trying to retrieve the data set from 
> the field object I get...

> from enthought.mayavi import mlab
> src = mlab.pipeline.open('star.vtk')
> mlab.pipeline.probe_data(src, .5, .5, .5)
> array([ 0.], dtype=float32)
> mlab.pipeline.probe_data(src, -.5, -.5, -.5)
> array([ 0.19322599], dtype=float32)
> dataset = src.outputs[0]
> dataset.points
> Traceback (most recent call last):
>   File "<input>", line 1, in <module>
> AttributeError: 'StructuredPoints' object has no attribute 'points'

Yes, because there are no points. The data is in the point_data.scalars
attribute, as in an ImageData:
http://github.enthought.com/mayavi/mayavi/data.html#imagedata


> Eventually will 
> points = dataset.points.to_array()

> be what I need for volume_slicer.py instead of data = Array()?

If you already have a data source, you don't need to pass in a data
array. You can modify the example to use directly the source. For this,
remove the method _data_src3d_default, and assign your src object to the
data_src3d attribute (you will also need to remove the other, slightly
trivial reference to self.data). That way you avoid copying the data and
directly read it from the disk.

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