custom-cornerstone-tools
Version:
Medical imaging tools for the Cornerstone library - customized for DrNuvem
93 lines (74 loc) • 2.97 kB
HTML
<html>
<head>
<!-- support for mobile touch devices -->
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1">
<!-- twitter bootstrap CSS stylesheet - not required by cornerstoneTools -->
<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
<link href="../cornerstone.min.css" rel="stylesheet">
<style>
.error {
border: 4px red solid;
}
</style>
</head>
<body>
<div class="container">
<div class="page-header">
<h1>
Load Handler Example
</h1>
<p>
This page contains an example of setting load handler functions
</p>
<a href="../index.html">Go back to the Examples page</a>
</div>
<div class="row">
<div class="col-xs-6">
<div class="errorDescription"></div>
<div style="width:512px;height:512px;position:relative;display:inline-block;color:white;"
oncontextmenu="return false"
class='cornerstone-enabled-image'
unselectable='on'
onselectstart='return false;'
onmousedown='return false;'>
<div id="dicomImage"
style="width:512px;height:512px;top:0px;left:0px; position:absolute;">
</div>
</div>
</div>
</div>
</body>
<!-- jquery - included to make things easier to demo, not needed or used by the cornerstone library but
is used by our example image loader-->
<script src="../jquery.min.js"></script>
<!-- include the cornerstone library -->
<script src="../cornerstone.min.js"></script>
<script src="../cornerstoneMath.min.js"></script>
<script src="../cornerstoneWADOImageLoader.js"></script>
<!-- include the cornerstone tools library -->
<script src="../../dist/cornerstoneTools.js"></script>
<!-- include special code for these examples which provides images -->
<script src="../exampleImageLoader.js"></script>
<script>
var element = $('#dicomImage').get(0);
function errorLoadingHandler(element, image) {
var elem = $(element);
elem.addClass("error");
$('.errorDescription').text("Error occurred! " + imageId + " not loaded.");
cornerstoneTools.mouseInput.disable(element);
cornerstone.disable(element);
};
cornerstoneTools.loadHandlerManager.setErrorLoadingHandler(errorLoadingHandler);
var imageId = 'dicomweb://awdawwad1001';
// image enable the dicomImage element
cornerstone.enable(element);
cornerstoneTools.mouseInput.enable(element);
cornerstone.loadImage(imageId).then(function(image) {
cornerstone.displayImage(element, image);
}, function(image) {
var errorLoadingHandler = cornerstoneTools.loadHandlerManager.getErrorLoadingHandler();
errorLoadingHandler(element, imageId);
});
</script>
</html>