.
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
<div>{{ series.modality}}, {{ series.examination }}, {{ series.plane }}, {{ series.contrast }}</div>
|
||||
|
||||
{% if series.case %}
|
||||
Associated case:
|
||||
{% for case in series.case.all %}
|
||||
<a href="{% url 'atlas:case_detail' pk=case.pk %}">{{case}}</a>
|
||||
{% endfor %}
|
||||
Associated case:
|
||||
{% for case in series.case.all %}
|
||||
<a href="{% url 'atlas:case_detail' pk=case.pk %}">{{case}}</a>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
This series is not associated with any cases.
|
||||
This series is not associated with any cases.
|
||||
{% endif %}
|
||||
|
||||
<div id="single-dicom-viewer" class="dicom-viewer" data-images="{{ series.get_image_url_array }}" data-annotations=''>
|
||||
@@ -21,13 +21,14 @@
|
||||
<summary>Findings</summary>
|
||||
|
||||
{% for finding in series.findings.all %}
|
||||
<div class="finding-box">
|
||||
<button class="view-finding-button" data-annotationjson={{finding.annotation_json}} data-viewportjson={{finding.viewport_json}}>Click to view</button>
|
||||
Finding(s): {{finding.findings.all|join:", "}}<br />
|
||||
Structure(s): {{finding.structure.all|join:", "}}<br />
|
||||
Description: {{finding.description}}<br />
|
||||
<a href="{% url 'atlas:delete_finding' pk=finding.pk %}" class="delete-finding-link">Delete finding</a>
|
||||
</div>
|
||||
<div class="finding-box">
|
||||
<button class="view-finding-button" data-annotationjson={{finding.annotation_json}}
|
||||
data-viewportjson={{finding.viewport_json}}>Click to view</button>
|
||||
Finding(s): {{finding.findings.all|join:", "}}<br />
|
||||
Structure(s): {{finding.structure.all|join:", "}}<br />
|
||||
Description: {{finding.description}}<br />
|
||||
<a href="{% url 'atlas:delete_finding' pk=finding.pk %}" class="delete-finding-link">Delete finding</a>
|
||||
</div>
|
||||
|
||||
{% endfor %}
|
||||
</details>
|
||||
@@ -47,8 +48,8 @@
|
||||
title="orders dicom by uploaded filename">Order by uploaded filename</a>
|
||||
</div>
|
||||
{% for image in series.images.all %}
|
||||
{{image.image.url}}, pos: {{image.position}}, {{image.upload_filename}} [{{image.image.size|filesizeformat}}]<br />
|
||||
{% comment %} {{image.get_dicom_info|safe}}<br /> {% endcomment %}
|
||||
{{image.image.url}}, pos: {{image.position}}, {{image.upload_filename}} [{{image.image.size|filesizeformat}}]<br />
|
||||
{% comment %} {{image.get_dicom_info|safe}}<br /> {% endcomment %}
|
||||
|
||||
{% endfor %}
|
||||
|
||||
@@ -60,11 +61,11 @@
|
||||
<form method="post" id="series_finding_form">
|
||||
{% csrf_token %}
|
||||
{{series_finding_form.management_form}}
|
||||
<ul>
|
||||
<li>Description: {{ series_finding_form.description }}</li>
|
||||
<li>Findings: {{ series_finding_form.findings }}</li>
|
||||
<li>Structures: {{ series_finding_form.structures }}</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li>Description: {{ series_finding_form.description }}</li>
|
||||
<li>Findings: {{ series_finding_form.findings }}</li>
|
||||
<li>Structures: {{ series_finding_form.structures }}</li>
|
||||
</ul>
|
||||
<input type="submit" value="Submit">
|
||||
</form>
|
||||
</div>
|
||||
@@ -73,17 +74,17 @@
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$("#add-finding-button").click(() => {
|
||||
dicom_element = $(".single-dicom-viewer").get(0);
|
||||
cornerstoneTools.globalImageIdSpecificToolStateManager.clear(dicom_element);
|
||||
cornerstone.reset(dicom_element);
|
||||
cornerstone.resize(dicom_element, true);
|
||||
dicom_element = $(".cornerstone-element").get(0);
|
||||
cornerstoneTools.globalImageIdSpecificToolStateManager.clear(dicom_element);
|
||||
cornerstone.reset(dicom_element);
|
||||
cornerstone.resize(dicom_element, true);
|
||||
$("#finding-form").empty().append(
|
||||
$("#hidden-form form").clone()
|
||||
);
|
||||
|
||||
});
|
||||
$("#reset-viewport-button").click(() => {
|
||||
dicom_element = $(".single-dicom-viewer").get(0);
|
||||
dicom_element = $(".cornerstone-element").get(0);
|
||||
//annotationjson = JSON.parse(e.currentTarget.dataset.annotationjson);
|
||||
cornerstoneTools.globalImageIdSpecificToolStateManager.clear(dicom_element);
|
||||
cornerstone.reset(dicom_element);
|
||||
@@ -93,10 +94,11 @@
|
||||
|
||||
$(".view-finding-button").each((n, el) => {
|
||||
$(el).click((e) => {
|
||||
dicom_element = $(".single-dicom-viewer").get(0);
|
||||
dicom_element = $(".cornerstone-element").get(0);
|
||||
annotationjson = JSON.parse(e.currentTarget.dataset.annotationjson);
|
||||
viewport = JSON.parse(e.currentTarget.dataset.viewportjson);
|
||||
cornerstoneTools.globalImageIdSpecificToolStateManager.restoreToolState(annotationjson);
|
||||
cornerstoneTools.globalImageIdSpecificToolStateManager.restoreToolState(
|
||||
annotationjson);
|
||||
console.log(annotationjson)
|
||||
//cornerstone.getEnabledElement(dicom_element).toolStateManager.restoreToolState(annotationjson)
|
||||
cornerstone.getEnabledElement(dicom_element).viewport = viewport
|
||||
@@ -109,7 +111,7 @@
|
||||
});
|
||||
|
||||
$(document).on('submit', '#series_finding_form', function (e) {
|
||||
dicom_element = $(".single-dicom-viewer").get(0);
|
||||
dicom_element = $(".cornerstone-element").get(0);
|
||||
c = cornerstone.getEnabledElement(dicom_element);
|
||||
e.preventDefault();
|
||||
|
||||
@@ -118,11 +120,19 @@
|
||||
url: '{% url "atlas:add_finding" %}',
|
||||
data: {
|
||||
description: $('#id_description').val(),
|
||||
series: {{series.pk}},
|
||||
series: {
|
||||
{
|
||||
series.pk
|
||||
}
|
||||
},
|
||||
//annotation_json: JSON.stringify(c.toolStateManager.saveToolState()),
|
||||
annotation_json: JSON.stringify(cornerstoneTools.globalImageIdSpecificToolStateManager.saveToolState()),
|
||||
annotation_json: JSON.stringify(cornerstoneTools.globalImageIdSpecificToolStateManager
|
||||
.saveToolState()),
|
||||
viewport_json: JSON.stringify(c.viewport),
|
||||
findings: JSON.stringify($('#finding-form select[name="findings"]').find(":selected").map((i, el) => { return $(el).val() }).toArray()),
|
||||
findings: JSON.stringify($('#finding-form select[name="findings"]').find(":selected")
|
||||
.map((i, el) => {
|
||||
return $(el).val()
|
||||
}).toArray()),
|
||||
csrfmiddlewaretoken: $('input[name=csrfmiddlewaretoken]').val(),
|
||||
action: 'post'
|
||||
},
|
||||
@@ -133,8 +143,8 @@
|
||||
},
|
||||
error: function (xhr, errmsg, err) {
|
||||
console.log(xhr.status + ": " + xhr
|
||||
.responseText); // provide a bit more info about the error to the console
|
||||
.responseText); // provide a bit more info about the error to the console
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
@@ -104,7 +104,7 @@
|
||||
|
||||
// send request to change the is_private state on customSwitches toggle
|
||||
$("#save-annotations").click(function () {
|
||||
let el = $(".single-dicom-viewer").get(0);
|
||||
let el = $(".cornerstone-element").get(0);
|
||||
|
||||
let c = cornerstone.getEnabledElement(el);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user