Crashing ct_philips extractor on empty AquisitionDateTime

Issue #478 duplicate
Tim de Wit created an issue

The Philips CT extractor seems to crash if dicom tag (0008,002a) AquisitionDateTime is not present. In this particular case the separate fields AcquisitionDate and AcquisitionTime were present.

  File "/usr/local/lib/python2.7/dist-packages/openrem/remapp/extractors/ct_philips.py", line 165, in _ctradiationdose
latestlength = int(events.latest('date_time_started').exposure_time * 1000)  # in microseconds
TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'

Would it be an idea to build AquisitionDateTime from AcquisitionDate and AcquisitionTime for those cases?
Note: In another (working) example where all three fields are present, I noticed that AquisitionDateTime does contain a timezone offset, which we would miss if we would concatenate by default.

(0008,0022) DA [20160601]                      #   8, 1 AcquisitionDate   
(0008,002a) DT [20160601134852+0200]           #  20, 1 AcquisitionDateTime   
(0008,0032) TM [134852]                        #   6, 1 AcquisitionTime

Comments (4)

  1. Ed McDonagh

    Thanks for the report @Tim de Wit We need to do a few things here.

    1. If AcquisitionDateTime isn't present, try and build it from the other fields, if present. We don't currently try and get those, probably because this field doesn't exist at all in the template (http://dicom.nema.org/medical/dicom/current/output/chtml/part16/sect_TID_10013.html) but I added it into the model anyway 😄
    2. Ensure that the code that failed in _ctradiationdose doesn't cause an error.
    3. Reconsider how to deal with timezones - I am surprised that the DT had TZ data but the TM didn't? Maybe it is normal to only include it with full date time values only?
  2. Log in to comment