Skip to content

Commit 067c99c

Browse files
authored
Use empty string not None
for cases where the field exists but is empty
1 parent 4895d4b commit 067c99c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

heudiconv/bids.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ def get_formatted_scans_key_row(dcm_fn):
413413
acq_time = datetime.strptime(td, '%H%M%S%Y%m%d').isoformat()
414414
except (AttributeError, ValueError) as exc:
415415
lgr.warning("Failed to get date/time for the content: %s", str(exc))
416-
acq_time = None
416+
acq_time = ''
417417
# add random string
418418
# But let's make it reproducible by using all UIDs
419419
# (might change across versions?)
@@ -425,11 +425,11 @@ def get_formatted_scans_key_row(dcm_fn):
425425
try:
426426
perfphys = dcm_data.PerformingPhysicianName
427427
except AttributeError:
428-
perfphys = None
428+
perfphys = ''
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 e is None else e for e in row]
432+
row = ['n/a' if not e else e for e in row]
433433
return row
434434

435435

0 commit comments

Comments
 (0)