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

          
/**
* Header must be in the form:
* {
*   volume: {
*            rows: number,
*            cols: number.
*            imageIds: [],
*            imagePosition: [number, number, number],
*            sliceThickness: number
*           }
* }
*
* Data is a TypedArray
*/

const element = document.getElementById('viewer-2')
const widgetContainer = document.getElementById("widget");

const image = diglettk.buildVtkVolume(header, data);
// 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;
// activate crop widget
// vr.cropWidget = true;
// activate edge enhancement
// vr.edgeEnhancement = true;
// Activate XR
// vr.activateXR();