Skip to content

Commit 0f62a72

Browse files
committed
Retain sub-second resolution in scans files.
1 parent 75f2850 commit 0f62a72

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

heudiconv/bids.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,9 +406,9 @@ def get_formatted_scans_key_row(dcm_fn):
406406
# parse date and time and get it into isoformat
407407
try:
408408
date = dcm_data.ContentDate
409-
time = dcm_data.ContentTime.split('.')[0]
410-
td = time + date
411-
acq_time = datetime.strptime(td, '%H%M%S%Y%m%d').isoformat()
409+
time = dcm_data.ContentTime
410+
td = time + ':' + date
411+
acq_time = datetime.strptime(td, '%H%M%S.%f:%Y%m%d').isoformat()
412412
except (AttributeError, ValueError) as exc:
413413
lgr.warning("Failed to get date/time for the content: %s", str(exc))
414414
acq_time = ''

0 commit comments

Comments
 (0)