mirror of
https://github.com/leaders-of-digital-9-task/dicom-viewer.git
synced 2024-11-21 18:06:33 +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'
|
||||
},
|
||||
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: {
|
||||
|
|
Loading…
Reference in New Issue
Block a user