diff --git a/mu_map/file/dicom.py b/mu_map/file/dicom.py index 02929071770c50b97eb776d2d469a85cfa4103c4..1e485ab2a2332bead56a4173a283ba91074d1717 100644 --- a/mu_map/file/dicom.py +++ b/mu_map/file/dicom.py @@ -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]),