Skip to content

Commit 956656a

Browse files
committed
Updated ProcStreamlines PR so that not to change inputs
1 parent 7e78205 commit 956656a

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

nipype/interfaces/camino/convert.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -263,24 +263,30 @@ class ProcStreamlines(StdOutCommandLine):
263263
input_spec=ProcStreamlinesInputSpec
264264
output_spec=ProcStreamlinesOutputSpec
265265

266+
def _format_arg(self, name, spec, value):
267+
if name == 'outputroot':
268+
newval = self._get_actual_ouputroot(value)
269+
arg = '-outputroot ' + newval
270+
return arg
271+
return super(ProcStreamlines, self)._format_arg(name, spec, value)
272+
266273
def _run_interface(self, runtime):
267274
outputroot = self.inputs.outputroot
268275
if isdefined(outputroot):
269-
outputroot = os.path.join('procstream_outfiles', outputroot)
270-
base, filename, ext = split_filename(outputroot)
276+
actual_outputroot = self._get_actual_ouputroot(outputroot)
277+
base, filename, ext = split_filename(actual_outputroot)
271278
if not os.path.exists(base):
272279
os.makedirs(base)
273-
self.inputs.outputroot = outputroot
274280
new_runtime = super(ProcStreamlines, self)._run_interface(runtime)
275-
self.outputroot_files = self._get_ouputroot_files(outputroot)
281+
self.outputroot_files = glob.glob(os.path.join(os.getcwd(),actual_outputroot+'*'))
276282
return new_runtime
277283
else:
278284
new_runtime = super(ProcStreamlines, self)._run_interface(runtime)
279285
return new_runtime
280286

281-
def _get_ouputroot_files(self, outputroot):
282-
outputroot_files = glob.glob(os.path.join(os.getcwd(),outputroot+'*'))
283-
return outputroot_files
287+
def _get_actual_ouputroot(self, outputroot):
288+
actual_outputroot = os.path.join('procstream_outfiles', outputroot)
289+
return actual_outputroot
284290

285291
def _list_outputs(self):
286292
outputs = self.output_spec().get()

0 commit comments

Comments
 (0)