This commit is contained in:
Ross
2021-11-21 23:28:48 +00:00
parent 43f37b82c6
commit 334a1aad5b
-3
View File
@@ -460,7 +460,6 @@ class RapidImage(models.Model):
# and generate a hash from the pixel data # and generate a hash from the pixel data
# TODO: improve? # TODO: improve?
dataset = pydicom.dcmread(self.image) dataset = pydicom.dcmread(self.image)
print(dataset)
#flatten = dataset.pixel_array.astype(str).flatten() #flatten = dataset.pixel_array.astype(str).flatten()
#print("flatteded") #print("flatteded")
#pre_join = ",".join(flatten) #pre_join = ",".join(flatten)
@@ -475,12 +474,10 @@ class RapidImage(models.Model):
md5.update(f"{i}".encode()) md5.update(f"{i}".encode())
else: else:
md5.update(f",{i}".encode()) md5.update(f",{i}".encode())
print(0)
hash = md5.hexdigest() hash = md5.hexdigest()
#---- #----
print(1)
self.is_dicom = True self.is_dicom = True
except pydicom.errors.InvalidDicomError: except pydicom.errors.InvalidDicomError: