Re: A problem with tube filter lines and spherical glyphs
Gael Varoquaux <gael.varoquaux <at> normalesup.org>
2010-08-07 13:46:45 GMT
Hi,
I haven't actually ran code to back my guess (trying to save time), but I
think that the two possible problems could be:
* the clamping of the glyph, which is turned off when you specify a
scale_factor to the glyph function. More is said about this in a
warning box on:
http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/mlab.html#adding-color-or-size-variations
* varying radius by absolute rather than by radius, which you can enforce
by doing:
tubes.filter.vary_radius = 'vary_radius_by_absolute_scalar'
HTH,
Gaël
On Thu, Aug 05, 2010 at 10:21:36PM -0600, Adam Konneker wrote:
> My general problem is as follows: I have a large set of data composed of
> connected points. Instead of using plot3D, I'm currently creating a
> scalar_scatter structure, specifying the edges, and applying a
> tube_filter. To better reflect my data, which is a large group of capsules
> (cylinders capped with hemispheres) linked together into separate chains,
> I would like to insert spheres (glyphs) at all the points, but I've had a
> hard time matching the scaling of the tubes to the glyphs. I'd like the
> spheres and the tubes to have the same radius(specified by the scalar
> data) within a given chain.
> So I already know about the existence of the tube_filter 'vary_radius' and
> 'radius_factor' attributes, and the glyph 'scale_factor' and 'scale_mode'
> attributes, but I haven't been able to piece everything together to make
> it work like I want. I think I'm getting confused about the units I use
> in my x,y,z coordinates I input to the data structures and the drawing
> coordinates used to make the visualizations. Below is a snippet of my
> code:
> src = mlab.pipeline.scalar_scatter(
> tubesX, tubesY, tubesZ, scalars)
> src.mlab_source.dataset.lines = pairs
> pts = mlab.points3d(tubesX, tubesY, tubesZ, scalars,scale_mode = 'scalar')
> tubes = mlab.pipeline.tube(src,tube_sides = NUM_SIDES)
> tubes.filter.vary_radius = 'vary_radius_by_scalar'
> mlab.pipeline.surface(tubes)
> Where "scalars" is an array of radii for the tubes and points in the same
> units as the x,y,z coordinates I use for the position data. Currently this
> gives me very thin tubes and big spheres.
> If anyone could show me where I'm going wrong, I would greatly appreciate
> it. It's probably a very naive question, but I'm new to mayavi, vtk, and
> python in general, so I am certainly naive.
> Thanks,
> Adam K
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by
> Make an app they can't live without
> Enter the BlackBerry Developer Challenge
> http://p.sf.net/sfu/RIM-dev2dev
> _______________________________________________
> MayaVi-users mailing list
> MayaVi-users <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mayavi-users
--
Gael Varoquaux
Research Fellow, INRIA
Laboratoire de Neuro-Imagerie Assistee par Ordinateur
NeuroSpin/CEA Saclay , Bat 145, 91191 Gif-sur-Yvette France
Phone: ++ 33-1-69-08-78-35
Mobile: ++ 33-6-28-25-64-62
http://gael-varoquaux.info
------------------------------------------------------------------------------
This SF.net email is sponsored by
Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev
_______________________________________________
MayaVi-users mailing list
MayaVi-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mayavi-users