This commit is contained in:
Ross
2021-02-01 12:20:48 +00:00
parent 7d3abd0680
commit 1fbc3b4bb8
8 changed files with 62 additions and 76 deletions
+11 -20
View File
@@ -53,8 +53,17 @@ $(document).ready(function () {
let single_dicom = document.getElementById("single-dicom-viewer");
if (single_dicom) {
let images = single_dicom.dataset.images.split(",");
let annotations = single_dicom.dataset.annotations.split(",");
let images = single_dicom.dataset.images;
if (images.indexOf(",") > 0) {
images = images.split(",");
}
let annotations = single_dicom.dataset.annotations;
if (annotations != undefined && annotations.indexOf(",") > 0) {
annotations = annotations;
}
dicomViewer.loadCornerstone($(single_dicom), null, images, annotations);
}
@@ -112,24 +121,6 @@ function prepAnswerData() {
$("#id_marked_answers").val(JSON.stringify(window.marked_answers));
}
function getJsonToolStateNoId() {
const el = document.getElementById("dicom-image");
const c = cornerstone.getEnabledElement(el);
const toolStateManager = cornerstoneTools.globalImageIdSpecificToolStateManager;
const image_id = c.image.imageId;
const state_with_id = toolStateManager.saveToolState()
const json_tool_state = JSON.stringify(state_with_id[image_id]);
return json_tool_state;
}
function loadJsonToolStateOnCurrentImage(json) {
let el = document.getElementById("dicom-image");