This commit is contained in:
Ross
2021-08-20 12:28:19 +01:00
parent eb11f0c7de
commit eb2efa8f44
4 changed files with 9 additions and 4 deletions
+2 -1
View File
@@ -159,7 +159,8 @@ window.addEventListener('loadDicomViewer', function (e) {
window.loadDicomViewerEvent = new Event('loadDicomViewerUrls'); window.loadDicomViewerEvent = new Event('loadDicomViewerUrls');
window.addEventListener('loadDicomViewerUrls', function (e) { window.addEventListener('loadDicomViewerUrls', function (e) {
loadDicomViewer(e.detail);
loadDicomViewer(e.detail.images, e.detail.annotations);
}, false); }, false);
function loadDicomViewer(images_to_load, annotations_to_load) { function loadDicomViewer(images_to_load, annotations_to_load) {
+4 -1
View File
@@ -349,13 +349,16 @@ class Rapid(models.Model):
# Loop through rapidimage associations # Loop through rapidimage associations
images = [] images = []
#annotations = []
feedback_images = [] feedback_images = []
for i in self.images.all(): for i in self.images.all():
#annotations.append(i.image_annotations)
if i.feedback_image == True: if i.feedback_image == True:
if based: if based:
feedback_images.append(image_as_base64(i.image)) feedback_images.append(image_as_base64(i.image))
else: else:
feedback_images.append("{}/{}".format(settings.REMOTE_URL, i.image.url)) feedback_images.append("{}/{}".format(settings.REMOTE_URL, i.image.url))
feedback_images.append("{}/{}".format(settings.REMOTE_URL, i.image.url))
else: else:
if based: if based:
images.append(image_as_base64(i.image)) images.append(image_as_base64(i.image))
@@ -367,7 +370,7 @@ class Rapid(models.Model):
json = { json = {
"images": images, "images": images,
#"feedback_image": [], #"feedback_image": [],
#"annotations": [str(q.image_annotations)], "annotations": self.get_image_annotations(),
"type": "rapid", "type": "rapid",
} }
@@ -47,7 +47,7 @@
console.log(data); console.log(data);
let event = new CustomEvent('loadDicomViewerUrls', { let event = new CustomEvent('loadDicomViewerUrls', {
"detail": data.images "detail": {"images" : data.images, "annotations" : data.annotations}
}); });
window.dispatchEvent(event); window.dispatchEvent(event);
+2 -1
View File
@@ -159,7 +159,8 @@ window.addEventListener('loadDicomViewer', function (e) {
window.loadDicomViewerEvent = new Event('loadDicomViewerUrls'); window.loadDicomViewerEvent = new Event('loadDicomViewerUrls');
window.addEventListener('loadDicomViewerUrls', function (e) { window.addEventListener('loadDicomViewerUrls', function (e) {
loadDicomViewer(e.detail);
loadDicomViewer(e.detail.images, e.detail.annotations);
}, false); }, false);
function loadDicomViewer(images_to_load, annotations_to_load) { function loadDicomViewer(images_to_load, annotations_to_load) {