Skip to content

Commit d855f64

Browse files
authored
Merge pull request #459 from tsalo/enh/acqtime
ENH: Use AcquisitionTime for acq_time scans file field
2 parents c3e2278 + 7660e00 commit d855f64

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

heudiconv/bids.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,10 +404,10 @@ def get_formatted_scans_key_row(dcm_fn):
404404
"""
405405
dcm_data = dcm.read_file(dcm_fn, stop_before_pixels=True, force=True)
406406
# we need to store filenames and acquisition times
407-
# parse date and time and get it into isoformat
407+
# parse date and time of start of run acquisition and get it into isoformat
408408
try:
409-
date = dcm_data.ContentDate
410-
time = dcm_data.ContentTime
409+
date = dcm_data.AcquisitionDate
410+
time = dcm_data.AcquisitionTime
411411
acq_time = get_datetime(date, time)
412412
except (AttributeError, ValueError) as exc:
413413
lgr.warning("Failed to get date/time for the content: %s", str(exc))

heudiconv/tests/test_main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def test_get_formatted_scans_key_row():
171171

172172
row1 = get_formatted_scans_key_row(dcm_fn)
173173
assert len(row1) == 3
174-
assert row1[0] == '2016-10-14T09:26:36.693000'
174+
assert row1[0] == '2016-10-14T09:26:34.692500'
175175
assert row1[1] == 'n/a'
176176
prandstr1 = row1[2]
177177

0 commit comments

Comments
 (0)