mirror of
https://github.com/leaders-of-digital-9-task/dicom-viewer.git
synced 2024-11-22 02:16:32 +03:00
add window level
This commit is contained in:
parent
42454be459
commit
a003f47e8c
9
index.js
9
index.js
|
@ -12,7 +12,8 @@ var tools = {
|
||||||
options: ['Circle', 'Roi'],
|
options: ['Circle', 'Roi'],
|
||||||
type: 'factory'
|
type: 'factory'
|
||||||
},
|
},
|
||||||
ZoomAndPan: {}
|
ZoomAndPan: {},
|
||||||
|
WindowLevel: {}
|
||||||
};
|
};
|
||||||
|
|
||||||
app.init({
|
app.init({
|
||||||
|
@ -32,12 +33,13 @@ function createCircle(circleData) {
|
||||||
var point2 = new dwv.math.Point2D(circleData.center.x, circleData.center.y+circleData.radius)
|
var point2 = new dwv.math.Point2D(circleData.center.x, circleData.center.y+circleData.radius)
|
||||||
app.setTool('Draw');
|
app.setTool('Draw');
|
||||||
var styles = app.getToolboxController().getSelectedTool().style
|
var styles = app.getToolboxController().getSelectedTool().style
|
||||||
|
app.undo()
|
||||||
var draw = circleFactory.create(
|
var draw = circleFactory.create(
|
||||||
[point1, point2],
|
[point1, point2],
|
||||||
styles,
|
styles,
|
||||||
app.getActiveLayerGroup().getActiveViewLayer().getViewController()
|
app.getActiveLayerGroup().getActiveViewLayer().getViewController()
|
||||||
)
|
)
|
||||||
app.undo()
|
|
||||||
draw.id(dwv.math.guid());
|
draw.id(dwv.math.guid());
|
||||||
draw.draggable(true)
|
draw.draggable(true)
|
||||||
draw.addEventListener('mouseover', () => {
|
draw.addEventListener('mouseover', () => {
|
||||||
|
@ -176,6 +178,9 @@ function receiveMessage(event)
|
||||||
else if (data.data == 'ZoomAndPan') {
|
else if (data.data == 'ZoomAndPan') {
|
||||||
app.setTool('ZoomAndPan');
|
app.setTool('ZoomAndPan');
|
||||||
}
|
}
|
||||||
|
else if (data.data == 'WindowLevel') {
|
||||||
|
app.setTool('WindowLevel')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (data.type == 'setDraws') {
|
else if (data.type == 'setDraws') {
|
||||||
createDraws(data)
|
createDraws(data)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user