我正在尝试使用基石库显示Dicom图像。我使用了https://github.com/cornerstonejs/cornerstone/blob/master/example/jsminimal/index.html中的jsminimal示例代码。我包含的js文件是cornerstone.js和exampleImageIdLoader.js,它们是从上面的同一链接中提取的。
<!DOCTYPE HTML>
<html>
<head>
<link href="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
<h1>
jsminimal/index.html
</h1>
<h3>This is an example of the minimal use of cornerstone driven by javascript</h3>
<br>
<br>
<h3>In this example, javascript is used to image enable a div.</h3>
<br>
<br>
<div id="dicomImage" style="width:512px;height:512px">
</div>
</div>
</body>
<script src="cornerstone.js"></script>
<script>window.cornerstone || document.write('<script src="https://unpkg.com/cornerstone-core@2.3.0">\x3C/script>')</script>
<script src="exampleImageIdLoader.js"></script>
<script>
const imageId = 'vhf.151.dcm';
const element = document.getElementById('dicomImage');
cornerstone.enable(element);
cornerstone.loadImage(imageId).then(function(image) {
cornerstone.displayImage(element, image);
});
</script>
</html>
我面临的错误是:
错误:loadImageFromImageLoader:imageId cornerstone.js:3361:11没有图像加载器
loadImageFromImageLoader文件:/ cornerstone.js / cornerstone.js:3361的绝对路径
loadImage文件:/cornerstone.js的绝对路径> /cornerstone.js:3402
文件:/ html文件的绝对路径/imageViewer.html:35
答案 0 :(得分:0)
尝试插入cornerstoneWADOImageLoader
。
文档:https://github.com/cornerstonejs/cornerstoneWADOImageLoader