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");

diglettk.loadSerieWithLarvitar(larvitar, serie => {
  let header = larvitar.buildHeader(serie);
  let data = larvitar.buildData(serie, false);
  console.log(serie)
  // build vtk volume with larvitar
  const image = diglettk.buildVtkVolume(header, data);
  // run vr
  let vr = new diglettk.VRView(element);
  // set an image
  vr.setImage(image);
  // set widget element to control opacity 
  vr.widgetElement = widgetContainer;
  // set a LUT 
  vr.lut = "MuscleBone";
  vr.rescaleLUT = true;
})