This example shows how to embed the dicom.link WebViewer and load a study from an Orthanc server via its DICOMweb WADO endpoint. Replace studyInstanceUID and qidoUrl with your own values.
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.dicom.link/dicomViewer/1.6.1/dicomViewer.min.js"></script>
<script type="text/javascript">
function ResizeContent() {
var body = document.getElementsByTagName('body')[0];
var mySize = window.innerHeight;
body.style.height = mySize + 'px';
var t = document.getElementById('dicomviewer-container');
t.style.height = mySize + 'px';
}
window.addEventListener('resize', function(event) {
ResizeContent();
}, true);
window.addEventListener('load', (event) => {
ResizeContent();
});
</script>
<style>
.dicomviewer-container {
position: absolute;
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div class="dicomviewer-container" id="dicomviewer-container"></div>
<script type="text/javascript">
if (!crypto.subtle) {
alert("Error! Crypto API not available. Make sure you are using HTTPS.");
}
window.addEventListener('load', (event) => {
// Replace with your licence key
dicomViewer.License = JSON.parse(atob('YOUR_LICENCE_KEY_HERE'));
var dicomSelector = '.dicomviewer-container';
var studyInstanceUID = "1.2.xxx"; // ← your Study Instance UID
// Orthanc DICOMweb endpoint
var qidoUrl = "https://your-orthanc-server/dicom-web/studies/"
+ studyInstanceUID + "/instances";
var dicom1 = new dicomViewer.loadStudy();
dicom1.init(dicomSelector).then((r) => {
dicom1.wado = dicom1.LoadWadoURI(qidoUrl);
});
});
</script>
</body>
</html>
Requirements
- The page must be served over HTTPS (the crypto API is not available on plain HTTP).
- Your Orthanc server must have DICOMweb enabled and CORS configured to allow requests from your domain.
- A valid dicom.link WebViewer licence for your hostname.
Getting a licence
Contact us via the contact page or see the embedding guide for licence tiers.