Skip to content

Commit 4895d4b

Browse files
authored
Empty acq_time results in empty cell not 'n/a'
BIDS validator gives me this error for acq_time: `[ERR] Empty cell in TSV file detected: The proper way of labeling missing values is "n/a"` This is because `str(None)` in Python gives 'None' which has True boolean value. Fortunately, the fix is simple.
1 parent dcc590d commit 4895d4b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

heudiconv/bids.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,11 +425,11 @@ def get_formatted_scans_key_row(dcm_fn):
425425
try:
426426
perfphys = dcm_data.PerformingPhysicianName
427427
except AttributeError:
428-
perfphys = ''
428+
perfphys = None
429429
row = [acq_time, perfphys, randstr]
430430
# empty entries should be 'n/a'
431431
# https://github.com/dartmouth-pbs/heudiconv/issues/32
432-
row = ['n/a' if not str(e) else e for e in row]
432+
row = ['n/a' if e is None else e for e in row]
433433
return row
434434

435435

0 commit comments

Comments
 (0)