add contrast

This commit is contained in:
ilia 2022-10-30 14:58:20 +03:00
parent 227b3a12b9
commit 73d12f3e62

View File

@ -42,7 +42,8 @@ function createCircle(circleData) {
app.getActiveLayerGroup().getActiveViewLayer().getViewController() app.getActiveLayerGroup().getActiveViewLayer().getViewController()
) )
draw.id(dwv.math.guid()); //draw.id(dwv.math.guid());
draw.id("id")
draw.draggable(true) draw.draggable(true)
draw.addEventListener('mouseover', () => { draw.addEventListener('mouseover', () => {
document.body.style.cursor = 'pointer' document.body.style.cursor = 'pointer'
@ -121,7 +122,8 @@ function postCircles() {
x: e.x, x: e.x,
y: e.y y: e.y
}, },
radius: e.radius radius: e.radius,
id: e.id
} }
}) })
} }
@ -148,7 +150,8 @@ function postRois() {
} }
return { return {
type: 'Roi', type: 'Roi',
points: points points: points,
id: e.id
} }
}) })
} }
@ -196,6 +199,9 @@ function receiveMessage(event)
else if (data.type == 'setContrast') { else if (data.type == 'setContrast') {
document.getElementById("layerGroup0").style = `filter: contrast(${data.data}%);` document.getElementById("layerGroup0").style = `filter: contrast(${data.data}%);`
} }
else if (data.type == 'deleteById') {
app.getActiveLayerGroup().getActiveDrawLayer().getKonvaStage().find("#"+data.data)[0].destroy()
}
} }
window.addEventListener("message", receiveMessage, false); window.addEventListener("message", receiveMessage, false);
@ -227,7 +233,9 @@ app.addEventListener('loadend', function () {
//app.loadURLs(['https://raw.githubusercontent.com/ivmartel/dwv/master/tests/data/bbmri-53323851.dcm']) //app.loadURLs(['https://raw.githubusercontent.com/ivmartel/dwv/master/tests/data/bbmri-53323851.dcm'])
app.addEventListener('load', () => { app.addEventListener('load', () => {
app.getActiveLayerGroup().getActiveDrawLayer().getKonvaStage().addEventListener('mouseup', () => {
parent.postMessage({'type': 'returnDraws', data: postDraws()}, "*")
})
// createCircle({ // createCircle({
// type: 'Circle', // type: 'Circle',
// center: { // center: {