fix a few small upload bugs
This commit is contained in:
+8
-1
@@ -9,6 +9,7 @@ from PIL import Image, ImageFile
|
||||
from blake3 import blake3
|
||||
|
||||
import pydicom
|
||||
from pydicom.errors import InvalidDicomError
|
||||
import sys
|
||||
import glob
|
||||
|
||||
@@ -178,7 +179,13 @@ def get_image_dicom_hash(img, dataset=None, hash_type="md5", direct_pixel_data=T
|
||||
raise NotImplemented
|
||||
|
||||
if direct_pixel_data:
|
||||
hasher.update(dataset.PixelData)
|
||||
try:
|
||||
hasher.update(dataset.PixelData)
|
||||
except AttributeError as e:
|
||||
print("Error getting pixel data hash from dataset")
|
||||
print(dataset)
|
||||
raise InvalidDicomError("Error getting pixel data hash from dataset")
|
||||
|
||||
else:
|
||||
first = True
|
||||
for i in dataset.pixel_array.astype(str).flatten():
|
||||
|
||||
Reference in New Issue
Block a user