I want to load a custom gradient table color transfer function (*.grad file)
via a MayaVi2 script.
Here's how I do it via the GUI:
1. Load data
2. Modules -> Volume
3. Select the "Volume" module from the "MayaVi" panel"
4. Right click the colortable (by default it looks like all the colors from
the rainbow)
5. Click "Load"... select table and load it...
So, now I want to do it via a script. Here's what I have to set up my
volume visualization
<start snip>
from enthought.mayavi.modules.volume import Volume
# start MayaVi, load data, etc.
...
vol = Volume()
mayavi.add_module(vol)
</end snip>
I noticed the following functions/classes/members of Volume:
vol.module_manager.lut_data_mode
vol.module_manager.scalar_lut_manager.load_lut_from_file(filename)
but these do not seem to actually update the ctf... They look like something
implemented in VTK that changes scalar lookup tables only, not the CTF.
I poked around the MayaVi2 code a little and found this:
https://svn.enthought.com/enthought/browser/trunk/src/lib/enthought/mayavi/core/lut_manager.py?rev=9906
Which leads me to believe the CTF/gradient editor is abstracted from the
Volume module, and I somehow need to get access to MayaVi's lut_manager.
How do I change the CTF via a MayaVi2 script?
Thanks,
Pete
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
MayaVi-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mayavi-users