This commit is contained in:
Ross
2021-02-17 15:36:25 +00:00
parent 966d9689b4
commit 9fd1fc61a8
+13 -6
View File
@@ -76,14 +76,15 @@ $(document).ready(function () {
window.loadDicomViewerEvent = new Event('loadDicomViewer');
window.addEventListener('loadDicomViewer', function (e) {
console.log("listen", e.detail)
//console.log("listen", e.detail)
let images = [];
console.log($("#image_form_set img"));
$("#image_form_set img").each((n, el) => {
//console.log($("#image_form_set img"));
$(e.detail).each((n, el) => {
images.push($(el).attr("src"));
});
console.log("listen2", images)
loadDicomViewer(images); }, false);
//console.log("listen2", images)
loadDicomViewer(images);
}, false);
function loadDicomViewer(images_to_load) {
console.log("loadDicomViewer", images_to_load);
@@ -105,9 +106,15 @@ function loadDicomViewer(images_to_load) {
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, true);
dicomViewer.loadCornerstone($(single_dicom), null, images, annotations, load_as_stack);
}
}
}