From 0ed7968415c743fe82a7eab454fa781fd485cafc Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 18 Dec 2023 18:25:04 +0000 Subject: [PATCH] . --- atlas/models.py | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/atlas/models.py b/atlas/models.py index 4ff13832..db8ad77b 100644 --- a/atlas/models.py +++ b/atlas/models.py @@ -939,20 +939,6 @@ class UncategorisedDicom(models.Model): return None def get_basic_dicom_tags(self): - to_include = ( - "StudyDescription", - "Modality", - "ProtocolName", - "SeriesDescription", - "SeriesInstanceUID", - "BodyPartExamined", - "SliceThickness", - ) - tags = {} - for i in to_include: - tags[i] = "12345" - - return tags try: with pydicom.read_file(self.image) as ds: to_include = ( @@ -977,6 +963,21 @@ class UncategorisedDicom(models.Model): except pydicom.errors.InvalidDicomError: return None + to_include = ( + "StudyDescription", + "Modality", + "ProtocolName", + "SeriesDescription", + "SeriesInstanceUID", + "BodyPartExamined", + "SliceThickness", + ) + tags = {} + for i in to_include: + tags[i] = "12345" + + return tags + class DuplicateDicom(Exception): pass