From e3868e5e5fd0e90380e733d93f2679dd571e00bc Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Fri, 19 Jun 2020 13:11:17 -0400 Subject: [PATCH 1/4] Use AcquisitionTime instead of ContentTime. --- heudiconv/bids.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/heudiconv/bids.py b/heudiconv/bids.py index 6a9c136c..29f02359 100644 --- a/heudiconv/bids.py +++ b/heudiconv/bids.py @@ -406,7 +406,7 @@ def get_formatted_scans_key_row(dcm_fn): # parse date and time and get it into isoformat try: date = dcm_data.ContentDate - time = dcm_data.ContentTime.split('.')[0] + time = dcm_data.AcquisitionTime.split('.')[0] td = time + date acq_time = datetime.strptime(td, '%H%M%S%Y%m%d').isoformat() except (AttributeError, ValueError) as exc: From fdb57290105861cd2fb4cbfe3211e7084fa0f010 Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Sat, 20 Jun 2020 14:56:10 -0400 Subject: [PATCH 2/4] Small commit to trigger CI. --- heudiconv/bids.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/heudiconv/bids.py b/heudiconv/bids.py index 8f1f498f..86ac2b95 100644 --- a/heudiconv/bids.py +++ b/heudiconv/bids.py @@ -404,7 +404,7 @@ 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.AcquisitionTime From 3f277b640ab4676c9e3841384a0f2e4f96f2c542 Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Sat, 20 Jun 2020 15:56:42 -0400 Subject: [PATCH 3/4] Fix test truth. --- heudiconv/tests/test_main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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] From 7660e004b1ab6ba60a3f5fc287b9240cca92de2b Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Mon, 3 Aug 2020 15:20:02 -0400 Subject: [PATCH 4/4] Replace ContentDate with AcquisitionDate --- heudiconv/bids.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/heudiconv/bids.py b/heudiconv/bids.py index 86ac2b95..4647358b 100644 --- a/heudiconv/bids.py +++ b/heudiconv/bids.py @@ -406,7 +406,7 @@ def get_formatted_scans_key_row(dcm_fn): # we need to store filenames and acquisition times # parse date and time of start of run acquisition and get it into isoformat try: - date = dcm_data.ContentDate + date = dcm_data.AcquisitionDate time = dcm_data.AcquisitionTime acq_time = get_datetime(date, time) except (AttributeError, ValueError) as exc: