.
This commit is contained in:
+6
-3
@@ -583,9 +583,12 @@ class Series(models.Model):
|
||||
for series_image in self.images.all():
|
||||
file_path = os.path.join(settings.MEDIA_ROOT, series_image.image.name)
|
||||
|
||||
with pydicom.dcmread(file_path) as dataset:
|
||||
anonymizer.anonymize(dataset)
|
||||
dataset.save_as(file_path)
|
||||
try:
|
||||
with pydicom.dcmread(file_path) as dataset:
|
||||
anonymizer.anonymize(dataset)
|
||||
dataset.save_as(file_path)
|
||||
except pydicom.errors.InvalidDicomError:
|
||||
pass
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user