Skip to content

Commit fa9798d

Browse files
committed
Revert some changes that broke file gathering, added more efficient
commandline creation.
1 parent cba8e41 commit fa9798d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

nipype/interfaces/dcm2nii.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ def _format_arg(self, opt, spec, val):
6767
else:
6868
spec.argstr += ' n'
6969
val = True
70+
if opt == 'source_names':
71+
return spec.argstr % val[0]
7072
return super(Dcm2nii, self)._format_arg(opt, spec, val)
7173

7274
def _run_interface(self, runtime):
@@ -104,8 +106,8 @@ def _parse_stdout(self, stdout):
104106
base, filename, ext = split_filename(last_added_file)
105107
bvecs.append(os.path.join(base,filename + ".bvec"))
106108
bvals.append(os.path.join(base,filename + ".bval"))
107-
elif re.search('.*->(.*)', line):
108-
val = re.search('.*->(.*)', line)
109+
elif re.search('.*-->(.*)', line):
110+
val = re.search('.*-->(.*)', line)
109111
val = val.groups()[0]
110112
if isdefined(self.inputs.output_dir):
111113
output_dir = self.inputs.output_dir
@@ -115,8 +117,7 @@ def _parse_stdout(self, stdout):
115117
file = val
116118

117119
if file:
118-
if last_added_file and os.path.exists(file) and not last_added_file in file:
119-
files.append(file)
120+
files.append(file)
120121
last_added_file = file
121122
continue
122123

0 commit comments

Comments
 (0)