import * as dicomViewer from "./dicomViewer.js" $(document).ready(function () { loadDicomViewer(); }); function loadDicomViewer(images_to_load) { console.log("loadDicomViewer", images_to_load); let single_dicom = document.getElementById("dicom-viewer"); if (single_dicom) { let images = single_dicom.dataset.images; if (images_to_load != undefined) { images = images_to_load; console.log("i1", images) } else if (images.indexOf(",") > 0) { images = images.split(","); } console.log(images); let annotations = single_dicom.dataset.annotations; if (annotations != undefined && annotations.indexOf(",") > 0) { annotations = annotations; } let load_as_stack; if (images.length > 5) { load_as_stack = true; } else { load_as_stack = false; } if (images) { dicomViewer.loadCornerstone($(single_dicom), null, images, annotations, load_as_stack); } } }