remove Group is not a constructor bug

This commit is contained in:
ilia 2022-10-28 00:44:26 +03:00
parent 31fbe19e99
commit 7b21de51c4
5 changed files with 35 additions and 37 deletions

BIN
Class-3-malocclusion.zip Normal file

Binary file not shown.

3
dwv.js

File diff suppressed because one or more lines are too long

View File

@ -1,9 +1,20 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <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="/js/lib/dummy.js"></script>
<link rel="stylesheet" type="text/css" href="/css/result-light.css">
<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> <title>Document</title>
</head> </head>
<body> <body>
@ -12,7 +23,6 @@
</div> </div>
<input type="range" id="sliceRange" value="0"> <input type="range" id="sliceRange" value="0">
<script src="dwv.js"></script>
<script src="index.js"></script> <script src="index.js"></script>
</body> </body>
</html> </html>

View File

@ -1,36 +1,27 @@
// create the dwv app
var app = new dwv.App(); var app = new dwv.App();
// initialise with the id of the container div
var tools = {
Draw: {
options: ['Circle'],
type: 'factory'
}
};
app.init({ app.init({
dataViewConfigs: {'*': [{divId: 'layerGroup0'}]}, dataViewConfigs: {'*': [{divId: 'layerGroup0'}]},
tools: { tools: tools
Scroll: {}
}
}); });
// activate tool once done loading // activate tool once done loading
app.addEventListener('load', function () { app.addEventListener('load', function () {
app.setTool('Scroll'); app.setTool('Draw');
app.setDrawShape(tools.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])
}); });
// load dicom data // load dicom data
app.loadURLs(['https://raw.githubusercontent.com/ivmartel/dwv/master/tests/data/bbmri-53323851.dcm','https://raw.githubusercontent.com/ivmartel/dwv/master/tests/data/bbmri-53323707.dcm','https://raw.githubusercontent.com/ivmartel/dwv/master/tests/data/bbmri-53323563.dcm']); app.loadURLs(['https://raw.githubusercontent.com/ivmartel/dwv/master/tests/data/bbmri-53323851.dcm']);
//
var range = document.getElementById('sliceRange');
range.min = 0;
app.addEventListener('loadend', function () {
range.max = app.getImage(0).getGeometry().getSize().get(2) - 1;
});
app.addEventListener('slicechange', function () {
// update slider on slice change (for ex via mouse wheel)
var lg = app.getLayerGroupById(0);
var vc = lg.getActiveViewLayer().getViewController();
range.value = vc.getCurrentPosition().k;
});
range.oninput = function () {
var lg = app.getLayerGroupById(0);
var vc = lg.getActiveViewLayer().getViewController();
var index = vc.getCurrentIndex();
var values = index.getValues();
values[2] = this.value;
vc.setCurrentIndex(new dwv.math.Index(values));
}

BIN
radiologic.zip Normal file

Binary file not shown.