From 8e92de3420afd01a1addd9acd9b1ddeed673e0b9 Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 9 Jun 2025 11:39:38 +0100 Subject: [PATCH] start migration to dv3d --- atlas/forms.py | 2 +- ...riesfinding_annotation_json_3d_and_more.py | 23 + atlas/models.py | 2 + atlas/templates/atlas/series_viewer.html | 196 +- atlas/templates/atlas/series_viewer_test.html | 74 + .../atlas/seriesfinding_migration_status.html | 47 + atlas/urls.py | 4 +- atlas/views.py | 38 +- generic/models.py | 3 + .../assets/charlswasm_decode-484ovEoR.wasm | Bin 0 -> 145700 bytes .../assets/decodeImageFrameWorker-pUTBwvad.js | 100 + rad/static/dv3d/assets/index-BNYRLLy7.css | 1 + .../dv3d/assets/jpegLossless-B10gQeks.js | 1 + .../libjpegturbowasm_decode-daqMmuVl.wasm | Bin 0 -> 178739 bytes .../assets/openjpegwasm_decode-C4nnCcr6.wasm | Bin 0 -> 256499 bytes .../dv3d/assets/openjphjs-CANpALFP.wasm | Bin 0 -> 210229 bytes .../dv3d/assets/polySegConverters-Bo1kNbAR.js | 6 + rad/static/dv3d/index-DwrZLsZY.js | 4006 +++++++++++++++++ ...tionfinding_annotation_json_3d_and_more.py | 23 + templates/base.html | 2 + 20 files changed, 4444 insertions(+), 84 deletions(-) create mode 100644 atlas/migrations/0070_seriesfinding_annotation_json_3d_and_more.py create mode 100755 atlas/templates/atlas/series_viewer_test.html create mode 100644 atlas/templates/atlas/seriesfinding_migration_status.html create mode 100644 rad/static/dv3d/assets/charlswasm_decode-484ovEoR.wasm create mode 100644 rad/static/dv3d/assets/decodeImageFrameWorker-pUTBwvad.js create mode 100644 rad/static/dv3d/assets/index-BNYRLLy7.css create mode 100644 rad/static/dv3d/assets/jpegLossless-B10gQeks.js create mode 100644 rad/static/dv3d/assets/libjpegturbowasm_decode-daqMmuVl.wasm create mode 100644 rad/static/dv3d/assets/openjpegwasm_decode-C4nnCcr6.wasm create mode 100644 rad/static/dv3d/assets/openjphjs-CANpALFP.wasm create mode 100644 rad/static/dv3d/assets/polySegConverters-Bo1kNbAR.js create mode 100644 rad/static/dv3d/index-DwrZLsZY.js create mode 100644 shorts/migrations/0009_questionfinding_annotation_json_3d_and_more.py diff --git a/atlas/forms.py b/atlas/forms.py index 82cda80d..ef64a742 100755 --- a/atlas/forms.py +++ b/atlas/forms.py @@ -175,7 +175,7 @@ class StructureForm(ModelForm): class SeriesFindingForm(ModelForm): class Meta: model = SeriesFinding - exclude = ["series", "annotation_json", "viewport_json", "current_image_id_index"] + exclude = ["series", "annotation_json", "viewport_json", "current_image_id_index", "annotation_json_3d", "viewer_state_3d"] widgets = { "findings": autocomplete.ModelSelect2Multiple( diff --git a/atlas/migrations/0070_seriesfinding_annotation_json_3d_and_more.py b/atlas/migrations/0070_seriesfinding_annotation_json_3d_and_more.py new file mode 100644 index 00000000..2863ef6d --- /dev/null +++ b/atlas/migrations/0070_seriesfinding_annotation_json_3d_and_more.py @@ -0,0 +1,23 @@ +# Generated by Django 5.1.4 on 2025-06-09 10:05 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('atlas', '0069_caseprior_prior_visibility'), + ] + + operations = [ + migrations.AddField( + model_name='seriesfinding', + name='annotation_json_3d', + field=models.JSONField(default=dict), + ), + migrations.AddField( + model_name='seriesfinding', + name='viewer_state_3d', + field=models.JSONField(default=dict), + ), + ] diff --git a/atlas/models.py b/atlas/models.py index 54b7ae52..7ea85f44 100644 --- a/atlas/models.py +++ b/atlas/models.py @@ -628,6 +628,8 @@ class SeriesFinding(FindingBase): def __str__(self) -> str: findings = self.findings.all().values_list("name") + if self.series is None: + return f"SeriesFinding: {findings}/{self.description} (no series)" return f"SeriesFinding: {self.series.id}/{findings}/{self.description}" @reversion.register diff --git a/atlas/templates/atlas/series_viewer.html b/atlas/templates/atlas/series_viewer.html index 799046b3..bb010abd 100755 --- a/atlas/templates/atlas/series_viewer.html +++ b/atlas/templates/atlas/series_viewer.html @@ -3,28 +3,28 @@
{{ series.modality}}, {{ series.examination }}, {{ series.plane }}, {{ series.contrast }}
Description: {{series.description}}
- Associated case: - {% for case in series.case.all %} - +Associated case: +{% for case in series.case.all %} + {{case}} - {% if can_edit %} - - {% endif %} - - {% empty %} - This series is not associated with any cases. {% if can_edit %} + + {% endif %} + +{% empty %} + This series is not associated with any cases. + {% if can_edit %}
Add Series to Case
+ hx-target="#add-series-to-case-result" + hx-swap="innerHTML"> {% csrf_token %} + -
+
{% comment %} {{image.get_dicom_info|safe}}
{% endcomment %} - {% endfor %} - -
- -
+ {% endfor %} + + + + -

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

-

Download images

- -show all diff +

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

+

Download images

+ + show all diff {% endif %}