This commit is contained in:
Ross
2021-12-04 22:49:25 +00:00
parent af31ffb834
commit eaa2b4e74b
+16 -10
View File
@@ -38,7 +38,7 @@ This series is not associated with any cases.
{% for finding in series.findings.all %} {% for finding in series.findings.all %}
<div class="finding-box"> <div class="finding-box">
<button class="view-finding-button" data-annotationjson={{finding.annotation_json}} <button class="view-finding-button" data-annotationjson={{finding.annotation_json}}
data-viewportjson={{finding.viewport_json}}>Click to view</button> data-viewportjson={{finding.viewport_json}} data-findingid={{finding.id}}>Click to view</button>
<span class="view-finding-details"> <span class="view-finding-details">
Finding(s): {{finding.findings.all|join:", "}}<br /> Finding(s): {{finding.findings.all|join:", "}}<br />
Structure(s): {{finding.structures.all|join:", "}}<br /> Structure(s): {{finding.structures.all|join:", "}}<br />
@@ -94,6 +94,7 @@ This series is not associated with any cases.
{% if editing_finding > 0 %} {% if editing_finding > 0 %}
$("#hidden-form").show() $("#hidden-form").show()
$(".view-finding-button[data-findingid={{editing_finding}}]").trigger("click");
{% endif %} {% endif %}
@@ -111,14 +112,7 @@ This series is not associated with any cases.
dicom_element = $(".cornerstone-element").get(0); dicom_element = $(".cornerstone-element").get(0);
annotationjson = JSON.parse(e.currentTarget.dataset.annotationjson); annotationjson = JSON.parse(e.currentTarget.dataset.annotationjson);
viewport = JSON.parse(e.currentTarget.dataset.viewportjson); viewport = JSON.parse(e.currentTarget.dataset.viewportjson);
cornerstoneTools.globalImageIdSpecificToolStateManager.restoreToolState( loadAnnotationAndViewportOnElement(annotationjson, viewport, dicom_element);
annotationjson);
console.log(annotationjson)
//cornerstone.getEnabledElement(dicom_element).toolStateManager.restoreToolState(annotationjson)
cornerstone.getEnabledElement(dicom_element).viewport = viewport
cornerstone.resize(dicom_element);
dicomViewer.getNextAnnotationImage(dicom_element);
}); });
@@ -126,6 +120,18 @@ This series is not associated with any cases.
}); });
}); });
loadAnnotationOnElement(annotation, element) {
cornerstoneTools.globalImageIdSpecificToolStateManager.restoreToolState(
annotationjson);
console.log(annotationjson)
//cornerstone.getEnabledElement(dicom_element).toolStateManager.restoreToolState(annotationjson)
cornerstone.getEnabledElement(dicom_element).viewport = viewport
cornerstone.resize(dicom_element);
dicomViewer.getNextAnnotationImage(dicom_element);
}
$(document).on('submit', '#series_finding_form', function (e) { $(document).on('submit', '#series_finding_form', function (e) {
dicom_element = $(".cornerstone-element").get(0); dicom_element = $(".cornerstone-element").get(0);
c = cornerstone.getEnabledElement(dicom_element); c = cornerstone.getEnabledElement(dicom_element);
@@ -157,7 +163,7 @@ This series is not associated with any cases.
success: function (json) { success: function (json) {
$("#finding-form").empty(); $("#finding-form").empty();
toastr.info('Finding added.'); toastr.info('Finding added.');
//location.reload(); location.reload();
}, },
error: function (xhr, errmsg, err) { error: function (xhr, errmsg, err) {
console.log(xhr.status + ": " + xhr console.log(xhr.status + ": " + xhr