You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dicom conversion fails if the dicom datetime contains timezone information, eg. "20230905141258.340-0400"
Traceback (most recent call last):
File "/usr/local/bin/heudiconv", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.9/dist-packages/heudiconv/cli/run.py", line 30, in main
workflow(**kwargs)
File "/usr/local/lib/python3.9/dist-packages/heudiconv/main.py", line 479, in workflow
prep_conversion(
File "/usr/local/lib/python3.9/dist-packages/heudiconv/convert.py", line 259, in prep_conversion
convert(
File "/usr/local/lib/python3.9/dist-packages/heudiconv/convert.py", line 637, in convert
save_scans_key(item, bids_outfiles)
File "/usr/local/lib/python3.9/dist-packages/heudiconv/bids.py", line 494, in save_scans_key
rows[f_name] = get_formatted_scans_key_row(item[-1][0])
File "/usr/local/lib/python3.9/dist-packages/heudiconv/bids.py", line 579, in get_formatted_scans_key_row
acq_datetime = dicoms.get_datetime_from_dcm(dcm_data=dcm_data)
File "/usr/local/lib/python3.9/dist-packages/heudiconv/dicoms.py", line 536, in get_datetime_from_dcm
return strptime_micr(acq_dt, "%Y%m%d%H%M%S[.%f]")
File "/usr/local/lib/python3.9/dist-packages/heudiconv/utils.py", line 689, in strptime_micr
return datetime.strptime(date_string, fmt)
File "/usr/lib/python3.9/_strptime.py", line 568, in _strptime_datetime
tt, fraction, gmtoff_fraction = _strptime(data_string, format)
File "/usr/lib/python3.9/_strptime.py", line 352, in _strptime
raise ValueError("unconverted data remains: %s" %
ValueError: unconverted data remains: .372-0400
Perhaps strptime_micr could support a fmt with an additional optional [%z]?
The text was updated successfully, but these errors were encountered:
Summary
Dicom conversion fails if the dicom datetime contains timezone information, eg. "20230905141258.340-0400"
Perhaps strptime_micr could support a fmt with an additional optional [%z]?
The text was updated successfully, but these errors were encountered: