DWVv0.37.0

Opacity

Source: opacity.js:31

Opacity class.

Example

CODE
import {App, AppOptions, ViewConfig, ToolConfig} from '//esm.sh/dwv';
// create the dwv app
const app = new App();
// initialise
const viewConfig0 = new ViewConfig('layerGroup0');
const viewConfigs = {'*': [viewConfig0]};
const options = new AppOptions(viewConfigs);
options.tools = {Opacity: new ToolConfig()};
app.init(options);
// activate tool
app.addEventListener('load', function () {
  app.setTool('Opacity');
});
// load dicom data
app.loadURLs([
  'https://raw.githubusercontent.com/ivmartel/dwv/master/tests/data/bbmri-53323851.dcm'
]);

Constructor

new Opacity(app: App): Opacity

Parameters

  • app (App) — The associated application.

Instance Methods

activate(bool: boolean)

Activate the tool.

Parameters

  • bool (boolean) — The flag to activate or not.

init()

Initialise the tool.

setFeatures(_features: object)

Set the tool live features: does nothing.

Parameters

  • _features (object) — The list of features.

Instance Fields

keydown

Handle key down event.

Parameters

  • event (object) — The key down event.