Example 1: Autoload and display a study from a zip archive, hosted online
Include the library in the page you wish to display the viewer
<script src="https://cdn.dicom.link/dicomViewer/1.6.4/dicomViewer.min.js"></script>
Bootstrap code to load and parse the page
<script type='text/javascript'>
window.addEventListener('load', (event) => {
var key = '[paste here the licence code you\'ve been provided with]';
dicomViewer.License = JSON.parse(atob(key));
dicomViewer.parseDOM();
});
</script>
Upload a zip archive containing dicom files, including the DICOMDIR file, which is an index. This is very important for lowering the bandwidth because the viewer will have the knowledge of the structure of the study and fetch only the required images; no full scan is required.
Add the elements containing the viewer on the page. They must have the following attributes:
data-dicomviewer
data-dicomzip="[url here of the zip archive]"
Example:
<div class="test-container" data-dicomviewer data-dicomzip="/upload/arhive.zip" id="test-container-id"></div>
The server hosting the archive must support the following features:
partial requests,
CORS, if it has a different origin than the server hosting the web page
Example 2: Load the viewer inside a div
<script src="https://cdn.dicom.link/dicomViewer/1.6.4/dicomViewer.min.js"></script>
..
<div id="dicomviewer-container"></div>
<script type='text/javascript'>
window.addEventListener('load', (event) => {
var key = '[paste here the licence code you\'ve been provided with]';
dicomViewer.License = JSON.parse(atob(key));
window.dicom1 = new dicomViewer.loadStudy();
dicom1.init('.dicomviewer-container').then((r) => {
// on completed
});
});
</script>
Differences between free and commercial versions
Limitation for Free version:
CloudPACS Basic, which is the free version the CloudPACS suite, has the Free version of the viewer.
Any purchase of the viewer for your specified domain also activates the viewer in CloudPACS Basic to Pro, if the same email was used to register the account.