This commit is contained in:
Ross
2021-08-20 10:26:58 +01:00
parent ad3094851d
commit 01c98cd2e1
12 changed files with 176 additions and 97 deletions
+1 -1
View File
@@ -178,7 +178,7 @@ function loadDicomViewer(images_to_load, annotations_to_load) {
console.log(images);
let annotations = single_dicom.dataset.annotations;
if (annotations != undefined) {
if (annotations_to_load != undefined) {
annotations = annotations_to_load;
} else if (annotations && annotations.indexOf(",") > 0) {
annotations = JSON.parse(annotations);
+3 -3
View File
@@ -11,6 +11,7 @@ cornerstoneWADOImageLoader.external.cornerstone = cornerstone;
cornerstoneTools.init();
let tool_state = {};
export function loadCornerstone(main_element, db, images, annotations_to_load, load_as_stack = false) {
@@ -180,15 +181,14 @@ export function loadCornerstone(main_element, db, images, annotations_to_load, l
function loadAnnotation(imageId, annotation) {
console.log("loadAnnotations", imageId, annotations);
console.log("loadAnnotations", imageId, annotation);
const toolStateManager = cornerstoneTools.globalImageIdSpecificToolStateManager;
if (annotation == undefined || annotation.length < 1 || annotation == [undefined]) { return }
console.log(annotation);
console.log("1234", annotation);
let tool_state_no_id = JSON.parse(annotation);
let tool_state = {};
tool_state[imageId] = tool_state_no_id;
toolStateManager.restoreToolState(tool_state);