From d53a4b8409f0b36b6537243dbff7a135a1fbbd7f Mon Sep 17 00:00:00 2001 From: Ross Date: Tue, 23 Nov 2021 22:38:30 +0000 Subject: [PATCH] . --- .../templates/atlas/atlas_confirm_delete.html | 1 + atlas/templates/atlas/author_list.html | 8 + atlas/templates/atlas/base.html | 28 ++ atlas/templates/atlas/case_detail.html | 20 + atlas/templates/atlas/case_display_block.html | 47 +++ atlas/templates/atlas/case_form.html | 73 ++++ atlas/templates/atlas/case_view.html | 21 ++ atlas/templates/atlas/category_detail.html | 13 + atlas/templates/atlas/index.html | 4 + atlas/templates/atlas/series.html | 11 + .../atlas/series_confirm_delete.html | 1 + atlas/templates/atlas/series_form.html | 357 ++++++++++++++++++ atlas/templates/atlas/series_viewer.html | 35 ++ atlas/templates/atlas/view.html | 21 ++ atlas/urls.py | 2 +- 15 files changed, 641 insertions(+), 1 deletion(-) create mode 100644 atlas/templates/atlas/atlas_confirm_delete.html create mode 100755 atlas/templates/atlas/author_list.html create mode 100755 atlas/templates/atlas/base.html create mode 100755 atlas/templates/atlas/case_detail.html create mode 100755 atlas/templates/atlas/case_display_block.html create mode 100755 atlas/templates/atlas/case_form.html create mode 100644 atlas/templates/atlas/case_view.html create mode 100755 atlas/templates/atlas/category_detail.html create mode 100644 atlas/templates/atlas/index.html create mode 100755 atlas/templates/atlas/series.html create mode 100644 atlas/templates/atlas/series_confirm_delete.html create mode 100755 atlas/templates/atlas/series_form.html create mode 100755 atlas/templates/atlas/series_viewer.html create mode 100755 atlas/templates/atlas/view.html diff --git a/atlas/templates/atlas/atlas_confirm_delete.html b/atlas/templates/atlas/atlas_confirm_delete.html new file mode 100644 index 00000000..10ac7f23 --- /dev/null +++ b/atlas/templates/atlas/atlas_confirm_delete.html @@ -0,0 +1 @@ +{% include 'confirm_delete.html' %} \ No newline at end of file diff --git a/atlas/templates/atlas/author_list.html b/atlas/templates/atlas/author_list.html new file mode 100755 index 00000000..c9f24e20 --- /dev/null +++ b/atlas/templates/atlas/author_list.html @@ -0,0 +1,8 @@ +{% extends 'atlas/base.html' %} + +{% block content %} + +{% for author in authors %} +

Author: {{author.username}},

+{% endfor %} +{% endblock %} \ No newline at end of file diff --git a/atlas/templates/atlas/base.html b/atlas/templates/atlas/base.html new file mode 100755 index 00000000..0ae55420 --- /dev/null +++ b/atlas/templates/atlas/base.html @@ -0,0 +1,28 @@ +{% extends 'base.html' %} + +{% block title %} +Longs +{% endblock %} + +{% block css %} +{% endblock %} + +{% block js %} +{% endblock %} + + + +{% block content %} +{% endblock %} +{% block navigation %} +Longs: +{% if request.user.is_authenticated %} +Cases / +Series / +Create Case / +Create Series +{% endif %} +{% comment %}
+Questions by: +author {% endcomment %} +{% endblock %} \ No newline at end of file diff --git a/atlas/templates/atlas/case_detail.html b/atlas/templates/atlas/case_detail.html new file mode 100755 index 00000000..c5be316f --- /dev/null +++ b/atlas/templates/atlas/case_detail.html @@ -0,0 +1,20 @@ +{% extends 'atlas/base.html' %} + +{% block content %} + + + +
+Edit +Clone +Delete + Add Note +{% if request.user.is_superuser %} +Admin Edit +{% endif %} +{% include 'atlas/atlas_display_block.html' %} +{% endblock %} + +{% block js %} + +{% endblock %} \ No newline at end of file diff --git a/atlas/templates/atlas/case_display_block.html b/atlas/templates/atlas/case_display_block.html new file mode 100755 index 00000000..9812732c --- /dev/null +++ b/atlas/templates/atlas/case_display_block.html @@ -0,0 +1,47 @@ +
+
+ {{ question.created_date|date:"d/m/Y" }} +
+
+ ID: {{ question.id }} +
+

Description: {{ question.description }}

+ +

History: {{ question.history }}

+ +
Series: + {% for series in question.series.all %} + + + Series {{ forloop.counter }}: + + {{series.get_block}} + + + Popup + + + {% endfor %} + Add new series
+
+

Author(s): {% for author in question.author.all %} {{author}}, {% endfor %}

+

Checked by: {% for verified in question.verified.all %} {{verified}}, {% endfor %}

+ {% comment %}

Scrapped: {{ question.scrapped }} (toggle) {% endcomment %} + +

+

+

+ Findings +
{{ question.findings | safe}}
+
+

+
+

+
+ {% include 'question_notes.html' %} + +
\ No newline at end of file diff --git a/atlas/templates/atlas/case_form.html b/atlas/templates/atlas/case_form.html new file mode 100755 index 00000000..2740f3dc --- /dev/null +++ b/atlas/templates/atlas/case_form.html @@ -0,0 +1,73 @@ +{% extends "atlas/base.html" %} + + +{% block css %} +{{form.media}} +{% endblock %} +{% block js %} + + + + + +{% endblock %} +{% block content %} +

Submit Long Case

+Use this form to create a atlas case. Existing associated image sets can be added using this form. +
+ {% csrf_token %} + + + {{ form.as_table }} +
+

Series:

+ Add image sets here. These can only be added once created (they can also be added to cases on creation). + +
+ {% for form in series_formset %} +
    + {{form.non_field_errors}} + {{form.errors}} + {{ form.as_ul }} +
+ {% endfor %} +
+ {{ series_formset.management_form }} + +
+ +{% endblock %} \ No newline at end of file diff --git a/atlas/templates/atlas/case_view.html b/atlas/templates/atlas/case_view.html new file mode 100644 index 00000000..802f4b9d --- /dev/null +++ b/atlas/templates/atlas/case_view.html @@ -0,0 +1,21 @@ +{% extends 'atlas/base.html' %} + +{% load render_table from django_tables2 %} +{% block css %} +{% endblock %} + +{% block content %} + +
+

Filter Long

+
+ {{ filter.form }} + +
+
+{% render_table table %} + +{% endblock %} + +{% block js %} +{% endblock %} \ No newline at end of file diff --git a/atlas/templates/atlas/category_detail.html b/atlas/templates/atlas/category_detail.html new file mode 100755 index 00000000..759b55d0 --- /dev/null +++ b/atlas/templates/atlas/category_detail.html @@ -0,0 +1,13 @@ +{% extends 'atlas/base.html' %} + +{% block content %} +{{category}}: + + +{% endblock %} \ No newline at end of file diff --git a/atlas/templates/atlas/index.html b/atlas/templates/atlas/index.html new file mode 100644 index 00000000..b862e2ee --- /dev/null +++ b/atlas/templates/atlas/index.html @@ -0,0 +1,4 @@ +{% extends 'atlas/base.html' %} + +{% block content %} +{% endblock %} \ No newline at end of file diff --git a/atlas/templates/atlas/series.html b/atlas/templates/atlas/series.html new file mode 100755 index 00000000..b248170f --- /dev/null +++ b/atlas/templates/atlas/series.html @@ -0,0 +1,11 @@ + +{% extends "atlas/base.html" %} + +{% block content %} +Edit +{% if request.user.is_superuser %} +Admin Edit +{% endif %} + +{% include 'atlas/series_viewer.html' %} +{% endblock %} \ No newline at end of file diff --git a/atlas/templates/atlas/series_confirm_delete.html b/atlas/templates/atlas/series_confirm_delete.html new file mode 100644 index 00000000..10ac7f23 --- /dev/null +++ b/atlas/templates/atlas/series_confirm_delete.html @@ -0,0 +1 @@ +{% include 'confirm_delete.html' %} \ No newline at end of file diff --git a/atlas/templates/atlas/series_form.html b/atlas/templates/atlas/series_form.html new file mode 100755 index 00000000..89c61da9 --- /dev/null +++ b/atlas/templates/atlas/series_form.html @@ -0,0 +1,357 @@ +{% extends "atlas/base.html" %} + +{% load static %} + +{% block js %} + + + + +{{ form.media }} +{% endblock %} +{% block content %} +

Add Series

+ +This form will create a image set that can be associated with a atlas question. If the question has already been created it can be linked below. +
+ {% csrf_token %} + + + {{ form.as_table }} +
+ +

Images:

+ +
Drop images here (or use the buttons below). Dropping images here will overwrite existing images in the series. When drag and dropping make sure to drag the first image or the order will not be maintained. Note: dicom images are often not exported in order (although their order can be automatically detected once uploaded) +
+
+
+
+ {% for form in image_formset %} +
    + {{form.non_field_errors}} + {{form.errors}} + {{ form.as_ul }} +
+ {% endfor %} +
+ {{ image_formset.management_form }} + +
+ +
+ +
+{% endblock %} \ No newline at end of file diff --git a/atlas/templates/atlas/series_viewer.html b/atlas/templates/atlas/series_viewer.html new file mode 100755 index 00000000..017f6da7 --- /dev/null +++ b/atlas/templates/atlas/series_viewer.html @@ -0,0 +1,35 @@ +
{{ series.modality}}, {{ series.examination }}, {{ series.plane }}, {{ series.contrast }}
+ +{% if series.atlas %} +Associated case: +{% for atlas in series.atlas.all %} +{{atlas}} +{% endfor %} +{% else %} +This series is not associated with any cases. +{% endif %} + +
+ +
Author: {{ series.get_author_display }}
+
+ Image info +
+ Order dicoms + by slice location + Order dicoms by instance number + Order dicoms by SeriesInstanceUID + Order by uploaded filename +
+{% for image in series.images.all %} +{{image.image.url}}, pos: {{image.position}}, {{image.upload_filename}} [{{image.image.size|filesizeformat}}]
+{% comment %} {{image.get_dicom_info|safe}}
{% endcomment %} + +{% endfor %} + +

Total image size: {{series.get_total_image_size|filesizeformat}}

+

Download images

+
\ No newline at end of file diff --git a/atlas/templates/atlas/view.html b/atlas/templates/atlas/view.html new file mode 100755 index 00000000..dfc77b91 --- /dev/null +++ b/atlas/templates/atlas/view.html @@ -0,0 +1,21 @@ +{% extends 'atlas/base.html' %} + +{% load render_table from django_tables2 %} +{% block css %} +{% endblock %} + +{% block content %} + +
+
+

Filter

+
+ {{ filter.form }} + +
+
+ {% render_table table %} +
+ +
+{% endblock %} \ No newline at end of file diff --git a/atlas/urls.py b/atlas/urls.py index f44f5213..991eccc2 100755 --- a/atlas/urls.py +++ b/atlas/urls.py @@ -7,7 +7,7 @@ urlpatterns = [ # path('', views.question_list, name='question_list'), path("author//", views.author_detail, name="author_detail"), path("author/", views.author_list, name="author_list"), - path("cases/", views.CaseView.as_view(), name="atlas_view"), + path("cases/", views.CaseView.as_view(), name="case_view"), path("series/", views.SeriesView.as_view(), name="series_view"), path("series/", views.series_detail, name="series_detail"), path(