Skip to content

Commit 47efa78

Browse files
authored
Merge pull request #310 from dartmouth-pbs/bf-notembedded-meta
BF: convert - move out resetting of outname and scaninfo outside of the loop
2 parents 8be2e9b + 7578097 commit 47efa78

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ TODO Summary
1616

1717
### Fixed
1818

19+
- correctly handle the case when `outtype` of heuristic has "dicom"
20+
before '.nii.gz'. Previously would have lead to absent additional metadata
21+
extraction etc
22+
1923
### Removed
2024

2125
### Security

heudiconv/convert.py

Lines changed: 3 additions & 5 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,11 +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-
seqtype = op.basename(op.dirname(prefix)) if bids else None
265-
266-
# set empty outname and scaninfo in case we only want dicoms
267-
outname = ''
268-
scaninfo = ''
269267
if outtype == 'dicom':
270268
convert_dicom(item_dicoms, bids, prefix,
271269
outdir, tempdirs, symlink, overwrite)

0 commit comments

Comments
 (0)