From 67942f147a774f2ef9c98ad085dae059f708c90e Mon Sep 17 00:00:00 2001 From: Ross Date: Tue, 26 Dec 2023 17:47:01 +0000 Subject: [PATCH] . --- generic/models.py | 1 + helpers/images.py | 1 + 2 files changed, 2 insertions(+) diff --git a/generic/models.py b/generic/models.py index 6bcca0f0..ce484cdf 100644 --- a/generic/models.py +++ b/generic/models.py @@ -250,6 +250,7 @@ class SeriesImageBase(models.Model): if not self.image_blake3_hash: image_blake3_hash, is_dicom = get_image_hash(self.image, hash_type="blake3", direct_pixel_data=True) + self.is_dicom = is_dicom self.image_blake3_hash = image_blake3_hash ## Hack for tests diff --git a/helpers/images.py b/helpers/images.py index 96c28392..a64db095 100644 --- a/helpers/images.py +++ b/helpers/images.py @@ -194,6 +194,7 @@ def get_image_hash(img, hash_type="blake3", direct_pixel_data=True) -> (str, boo # Random error catching is bad except (pydicom.errors.InvalidDicomError, TypeError) as e: print("dicom error", img) + print(e) try: # This is horrible (but needed for current unit tests) # (we use a temporary file that breaks here) img.file.open()