From 1e16386e1ed8a1e2f820985aa8e66d924f8c69fe Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 5 Feb 2024 09:15:38 +0000 Subject: [PATCH] add basic dicom diff support --- atlas/api.py | 4 ++-- atlas/templates/atlas/series_viewer.html | 30 ++++++++++++++++++++++++ atlas/urls.py | 5 ++++ atlas/views.py | 30 +++++++++++++++++++++++- helpers/images.py | 14 ++++++++--- rad/static/css/anatomy.css | 12 ++++++++++ 6 files changed, 89 insertions(+), 6 deletions(-) diff --git a/atlas/api.py b/atlas/api.py index e9ed77bc..bc16dcf7 100644 --- a/atlas/api.py +++ b/atlas/api.py @@ -285,7 +285,7 @@ def series_split_by_tag(request, series_id: int, dicom_tag:str): print(image) ds = image.get_dicom_data() - print("2a", ds[dicom_tag]) + #print("2a", ds[dicom_tag]) if dicom_tag in ds: val = ds[dicom_tag].value @@ -295,7 +295,7 @@ def series_split_by_tag(request, series_id: int, dicom_tag:str): else: image_map[val].append(image) else: - return [f"{dicom_tag} not found"] + return [f"{dicom_tag} not found {image}"] new_series = [] case = series.case.all() diff --git a/atlas/templates/atlas/series_viewer.html b/atlas/templates/atlas/series_viewer.html index 3371d271..8c1e77d6 100755 --- a/atlas/templates/atlas/series_viewer.html +++ b/atlas/templates/atlas/series_viewer.html @@ -92,6 +92,9 @@ Image details +
{% for image in series.get_images %} [{{ image.id }}] {{image.image.url}}, pos: {{image.position}}, {{image.upload_filename}} @@ -102,15 +105,34 @@ {{image.image_md5_hash}} ({{image.is_dicom}}) {{image.image_blake3_hash}} + +
{% comment %} {{image.get_dicom_info|safe}}
{% endcomment %} {% endfor %} + +
+

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

Download images

+ show all diff