Hi there,

I would truly truly be grateful if someone could help me with this. It has
caused me much strife.

I would like to change the opacity scaling to some default piecewise
function when I first run my code -- without messing with the GUI or the
pop up window: volume.edit_traits()

I've tried many related ways, but for sanity I'll stick to a prototypical
example:
#########
volume=mlab.pipeline.volume(mlab.pipeline.scalar_field(sIzi,sIxi,sIyi,I))
from tvtk.util.ctf import PiecewiseFunction
otf = PiecewiseFunction()
otf.add_point(0.0,0.0)
#otf.add_point(0.25,0.0)
otf.add_point(0.35,0.15)
otf.add_point(1.0,.25)

volume.volume_property.set_scalar_opacity(otf)

#########

This code seems to edit the opacity, but it acts as if I had typed in
0.0025 (or maybe 0.025?) and 0.0035 instead of 0.35. For clarity, I would
like slope of the opacity function to change at the 25% and 35% percentiles.

Thanks,
Chris
------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors 
network devices and physical & virtual servers, alerts via email & sms 
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
MayaVi-users mailing list
MayaVi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mayavi-users

Reply via email to