.
This commit is contained in:
+4
-1
@@ -459,7 +459,10 @@ class RapidImage(models.Model):
|
|||||||
try:
|
try:
|
||||||
# and generate a hash from the pixel data
|
# and generate a hash from the pixel data
|
||||||
dataset = pydicom.dcmread(self.image)
|
dataset = pydicom.dcmread(self.image)
|
||||||
hash = hashlib.md5(",".join([str(i) for i in list(dataset.pixel_array.flatten())]).encode()).hexdigest()
|
print(dataset)
|
||||||
|
pre_join = [str(i) for i in list(dataset.pixel_array.flatten())]
|
||||||
|
print(pre_join)
|
||||||
|
hash = hashlib.md5(",".join(pre_join).encode()).hexdigest()
|
||||||
|
|
||||||
self.is_dicom = True
|
self.is_dicom = True
|
||||||
except pydicom.errors.InvalidDicomError:
|
except pydicom.errors.InvalidDicomError:
|
||||||
|
|||||||
Reference in New Issue
Block a user