Skip to content

Commit c219c0f

Browse files
committed
BF: convert - move out resetting of outname and scaninfo outside of the loop
Otherwise, if outtype had nii.gz BEFORE dicom by the heuristic (or like it is done in our tests) - embedding etc simply would be skipped!not ...
1 parent 6259724 commit c219c0f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

heudiconv/convert.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,9 @@ def convert(items, converter, scaninfo_suffix, custom_callable, with_prov,
247247
prefix_dirname = op.dirname(prefix)
248248
outname_bids = prefix + '.json'
249249
bids_outfiles = []
250+
# set empty outname and scaninfo in case we only want dicoms
251+
outname = ''
252+
scaninfo = ''
250253
lgr.info('Converting %s (%d DICOMs) -> %s . '
251254
'Converter: %s . Output types: %s',
252255
prefix, len(item_dicoms), prefix_dirname, converter, outtypes)
@@ -261,9 +264,6 @@ def convert(items, converter, scaninfo_suffix, custom_callable, with_prov,
261264
len(item_dicoms), outtype, overwrite)
262265
lgr.debug("Includes the following dicoms: %s", item_dicoms)
263266

264-
# set empty outname and scaninfo in case we only want dicoms
265-
outname = ''
266-
scaninfo = ''
267267
if outtype == 'dicom':
268268
convert_dicom(item_dicoms, bids, prefix,
269269
outdir, tempdirs, symlink, overwrite)

0 commit comments

Comments
 (0)