diff --git a/heudiconv/bids.py b/heudiconv/bids.py index ce8ab4c3..4647358b 100644 --- a/heudiconv/bids.py +++ b/heudiconv/bids.py @@ -404,10 +404,10 @@ def get_formatted_scans_key_row(dcm_fn): """ dcm_data = dcm.read_file(dcm_fn, stop_before_pixels=True, force=True) # we need to store filenames and acquisition times - # parse date and time and get it into isoformat + # parse date and time of start of run acquisition and get it into isoformat try: - date = dcm_data.ContentDate - time = dcm_data.ContentTime + date = dcm_data.AcquisitionDate + time = dcm_data.AcquisitionTime acq_time = get_datetime(date, time) except (AttributeError, ValueError) as exc: lgr.warning("Failed to get date/time for the content: %s", str(exc)) diff --git a/heudiconv/tests/test_main.py b/heudiconv/tests/test_main.py index 924295ca..e696b991 100644 --- a/heudiconv/tests/test_main.py +++ b/heudiconv/tests/test_main.py @@ -171,7 +171,7 @@ def test_get_formatted_scans_key_row(): row1 = get_formatted_scans_key_row(dcm_fn) assert len(row1) == 3 - assert row1[0] == '2016-10-14T09:26:36.693000' + assert row1[0] == '2016-10-14T09:26:34.692500' assert row1[1] == 'n/a' prandstr1 = row1[2]