fix some more loading errors

This commit is contained in:
Ross
2024-10-07 09:20:09 +01:00
parent ea42f7f0c7
commit 6f96f79303
2 changed files with 15 additions and 3 deletions
+11 -3
View File
@@ -288,8 +288,13 @@
console.log("loading stack index")
dicomViewer.loadStackIndex(current_image_id_index, dicom_element);
} else {
console.log("loading next annotation image")
dicomViewer.getNextAnnotationImage(dicom_element);
try {
dicomViewer.loadImageById(current_image_id_index, dicom_element);
} catch (e) {
console.log("loading image by id failed")
console.log("loading next annotation image")
dicomViewer.getNextAnnotationImage(dicom_element);
}
}
}
@@ -307,7 +312,10 @@
description: $('#id_description').val(),
series: {{ series.pk }},
//annotation_json: JSON.stringify(c.toolStateManager.saveToolState()),
current_image_id_index: c.toolStateManager.toolState.stack.data[0].currentImageIdIndex,
// This is the stack number
//current_image_id_index: c.toolStateManager.toolState.stack.data[0].currentImageIdIndex,
// but we want to use the current image id (so if the stack is reordered it still attaches to the correct image)
current_image_id_index: c.toolStateManager.toolState.stack.data[0].imageIds[c.toolStateManager.toolState.stack.data[0].currentImageIdIndex],
annotation_json: JSON.stringify(cornerstoneTools.globalImageIdSpecificToolStateManager
.saveToolState()),
viewport_json: JSON.stringify(c.viewport),