From a003f47e8c5cc330ed11bc556afb62c186fcd876 Mon Sep 17 00:00:00 2001 From: ilia Date: Sun, 30 Oct 2022 12:53:41 +0300 Subject: [PATCH] add window level --- index.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index d26379a..9c81fc6 100644 --- a/index.js +++ b/index.js @@ -12,7 +12,8 @@ var tools = { options: ['Circle', 'Roi'], type: 'factory' }, - ZoomAndPan: {} + ZoomAndPan: {}, + WindowLevel: {} }; app.init({ @@ -32,12 +33,13 @@ function createCircle(circleData) { var point2 = new dwv.math.Point2D(circleData.center.x, circleData.center.y+circleData.radius) app.setTool('Draw'); var styles = app.getToolboxController().getSelectedTool().style + app.undo() var draw = circleFactory.create( [point1, point2], styles, app.getActiveLayerGroup().getActiveViewLayer().getViewController() ) - app.undo() + draw.id(dwv.math.guid()); draw.draggable(true) draw.addEventListener('mouseover', () => { @@ -176,6 +178,9 @@ function receiveMessage(event) else if (data.data == 'ZoomAndPan') { app.setTool('ZoomAndPan'); } + else if (data.data == 'WindowLevel') { + app.setTool('WindowLevel') + } } else if (data.type == 'setDraws') { createDraws(data)