mirror of
https://github.com/leaders-of-digital-9-task/dicom-viewer.git
synced 2024-11-22 02:16:32 +03:00
add contrast
This commit is contained in:
parent
a003f47e8c
commit
01bd4f729b
12
index.js
12
index.js
|
@ -13,7 +13,8 @@ var tools = {
|
||||||
type: 'factory'
|
type: 'factory'
|
||||||
},
|
},
|
||||||
ZoomAndPan: {},
|
ZoomAndPan: {},
|
||||||
WindowLevel: {}
|
WindowLevel: {},
|
||||||
|
Filter: {}
|
||||||
};
|
};
|
||||||
|
|
||||||
app.init({
|
app.init({
|
||||||
|
@ -28,6 +29,7 @@ app.addEventListener('load', function () {
|
||||||
app.setDrawShape('Circle')
|
app.setDrawShape('Circle')
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
function createCircle(circleData) {
|
function createCircle(circleData) {
|
||||||
var point1 = new dwv.math.Point2D(circleData.center.x, circleData.center.y)
|
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)
|
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') {
|
else if (data.type == 'deleteSelected') {
|
||||||
app.getActiveLayerGroup().getActiveDrawLayer().getKonvaStage().find('#'+findActive())[0].destroy()
|
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);
|
window.addEventListener("message", receiveMessage, false);
|
||||||
|
|
||||||
|
@ -219,11 +224,10 @@ app.addEventListener('loadend', function () {
|
||||||
//range.max = app.getImage(0).getGeometry().getSize().get(2) - 1;
|
//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.addEventListener('load', () => {
|
||||||
app.setTool('Scroll')
|
|
||||||
|
|
||||||
// createCircle({
|
// createCircle({
|
||||||
// type: 'Circle',
|
// type: 'Circle',
|
||||||
// center: {
|
// center: {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user