Skip to content

Commit

Permalink
Merge pull request #310 from dartmouth-pbs/bf-notembedded-meta
Browse files Browse the repository at this point in the history
BF: convert - move out resetting of outname and scaninfo outside of the loop
  • Loading branch information
mgxd authored Feb 15, 2019
2 parents 8be2e9b + 7578097 commit 47efa78
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ TODO Summary

### Fixed

- correctly handle the case when `outtype` of heuristic has "dicom"
before '.nii.gz'. Previously would have lead to absent additional metadata
extraction etc

### Removed

### Security
Expand Down
8 changes: 3 additions & 5 deletions heudiconv/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ def convert(items, converter, scaninfo_suffix, custom_callable, with_prov,
prefix_dirname = op.dirname(prefix)
outname_bids = prefix + '.json'
bids_outfiles = []
# set empty outname and scaninfo in case we only want dicoms
outname = ''
scaninfo = ''
lgr.info('Converting %s (%d DICOMs) -> %s . '
'Converter: %s . Output types: %s',
prefix, len(item_dicoms), prefix_dirname, converter, outtypes)
Expand All @@ -261,11 +264,6 @@ def convert(items, converter, scaninfo_suffix, custom_callable, with_prov,
len(item_dicoms), outtype, overwrite)
lgr.debug("Includes the following dicoms: %s", item_dicoms)

seqtype = op.basename(op.dirname(prefix)) if bids else None

# set empty outname and scaninfo in case we only want dicoms
outname = ''
scaninfo = ''
if outtype == 'dicom':
convert_dicom(item_dicoms, bids, prefix,
outdir, tempdirs, symlink, overwrite)
Expand Down

0 comments on commit 47efa78

Please sign in to comment.