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));
I used slider.js Javascript which helped me to move the two slices using the same slider
$( 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 );
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With