我有两卷不同质量的卷 (.nrrd)。用户可以浏览图层。如果按下某个键,我想以更好的质量加载音量切片。
我的音量和这个类似:第 10 课 xtk
我发现:
volume.children[2].children[0].children[0].texture.file = " http://path/to/file.ext ";
但如果我应用某种文件(.jpg、.dcm),什么也不会发生。
这是将切片更改为进入孩子内部并更改纹理的正确方法吗?
还是我应该将选定的切片作为一个对象单独加载并以某种方式将其应用于“低质量体积”?
编辑: 这是我到目前为止所尝试的(我在 dcms 上遇到错误,但在 jpgs 上没有):
if (event.keyCode == 83) { // "s"-button
volume.children[2].children[0].children[0].texture.file = "http://localhost:3000/112.jpg";
volume.children[2].children[0].children[0].modified();
r.render();
}
编辑2 :这是我的 r.onShowtime = function() {}
volume.children[2].children[0].texture.file = 'http://localhost:3000/112.jpg';
volume.children[2].children[0].visible = true; // to activate the first layer
volume.children[2].children[0].modified();
console.log(volume.children[2].children[0].visible +" "+ volume.children[2].children[0].texture.file);
它输出“真实主机名/112.jpg”
当我在 firebug 中检查 .jpg 时,标题是好的,但答案是“null”
当我检查console.log(volume.children[2].children[0]); 萤火虫
.texture.file 设置为 hostname/112.jpg
当我进入“网络”时,.jpg 已成功传输
请注意 112.jpg 和 level.jpg 是相同的。第一个在 r.onShowtime 中加载,另一个在按键事件中加载。
编辑 3: volume.children[2].children[0] 属于“X.slice”类型,不是吗?
这是我的方法:jsFiddle
这是我的实际问题,但仍然无法正常工作:jsFiddle