diff --git a/anatomy/static/js/anatomy.js b/anatomy/static/js/anatomy.js index d05c23d8..477e3fc0 100644 --- a/anatomy/static/js/anatomy.js +++ b/anatomy/static/js/anatomy.js @@ -159,7 +159,8 @@ window.addEventListener('loadDicomViewer', function (e) { window.loadDicomViewerEvent = new Event('loadDicomViewerUrls'); window.addEventListener('loadDicomViewerUrls', function (e) { - loadDicomViewer(e.detail); + + loadDicomViewer(e.detail.images, e.detail.annotations); }, false); function loadDicomViewer(images_to_load, annotations_to_load) { diff --git a/rapids/models.py b/rapids/models.py index 50d42679..49abd7a2 100644 --- a/rapids/models.py +++ b/rapids/models.py @@ -349,13 +349,16 @@ class Rapid(models.Model): # Loop through rapidimage associations images = [] + #annotations = [] feedback_images = [] for i in self.images.all(): + #annotations.append(i.image_annotations) if i.feedback_image == True: if based: feedback_images.append(image_as_base64(i.image)) else: feedback_images.append("{}/{}".format(settings.REMOTE_URL, i.image.url)) + feedback_images.append("{}/{}".format(settings.REMOTE_URL, i.image.url)) else: if based: images.append(image_as_base64(i.image)) @@ -367,7 +370,7 @@ class Rapid(models.Model): json = { "images": images, #"feedback_image": [], - #"annotations": [str(q.image_annotations)], + "annotations": self.get_image_annotations(), "type": "rapid", } diff --git a/rapids/templates/rapids/exam_scores_user.html b/rapids/templates/rapids/exam_scores_user.html index 39ef9d54..d4117d65 100644 --- a/rapids/templates/rapids/exam_scores_user.html +++ b/rapids/templates/rapids/exam_scores_user.html @@ -47,7 +47,7 @@ console.log(data); let event = new CustomEvent('loadDicomViewerUrls', { - "detail": data.images + "detail": {"images" : data.images, "annotations" : data.annotations} }); window.dispatchEvent(event); diff --git a/static/js/anatomy.js b/static/js/anatomy.js index d05c23d8..477e3fc0 100644 --- a/static/js/anatomy.js +++ b/static/js/anatomy.js @@ -159,7 +159,8 @@ window.addEventListener('loadDicomViewer', function (e) { window.loadDicomViewerEvent = new Event('loadDicomViewerUrls'); window.addEventListener('loadDicomViewerUrls', function (e) { - loadDicomViewer(e.detail); + + loadDicomViewer(e.detail.images, e.detail.annotations); }, false); function loadDicomViewer(images_to_load, annotations_to_load) {