Skip to content

Commit e23fc83

Browse files
committed
BF: Use SeriesDate/Time for _scans file. RF: filter more of potential Date/Time fields
1 parent a6c52b1 commit e23fc83

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

bin/heudiconv

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -967,8 +967,8 @@ def get_formatted_scans_key_row(item):
967967
mw = ds.wrapper_from_data(dcm.read_file(dcm_fn, stop_before_pixels=True))
968968
# we need to store filenames and acquisition times
969969
# parse date and time and get it into isoformat
970-
date = mw.dcm_data.AcquisitionDate
971-
time = mw.dcm_data.AcquisitionTime.split('.')[0]
970+
date = mw.dcm_data.SeriesDate
971+
time = mw.dcm_data.SeriesTime.split('.')[0]
972972
td = time + date
973973
acq_time = datetime.strptime(td, '%H%M%S%Y%m%d').isoformat()
974974
# add random string
@@ -1079,8 +1079,9 @@ def tuneup_bids_json_files(json_files):
10791079
for jsonfile in json_files:
10801080
json_ = json.load(open(jsonfile))
10811081
# sanitize!
1082-
for f in ['AcquisitionDateTime', 'AcquisitionDate']:
1083-
json_.pop(f, None)
1082+
for f1 in ['Acquisition', 'Study', 'Series']:
1083+
for f2 in ['DateTime', 'Date']:
1084+
json_.pop(f1 + f2, None)
10841085
# TODO: should actually be placed into series file which must
10851086
# go under annex (not under git) and marked as sensitive
10861087
if 'Date' in str(json_):

0 commit comments

Comments
 (0)