This commit is contained in:
Firesieht 2022-10-29 01:01:36 +03:00
commit c4c9651fdd
4 changed files with 42 additions and 53 deletions

3
dwv.js

File diff suppressed because one or more lines are too long

View File

@ -1,18 +1,25 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="robots" content="noindex, nofollow">
<meta name="googlebot" content="noindex, nofollow">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="text/javascript" src="https://cdn.rawgit.com/konvajs/konva/8.3.0/konva.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/i18next/21.6.0/i18next.min.js"></script>
<script type="text/javascript" src="https://github.com/ivmartel/dwv/releases/download/v0.30.4/dwv-0.30.4.min.js"></script>
<title>Document</title>
</head>
<body>
<div id="dwv">
<div id="layerGroup0"></div>
</div>
</div>
<input type="range" id="sliceRange" value="0">
<script src="dwv.js"></script>
<input type="range" id="sliceRange" value="0">
<script src="index.js"></script>
</body>
</html>

View File

@ -1,55 +1,28 @@
var filterList = ['Threshold', 'Sharpen', 'Sobel'];
var shapeList = [
'Arrow',
'Ruler',
'Protractor',
'Rectangle',
'Roi',
'Ellipse',
'Circle',
'FreeHand'
];
var app = new dwv.App();
var toolList = {
var tools = {
Scroll: {},
Opacity: {},
WindowLevel: {},
ZoomAndPan: {},
Draw: {
options: shapeList,
type: 'factory',
events: ['drawcreate', 'drawchange', 'drawmove', 'drawdelete']
},
Livewire: {
events: ['drawcreate', 'drawchange', 'drawmove', 'drawdelete']
},
Filter: {
options: filterList,
type: 'instance',
events: ['filterrun', 'filterundo']
},
Floodfill: {
events: ['drawcreate', 'drawchange', 'drawmove', 'drawdelete']
options: ['Circle', 'Roi'],
type: 'factory'
}
};
// initialise the application
var options = {
app.init({
dataViewConfigs: {'*': [{divId: 'layerGroup0'}]},
tools: toolList
};
// main application
var app = new dwv.App();
app.init(options);
// activate tool once done loading
tools: tools
});
app.addEventListener('load', function () {
app.setTool('Scroll');
app.setTool('Draw');
app.setDrawShape(toolList.Draw.options[0]);
//var layer = new dwv.gui.DrawLayer('layerGroup0')
// factory = new dwv.tool.draw.CircleFactory();
// var point1 = new dwv.math.Point2D(10, 10)
// var point2 = new dwv.math.Point2D(10, 100)
// var draw = factory.create([point1, point2], app.getToolboxController().getSelectedTool().style, app.getActiveLayerGroup().getActiveViewLayer().getViewController())
// app.getActiveLayerGroup().getActiveDrawLayer().getKonvaLayer().add(draw)
// console.log(app.getActiveLayerGroup().getActiveDrawLayer().getKonvaLayer().getChildren()[0])
});
@ -60,14 +33,26 @@ function receiveMessage(event)
if (data.type == "setDicom"){
app.loadURLs([data.data])
} else if(data.type == "setTool"){
app.setTool('Draw');
app.setDrawShape("Circle");
if (data.data == "null"){
app.setTool('Scroll');
} else{
app.setTool('Draw');
app.setDrawShape(data.data);
}
}
}
window.addEventListener("message", receiveMessage, false);
//
app.addEventListener("drawchange", function (){
console.log("DRAWWWWWW")
})
var range = document.getElementById('sliceRange');
range.min = 0;
app.addEventListener('loadend', function () {

BIN
radiologic.zip Normal file

Binary file not shown.