.
This commit is contained in:
@@ -99,9 +99,26 @@
|
|||||||
|
|
||||||
// send request to change the is_private state on customSwitches toggle
|
// send request to change the is_private state on customSwitches toggle
|
||||||
$("#save-annotations").click(function () {
|
$("#save-annotations").click(function () {
|
||||||
json = getJsonToolStateNoId();
|
let el = $(".single-dicom-viewer").get(0);
|
||||||
|
|
||||||
console.log(json);
|
let c = cornerstone.getEnabledElement(el);
|
||||||
|
|
||||||
|
let toolStateManager = cornerstoneTools.globalImageIdSpecificToolStateManager;
|
||||||
|
|
||||||
|
//let image_id = c.image.imageId;
|
||||||
|
|
||||||
|
let toolstate = toolStateManager.saveToolState();
|
||||||
|
|
||||||
|
let images = document.getElementById("single-dicom-viewer").dataset.images;
|
||||||
|
|
||||||
|
let lson_toolstates = [];
|
||||||
|
for (cost image in images) {
|
||||||
|
json_toolstates.push(JSON.stringify(toolstate[image]));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
console.log(json_toolstates);
|
||||||
return
|
return
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "{% url 'rapids:question_save_annotation' pk=question.pk %}",
|
url: "{% url 'rapids:question_save_annotation' pk=question.pk %}",
|
||||||
@@ -354,22 +371,7 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function getJsonToolStateNoId() {
|
|
||||||
let el = $(".single-dicom-viewer").get(0);
|
|
||||||
|
|
||||||
let c = cornerstone.getEnabledElement(el);
|
|
||||||
|
|
||||||
let toolStateManager = cornerstoneTools.globalImageIdSpecificToolStateManager;
|
|
||||||
|
|
||||||
let image_id = c.image.imageId;
|
|
||||||
|
|
||||||
let state_with_id = toolStateManager.saveToolState()
|
|
||||||
|
|
||||||
const json_tool_state = JSON.stringify(state_with_id[image_id]);
|
|
||||||
|
|
||||||
return json_tool_state;
|
|
||||||
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
.toggle-button {
|
.toggle-button {
|
||||||
|
|||||||
Reference in New Issue
Block a user