.
This commit is contained in:
@@ -250,6 +250,7 @@ class SeriesImageBase(models.Model):
|
|||||||
|
|
||||||
if not self.image_blake3_hash:
|
if not self.image_blake3_hash:
|
||||||
image_blake3_hash, is_dicom = get_image_hash(self.image, hash_type="blake3", direct_pixel_data=True)
|
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
|
self.image_blake3_hash = image_blake3_hash
|
||||||
|
|
||||||
## Hack for tests
|
## Hack for tests
|
||||||
|
|||||||
@@ -194,6 +194,7 @@ def get_image_hash(img, hash_type="blake3", direct_pixel_data=True) -> (str, boo
|
|||||||
# Random error catching is bad
|
# Random error catching is bad
|
||||||
except (pydicom.errors.InvalidDicomError, TypeError) as e:
|
except (pydicom.errors.InvalidDicomError, TypeError) as e:
|
||||||
print("dicom error", img)
|
print("dicom error", img)
|
||||||
|
print(e)
|
||||||
try: # This is horrible (but needed for current unit tests)
|
try: # This is horrible (but needed for current unit tests)
|
||||||
# (we use a temporary file that breaks here)
|
# (we use a temporary file that breaks here)
|
||||||
img.file.open()
|
img.file.open()
|
||||||
|
|||||||
Reference in New Issue
Block a user