diff --git a/dicomViewer.js b/dicomViewer.js index 5520cf0..529aaae 100644 --- a/dicomViewer.js +++ b/dicomViewer.js @@ -663,8 +663,4 @@ function urltoFile(url, filename, mimeType) { .then(function (buf) { return new File([buf], filename, { type: mimeType }); }); -} - -function saveAnnotations() { - } \ No newline at end of file diff --git a/index.html b/index.html index 4bebd1c..a6d7721 100644 --- a/index.html +++ b/index.html @@ -24,7 +24,7 @@

A dicom viewer

-
+
diff --git a/loader.js b/loader.js index 52802ed..a298125 100644 --- a/loader.js +++ b/loader.js @@ -6,7 +6,7 @@ $(document).ready(function () { loadDicomViewer(); }); -function loadDicomViewer(images_to_load) { +function loadDicomViewer(images_to_load, annotations_to_load) { console.log("loadDicomViewer", images_to_load); let single_dicom = document.getElementById("dicom-viewer"); if (single_dicom) { @@ -15,17 +15,21 @@ function loadDicomViewer(images_to_load) { if (images_to_load != undefined) { images = images_to_load; - console.log("i1", images) } else if (images.indexOf(",") > 0) { - images = images.split(","); + images = JSON.parse(images); } console.log(images); let annotations = single_dicom.dataset.annotations; - if (annotations != undefined && annotations.indexOf(",") > 0) { - annotations = annotations; + if (annotations != undefined) { + annotations = annotations_to_load; + } else if (annotations && annotations.indexOf(",") > 0) { + annotations = JSON.parse(annotations); + } else { + annotations = undefined; } + let load_as_stack; if (images.length > 5) { load_as_stack = true;