Skip to content
Snippets Groups Projects
Commit e6207554 authored by Tamino Huxohl's avatar Tamino Huxohl
Browse files

dicom time util is more robust if time field is missing

parent 738b753c
No related branches found
No related tags found
No related merge requests found
......@@ -69,8 +69,12 @@ class DICOMTime(Enum):
"""
Get the datetime according to this DICOMTime type.
"""
_date = dicom[self.date_field()].value
_time = dicom[self.time_field()].value
try:
_date = dicom[self.date_field()].value
_time = dicom[self.time_field()].value
except:
return " None"
return datetime(
year=int(_date[0:4]),
month=int(_date[4:6]),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment