.
This commit is contained in:
@@ -241,6 +241,7 @@ class SeriesImageBase(models.Model):
|
|||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
"""Override save method to add image hash"""
|
"""Override save method to add image hash"""
|
||||||
if self.image:
|
if self.image:
|
||||||
|
print(self.pk, self.image)
|
||||||
if not self.image_md5_hash:
|
if not self.image_md5_hash:
|
||||||
image_hash, is_dicom = get_image_hash(self.image, hash_type="md5", direct_pixel_data=False)
|
image_hash, is_dicom = get_image_hash(self.image, hash_type="md5", direct_pixel_data=False)
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -192,7 +192,7 @@ def get_image_hash(img, hash_type="blake3", direct_pixel_data=True) -> (str, boo
|
|||||||
# ----
|
# ----
|
||||||
|
|
||||||
except pydicom.errors.InvalidDicomError as e:
|
except pydicom.errors.InvalidDicomError as e:
|
||||||
print("dicom error")
|
print("dicom error", img)
|
||||||
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