Skip to content

Commit e1dd902

Browse files
committed
Since .heudiconv/ sub directory depends on sid, disallow empty sid as extracted from dicom
1 parent 4a2af88 commit e1dd902

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

heudiconv/convert.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,12 @@ def prep_conversion(sid, dicoms, outdir, heuristic, converter, anon_sid,
8787
else:
8888
raise ValueError("neither dicoms nor seqinfo dict was provided")
8989

90-
if bids and not sid.isalnum(): # alphanumeric only
91-
sid, old_sid = convert_sid_bids(sid)
90+
if bids:
91+
if not sid:
92+
raise ValueError(
93+
"BIDS requires alphanumeric subject ID. Got an empty value")
94+
if not sid.isalnum(): # alphanumeric only
95+
sid, old_sid = convert_sid_bids(sid)
9296

9397
if not anon_sid:
9498
anon_sid = sid

0 commit comments

Comments
 (0)