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 %}