add contrast

This commit is contained in:
ilia 2022-10-30 14:43:40 +03:00
parent a003f47e8c
commit 01bd4f729b

View File

@ -13,7 +13,8 @@ var tools = {
type: 'factory'
},
ZoomAndPan: {},
WindowLevel: {}
WindowLevel: {},
Filter: {}
};
app.init({
@ -28,6 +29,7 @@ app.addEventListener('load', function () {
app.setDrawShape('Circle')
});
function createCircle(circleData) {
var point1 = new dwv.math.Point2D(circleData.center.x, circleData.center.y)
var point2 = new dwv.math.Point2D(circleData.center.x, circleData.center.y+circleData.radius)
@ -191,6 +193,9 @@ function receiveMessage(event)
else if (data.type == 'deleteSelected') {
app.getActiveLayerGroup().getActiveDrawLayer().getKonvaStage().find('#'+findActive())[0].destroy()
}
else if (data.type == 'setContrast') {
document.getElementById("layerGroup0").style = `filter: contrast(${data.data}%);`
}
}
window.addEventListener("message", receiveMessage, false);
@ -219,11 +224,10 @@ app.addEventListener('loadend', function () {
//range.max = app.getImage(0).getGeometry().getSize().get(2) - 1;
});
//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.setTool('Scroll')
// createCircle({
// type: 'Circle',
// center: {