Skip to content Skip to sidebar Skip to footer

Listen For Ctf Otf Changes With Traits In Mayavi Volume Rendering

I would like to listen to changes in the transfer function in how the color and opacity (ctf/otf) of my data is represented. Listening to sensible-sounding traits such as mayavi.mo

Solution 1:

You are going to wade into dangerous territory. As you noted the recorder has idosyncratic behavior -- what that really means is that it uses features to programatically "disable" the trait notifications while it is doing things.

You can probably figure out a way to do it that way, but most likely you'll have to dig deeply into the code that assigns the vtk modules.

What would probably make the most sense, is for you to write a GUI that does exactly what you want. That is, instead of listening to something like Volume._ctf, and then opening up the menu and changing the color, you can make a GUI and add a button that says "Change volume color" that when clicked brings the user to a color wheel. Then it's just a matter of listening to the GUI elements that you explicitly code for.

Post a Comment for "Listen For Ctf Otf Changes With Traits In Mayavi Volume Rendering"