2008/11/24 Prabhu Ramachandran <[EMAIL PROTECTED]>:

> I would recommend upgrading to Mayavi-3.0.3 from Gael's ubuntu packages:
>
>  https://launchpad.net/~gael-varoquaux/+archive
>

FYI:

I added the repositories listed on Gael's page to my sources.list and
upgraded mayavi2.  There was a problem during the upgrade and the
mayavi2 package was listed as broken in the package manager.  I
uninstalled and re-installed it again, and it seems to be ok now.

After upgrading, running mayavi2 from the command line fails with the
error message

Traceback (most recent call last):
  File "/usr/bin/mayavi2", line 625, in <module>
    main()
  File "/usr/bin/mayavi2", line 616, in main
    mayavi.main(sys.argv[1:])
  File "/usr/lib/python2.5/site-packages/enthought/mayavi/plugins/app.py",
line 172, in main
    plugins = get_plugins()
  File "/usr/lib/python2.5/site-packages/enthought/mayavi/plugins/app.py",
line 128, in get_plugins
    return [cls() for cls in get_plugin_classes()]
  File "/usr/lib/python2.5/site-packages/enthought/mayavi/plugins/app.py",
line 107, in get_plugin_classes
    from enthought.plugins.ipython_shell.ipython_shell_plugin import \
ImportError: No module named ipython_shell.ipython_shell_plugin

However, enthought.mayavi.mlab still imports without problems.

> If you use this version, you can save the output of a filter to a VTK file
> by right clicking on the filter.  As regards a module, it is not as
> straightforward and would take some coding on your part to figure out what
> exactly you want to save from the particular module.  A specific question
> would help us provide a clearer answer.  Anyway, with your current Mayavi
> version, the following will work, let x be your VTK dataset that you want to
> save (that is the output of some VTK filter/whatever):
>
>  from enthought.tvtk.api import write_data
>  write_data(x, 'foo.xml') # or 'foo.vtu'/'foo.vts' etc.

Thanks, I'll play around with this.

> This is not easy to do with the way mayavi modules are currently setup.  It
> may be fixed later on.  However, what you can do is scale/orient the glyphs
> using vectors and color by the scalars.  This should solve your problem.
>  Unfortunately, I don't think you set the opacity using yet another scalar
> -- at least I am not sure how best to do it.  You could find a function
> relating the sclalar value to the opacity and then tailor the LUT so it does
> what you need.  You can manipulate the LUT relatively easily and even set
> the colors via numpy arrays.  This can be done by setting the lut's table
> trait.

Thanks.  How do I find out what python objects correspond to different
filters and modules in the visualisation? For instance, using the GUI
dialog I see that I can set the tube radius of a line plotted using
plot3d to vary with the scalar value.  But I don't know how to set
this option in a python script. I've tried looking at the objects
returned by the mlab functions, but they have hundreds of attributes
and it's confusing.

I haven't looked through the tvtk and mayavi examples in the examples/
directory yet - I'll do that when I get time to see if they help.

Neil

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MayaVi-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mayavi-users

Reply via email to