Skip to content

Commit 4529f33

Browse files
committed
add catch to scans not a part of scan dictionary
1 parent cb80af7 commit 4529f33

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

xnat_downloader/cli/run.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,10 @@ def download_scan_unformatted(self, scan, dest, scan_repl_dict, bids_num_len,
294294
scan_par = self.scan_dict[scan].parent()
295295
# the number id given to a scan (1, 2, 3, 400, 500)
296296
scan_id = self.scan_dict[scan].id()
297-
297+
if scan not in scan_repl_dict[scan].keys():
298+
print('{scan} not a part of dictionary, skipping')
299+
return 0
300+
298301
bids_scan = scan_repl_dict[scan]
299302
# PU:task-rest_bold -> PU_task_rest_bold
300303
scan_fmt = re.sub(r'[\-\:\ \(\)]', '_', scan)

0 commit comments

Comments
 (0)