Skip to content

Commit

Permalink
Expands reason for concatenation failure
Browse files Browse the repository at this point in the history
  • Loading branch information
TheJaeger committed Oct 18, 2019
1 parent 4472551 commit b480baa
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions designer/preprocessing/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,10 +434,13 @@ def cat(self, path, ext='.nii' ,verbose=False, force=False):
cmd = ' '.join(str(e) for e in convert_args)
completion = subprocess.run(cmd, shell=True)
if completion.returncode != 0:
raise Exception('Conversion to ' + ext + ' failed. Please '
'ensure that your input NifTi files have '
'the same phase encoding directions, and '
'are accompanied by valid .bval, .bvec, '
for i, fname in enumerate(miflist):
os.remove(fname)
os.remove(op.join(path, 'raw_dwi' + ext))
raise Exception('Concatenation to ' + str(ext) + 'failed. '
'Please ensure that your input NifTi files '
'have the same phase encoding directions, '
'and are accompanied by valid .bval, .bvec, '
'and .json. If this is not possible, '
'please provide manually concatenated '
'DWIs or run with single series input.')
Expand Down

0 comments on commit b480baa

Please sign in to comment.