Opacity Widget
Drag outside the gaussian to move it along the histogram.
Drag inside the gaussian to modify its shape.
Double click to add a curve.
Right click to delete a curve.
Code Example
const element = document.getElementById("viewer-2");
const widgetContainer = document.getElementById("widget");
let header;
diglettk.loadDemoSerieWithLarvitar("knee", larvitar, serie => {
console.log(serie);
// build vtk volume with larvitar
header = larvitar.buildHeader(serie);
larvitar.buildDataAsync(serie, 30, onSuccess, onError);
});
function onSuccess(volume) {
data = volume;
const image = diglettk.buildVtkVolume(header, volume);
// run vr
vr = new diglettk.VRView(element);
// set an image
vr.setImage(image);
// set widget element to control opacity
vr.widgetElement = widgetContainer;
// set a LUT
let lutList = vr.getLutList();
fillSelect(lutList, "MuscleBone");
// vr.lut = lutList[0];
vr.lut = "MuscleBone";
vr.rescaleLUT = true;
}
function onError(err) {
console.error(err);
}