.
This commit is contained in:
@@ -162,7 +162,7 @@ window.addEventListener('loadDicomViewerUrls', function (e) {
|
|||||||
loadDicomViewer(e.detail);
|
loadDicomViewer(e.detail);
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
function loadDicomViewer(images_to_load) {
|
function loadDicomViewer(images_to_load, annotations_to_load) {
|
||||||
console.log("loadDicomViewer", images_to_load);
|
console.log("loadDicomViewer", images_to_load);
|
||||||
let single_dicom = document.getElementById("single-dicom-viewer");
|
let single_dicom = document.getElementById("single-dicom-viewer");
|
||||||
if (single_dicom) {
|
if (single_dicom) {
|
||||||
@@ -171,17 +171,21 @@ function loadDicomViewer(images_to_load) {
|
|||||||
|
|
||||||
if (images_to_load != undefined) {
|
if (images_to_load != undefined) {
|
||||||
images = images_to_load;
|
images = images_to_load;
|
||||||
console.log("i1", images)
|
|
||||||
} else if (images.indexOf(",") > 0) {
|
} else if (images.indexOf(",") > 0) {
|
||||||
images = images.split(",");
|
images = JSON.parse(images);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(images);
|
console.log(images);
|
||||||
|
|
||||||
let annotations = single_dicom.dataset.annotations;
|
let annotations = single_dicom.dataset.annotations;
|
||||||
if (annotations != undefined && annotations.indexOf(",") > 0) {
|
if (annotations != undefined) {
|
||||||
annotations = annotations;
|
annotations = annotations_to_load;
|
||||||
|
} else if (annotations && annotations.indexOf(",") > 0) {
|
||||||
|
annotations = JSON.parse(annotations);
|
||||||
|
} else {
|
||||||
|
annotations = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
let load_as_stack;
|
let load_as_stack;
|
||||||
if (images.length > 5) {
|
if (images.length > 5) {
|
||||||
load_as_stack = true;
|
load_as_stack = true;
|
||||||
|
|||||||
@@ -171,6 +171,9 @@ class Long(models.Model):
|
|||||||
["https://www.penracourses.org.uk{}".format(i.url) for i in self.get_images()]
|
["https://www.penracourses.org.uk{}".format(i.url) for i in self.get_images()]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def get_image_url_array(self):
|
||||||
|
return ["https://www.penracourses.org.uk{}".format(i.url) for i in self.get_images()]
|
||||||
|
|
||||||
def get_unmarked_answer_count(self):
|
def get_unmarked_answer_count(self):
|
||||||
answers = self.cid_user_answers.all()
|
answers = self.cid_user_answers.all()
|
||||||
return len([ans for ans in answers if not ans.is_marked()])
|
return len([ans for ans in answers if not ans.is_marked()])
|
||||||
@@ -416,6 +419,14 @@ class LongSeries(models.Model):
|
|||||||
|
|
||||||
return ",".join(images)
|
return ",".join(images)
|
||||||
|
|
||||||
|
def get_image_url_array(self, feedback=False):
|
||||||
|
images = [
|
||||||
|
"https://www.penracourses.org.uk{}".format(i.image.url)
|
||||||
|
for i in self.images.all()
|
||||||
|
]
|
||||||
|
|
||||||
|
return images
|
||||||
|
|
||||||
def get_thumbnail(self):
|
def get_thumbnail(self):
|
||||||
images = self.images.all()
|
images = self.images.all()
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ Associated case:
|
|||||||
This series is not associated with any cases.
|
This series is not associated with any cases.
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div id="single-dicom-viewer" class="dicom-viewer" data-images="{{ series.get_image_urls }}" data-annotations=''></div>
|
<div id="single-dicom-viewer" class="dicom-viewer" data-images="{{ series.get_image_url_array }}" data-annotations=''></div>
|
||||||
|
|
||||||
<div>Author: {{ series.get_author_display }}</div>
|
<div>Author: {{ series.get_author_display }}</div>
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ Answers will be automatically marked.
|
|||||||
Answers marked as normal will be automatically marked.<br/>
|
Answers marked as normal will be automatically marked.<br/>
|
||||||
Region: {{ question.get_regions }}, Abnormalities: {{ question.get_abnormalities }}
|
Region: {{ question.get_regions }}, Abnormalities: {{ question.get_abnormalities }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div id="single-dicom-viewer" class="marking-dicom" data-images="{{question.get_image_urls}}"
|
<div id="single-dicom-viewer" class="marking-dicom" data-images="{{question.get_image_url_array}}"
|
||||||
data-annotations='{{question.image_annotations}}'>
|
data-annotations='{{question.image_annotations}}'>
|
||||||
</div>
|
</div>
|
||||||
<div class="marking">
|
<div class="marking">
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ window.addEventListener('loadDicomViewerUrls', function (e) {
|
|||||||
loadDicomViewer(e.detail);
|
loadDicomViewer(e.detail);
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
function loadDicomViewer(images_to_load) {
|
function loadDicomViewer(images_to_load, annotations_to_load) {
|
||||||
console.log("loadDicomViewer", images_to_load);
|
console.log("loadDicomViewer", images_to_load);
|
||||||
let single_dicom = document.getElementById("single-dicom-viewer");
|
let single_dicom = document.getElementById("single-dicom-viewer");
|
||||||
if (single_dicom) {
|
if (single_dicom) {
|
||||||
@@ -171,17 +171,21 @@ function loadDicomViewer(images_to_load) {
|
|||||||
|
|
||||||
if (images_to_load != undefined) {
|
if (images_to_load != undefined) {
|
||||||
images = images_to_load;
|
images = images_to_load;
|
||||||
console.log("i1", images)
|
|
||||||
} else if (images.indexOf(",") > 0) {
|
} else if (images.indexOf(",") > 0) {
|
||||||
images = images.split(",");
|
images = JSON.parse(images);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(images);
|
console.log(images);
|
||||||
|
|
||||||
let annotations = single_dicom.dataset.annotations;
|
let annotations = single_dicom.dataset.annotations;
|
||||||
if (annotations != undefined && annotations.indexOf(",") > 0) {
|
if (annotations != undefined) {
|
||||||
annotations = annotations;
|
annotations = annotations_to_load;
|
||||||
|
} else if (annotations && annotations.indexOf(",") > 0) {
|
||||||
|
annotations = JSON.parse(annotations);
|
||||||
|
} else {
|
||||||
|
annotations = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
let load_as_stack;
|
let load_as_stack;
|
||||||
if (images.length > 5) {
|
if (images.length > 5) {
|
||||||
load_as_stack = true;
|
load_as_stack = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user