remove renamed file
This commit is contained in:
@@ -1,172 +0,0 @@
|
|||||||
<div>{{ series.modality}}, {{ series.examination }}, {{ series.plane }}, {{ series.contrast }}</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div id="single-dicom-viewer" class="dicom-viewer" data-images="{{ series.get_image_url_array }}" data-annotations=''>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% if editing_finding < 1 %}
|
|
||||||
<button id="add-finding-button">Add finding</button>
|
|
||||||
{% endif %}
|
|
||||||
<button id="reset-viewport-button">Reset viewport</button>
|
|
||||||
<div id="finding-form">
|
|
||||||
<div class="hide" id="hidden-form">
|
|
||||||
<form method="post" id="series_finding_form">
|
|
||||||
{% csrf_token %}
|
|
||||||
{{series_finding_form.management_form}}
|
|
||||||
<div>
|
|
||||||
<div>Description: {{ series_finding_form.description }}</div>
|
|
||||||
<div>Findings: {{ series_finding_form.findings }}</div>
|
|
||||||
<div>Structures: {{ series_finding_form.structures }}</div>
|
|
||||||
</div>
|
|
||||||
<input type="submit" value="Submit">
|
|
||||||
<button id="cancel-add-finding-button">Cancel</button>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<details open>
|
|
||||||
<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}} data-findingid={{finding.id}}>Click to view</button>
|
|
||||||
<span class="view-finding-details">
|
|
||||||
Finding(s): {% for f in finding.findings.all %}{{f.get_link}}{% endfor %}<br />
|
|
||||||
Structure(s): {% for s in finding.structures.all %}{{s.get_link}}{% endfor %}<br />
|
|
||||||
Description: {{finding.description}}<br />
|
|
||||||
</span>
|
|
||||||
<a href="{% url 'atlas:series_edit_finding' pk=series.pk finding_pk=finding.pk %}" class="edit-finding-link">Edit</a>
|
|
||||||
<a href="{% url 'atlas:delete_finding' pk=finding.pk %}" class="delete-finding-link">Delete</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% endfor %}
|
|
||||||
</details>
|
|
||||||
|
|
||||||
|
|
||||||
<div>Author: {{ series.get_author_display }}</div>
|
|
||||||
<details>
|
|
||||||
<summary>Image info</summary>
|
|
||||||
<div>
|
|
||||||
<a href="{% url 'atlas:series_order_dicom' pk=series.pk %}" title="orders dicom by slice location">Order dicoms
|
|
||||||
by slice location</a>
|
|
||||||
<a href="{% url 'atlas:series_order_dicom_instance' pk=series.pk %}"
|
|
||||||
title="orders dicom by instance number">Order dicoms by instance number</a>
|
|
||||||
<a href="{% url 'atlas:series_order_dicom_SeriesInstanceUID' pk=series.pk %}"
|
|
||||||
title="orders dicom by instance number">Order dicoms by SeriesInstanceUID</a>
|
|
||||||
<a href="{% url 'atlas:series_order_upload_filename' pk=series.pk %}"
|
|
||||||
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 %}
|
|
||||||
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
<p>Total image size: {{series.get_total_image_size|filesizeformat}}</p>
|
|
||||||
<p><a href="{% url 'atlas:series_download' pk=series.pk %}">Download images</a></p>
|
|
||||||
</details>
|
|
||||||
|
|
||||||
|
|
||||||
<script>
|
|
||||||
$(document).ready(function () {
|
|
||||||
$("#add-finding-button").click(() => {
|
|
||||||
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()
|
|
||||||
//);
|
|
||||||
$("#hidden-form").show()
|
|
||||||
|
|
||||||
});
|
|
||||||
$("#cancel-add-finding-button").click((e) => {
|
|
||||||
$("#hidden-form").hide()
|
|
||||||
e.preventDefault();
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
$("#reset-viewport-button").click(() => {
|
|
||||||
dicom_element = $(".cornerstone-element").get(0);
|
|
||||||
//annotationjson = JSON.parse(e.currentTarget.dataset.annotationjson);
|
|
||||||
cornerstoneTools.globalImageIdSpecificToolStateManager.clear(dicom_element);
|
|
||||||
cornerstone.reset(dicom_element);
|
|
||||||
cornerstone.resize(dicom_element, true);
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
$(".view-finding-button").each((n, el) => {
|
|
||||||
$(el).click((e) => {
|
|
||||||
dicom_element = $(".cornerstone-element").get(0);
|
|
||||||
annotationjson = JSON.parse(e.currentTarget.dataset.annotationjson);
|
|
||||||
viewport = JSON.parse(e.currentTarget.dataset.viewportjson);
|
|
||||||
loadAnnotationAndViewportOnElement(annotationjson, viewport, dicom_element);
|
|
||||||
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
{% if editing_finding > 0 %}
|
|
||||||
$("#hidden-form").show()
|
|
||||||
setTimeout(function() {
|
|
||||||
$(".view-finding-button[data-findingid={{editing_finding}}]").trigger("click");
|
|
||||||
}, 1000)
|
|
||||||
|
|
||||||
{% endif %}
|
|
||||||
});
|
|
||||||
|
|
||||||
function loadAnnotationAndViewportOnElement(annotation, viewport, dicom_element) {
|
|
||||||
cornerstoneTools.globalImageIdSpecificToolStateManager.clear(dicom_element);
|
|
||||||
cornerstone.getEnabledElement(dicom_element).viewport = viewport
|
|
||||||
cornerstoneTools.globalImageIdSpecificToolStateManager.restoreToolState(
|
|
||||||
annotation);
|
|
||||||
console.log(annotation)
|
|
||||||
//cornerstone.getEnabledElement(dicom_element).toolStateManager.restoreToolState(annotationjson)
|
|
||||||
cornerstone.resize(dicom_element);
|
|
||||||
|
|
||||||
dicomViewer.getNextAnnotationImage(dicom_element);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
$(document).on('submit', '#series_finding_form', function (e) {
|
|
||||||
dicom_element = $(".cornerstone-element").get(0);
|
|
||||||
c = cornerstone.getEnabledElement(dicom_element);
|
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
$.ajax({
|
|
||||||
type: 'POST',
|
|
||||||
url: '{% url "atlas:add_finding" %}',
|
|
||||||
data: {
|
|
||||||
series_finding_id: {{ editing_finding }},
|
|
||||||
description: $('#id_description').val(),
|
|
||||||
series: {{ series.pk }},
|
|
||||||
//annotation_json: JSON.stringify(c.toolStateManager.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()),
|
|
||||||
structures: JSON.stringify($('#finding-form select[name="structures"]').find(
|
|
||||||
":selected")
|
|
||||||
.map((i, el) => {
|
|
||||||
return $(el).val()
|
|
||||||
}).toArray()),
|
|
||||||
csrfmiddlewaretoken: $('input[name=csrfmiddlewaretoken]').val(),
|
|
||||||
action: 'post'
|
|
||||||
},
|
|
||||||
success: function (json) {
|
|
||||||
$("#finding-form").empty();
|
|
||||||
toastr.info('Finding added.');
|
|
||||||
location.href='{{series.get_absolute_url}}';
|
|
||||||
},
|
|
||||||
error: function (xhr, errmsg, err) {
|
|
||||||
console.log(xhr.status + ": " + xhr
|
|
||||||
.responseText); // provide a bit more info about the error to the console
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
Reference in New Issue
Block a user