-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
79 lines (74 loc) · 2.47 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<html>
<head>
<title>Quick Test Page</title>
<style>
html,
body {
background: dodgerblue;
}
#cornerstone-element {
width: 512px;
height: 512px;
margin: 0 auto;
background: #ccc;
}
</style>
<!-- peerDependencies -->
<!-- Our Plugin -->
</head>
<body>
<section>
<div
id="cornerstone-element"
data-index="0"
oncontextmenu="return false"
></div>
</section>
</body>
<script src="https://unpkg.com/[email protected]/hammer.js"></script>
<script src="https://unpkg.com/[email protected]/dist/cornerstoneMath.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/cornerstone.js"></script>
<script src="https://unpkg.com/[email protected]/dist/cornerstoneWebImageLoader.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/cornerstoneTools.js"></script>
<script src="../dist/rotated-elliptical-roi-tool.umd.js"></script>
<script>
/***
* Setup
*/
cornerstoneWebImageLoader.external.cornerstone = cornerstone;
cornerstone.registerImageLoader(
"http",
cornerstoneWebImageLoader.loadImage
);
cornerstone.registerImageLoader(
"https",
cornerstoneWebImageLoader.loadImage
);
/***
* Boilerplate
*/
cornerstoneTools.init({
showSVGCursors: true,
});
cornerstoneTools.toolColors.setToolColor("orange");
// Enable Element
const element = document.querySelector("#cornerstone-element");
cornerstone.enable(element);
// Load and Display Image
const exampleImageId =
"https://rawgit.com/dannyrb/cornerstone-vuejs-poc/master/static/simple-study/1.2.276.0.74.3.1167540280.200511.112514.1.1.10.jpg";
cornerstone.loadImage(exampleImageId).then(function(image) {
cornerstone.displayImage(element, image);
const WwwcTool = cornerstoneTools.WwwcTool;
const PanTool = cornerstoneTools.PanTool;
const EraserTool = cornerstoneTools.EraserTool;
cornerstoneTools.addTool(WwwcTool);
cornerstoneTools.addTool(PanTool);
cornerstoneTools.addTool(EraserTool);
cornerstoneTools.setToolActive("Pan", { mouseButtonMask: 4 });
cornerstoneTools.setToolActive("Eraser", { mouseButtonMask: 2 });
cornerstoneTools.addTool(RotatedEllipticalRoiTool);
cornerstoneTools.setToolActive("RotatedEllipticalRoi", { mouseButtonMask: 1 });
});
</script>
</html>