How can i update two slice with same silde in nrrd loader
I am new to Javascript
and NRRD Loader
, in nrrd loader we can change the index value of a slice using the slider
sliceY = volume.extractSlice('y', Math.floor(volume.RASDimensions[1]/2));
scene3.add(sliceY.mesh);
gui.add(sliceY, 'index', 0, volume.RASDimensions[1], 1).name('indexY').onChange(function () {
sliceY.repaint.call(sliceY);
});
Consider I need update value of slicesX at same time with the same slider
sliceX = volume.extractSlice('x', Math.floor(volume.RASDimensions[1]/2));
我使用slider.js Javascript帮助我使用相同的滑块移动两个切片
$( function() {
$( "#sliderx" ).slider({
min: 0,
max: volumeslicex,
step: 1,
stop: function( event, ui ) {
// planexy.material.color.setHex( 0x8d8d8d );
// preset = "NULL";
},
slide: function( event, ui ) {
indexX=ui.value;
scene1.remove( sliceX.mesh );
scene.remove( sliceX1.mesh );
sliceChange();
}
});
} );
function sliceChange(){
//alert(indexX);
sliceX = volume.extractSlice('x',Math.floor(indexX));
sliceX1 = volume.extractSlice('x',Math.floor(indexX));
scene1.add( sliceX.mesh );
scene.add( sliceX1.mesh );
};
链接地址: http://www.djcxy.com/p/39720.html