在mayavi体积渲染中侦听带有特征的ctf otf变化 [英] listen for ctf otf changes with traits in mayavi volume rendering

查看:108
本文介绍了在mayavi体积渲染中侦听带有特征的ctf otf变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想听听传递函数中数据的颜色和不透明度(ctf/otf)表示方式的变化.

I would like to listen to changes in the transfer function in how the color and opacity (ctf/otf) of my data is represented.

聆听诸如Mayavi.modules.volume.Volume._ctf之类的明智特征不会触发我的回调.

Listening to sensible-sounding traits such as mayavi.modules.volume.Volume._ctf does not trigger my callback.

我希望用户可以通过标准" mayavi管道显示(作为EngineRichView的一部分)或通过直接包含Volume对象的视图来更改此设置.无论哪种方式都没有运气.

I would expect this to be changed by the user either through the "standard" mayavi pipeline display (as part of EngineRichView) or through including the Volume object's view directly. No such luck either way.

也许这说明当您按下红色的大记录"按钮时,记录器似乎也没有注意到用户对ctf所做的更改.

It is maybe telling that when you press the big red "record" button, the recorder also does not seem to notice user changes to the ctf.

推荐答案

您将涉足危险区域.如您所述,记录器具有异质性行为-真正的含义是它在执行操作时使用功能以编程方式禁用"特征通知.

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.

您可能想出了一种方法,但是很可能您必须深入研究分配vtk模块的代码.

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.

可能最有意义的是,您编写一个完全可以实现所需功能的GUI.也就是说,您可以制作一个GUI并添加一个显示更改音量颜色"的按钮,而不是先听Volume._ctf之类的声音,然后打开菜单并更改颜色,然后单击该按钮即可使用户进入色轮. .然后,只需听一下您明确为其编写代码的GUI元素即可.

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.

这篇关于在mayavi体积渲染中侦听带有特征的ctf otf变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆