Skip to content

Commit 480ba5c

Browse files
committed
fix output file generation
1 parent 74deb38 commit 480ba5c

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

nipype/interfaces/afni/utils.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,10 +1617,10 @@ class NwarpCatInputSpec(AFNICommandInputSpec):
16171617
'extrapolation from the faces of the input grid..',
16181618
argstr='-expad %d')
16191619
out_file = File(
1620-
name_template='%s_Nwarp',
1620+
name_template='%s_NwarpCat',
16211621
desc='output image file name',
16221622
argstr='-prefix %s',
1623-
name_source='in_file')
1623+
name_source='in_files')
16241624
verb = traits.Bool(
16251625
desc='be verbose',
16261626
argstr='-verb')
@@ -1689,6 +1689,19 @@ def _format_arg(self, name, spec, value):
16891689
for v in value]))
16901690
return super(NwarpCat, self)._format_arg(name, spec, value)
16911691

1692+
def _gen_filename(self, name):
1693+
if name == 'out_file':
1694+
return self._gen_fname(self.inputs.in_files[0][0], suffix='_tcat')
1695+
1696+
def _list_outputs(self):
1697+
outputs = self.output_spec().get()
1698+
if isdefined(self.inputs.out_file):
1699+
outputs['out_file'] = os.path.abspath(self.inputs.out_file)
1700+
else:
1701+
outputs['out_file'] = os.path.abspath(self._gen_fname(
1702+
self.inputs.in_files[0], suffix='_NwarpCat+tlrc', ext='.HEAD'))
1703+
return outputs
1704+
16921705

16931706
class OneDToolPyInputSpec(AFNIPythonCommandInputSpec):
16941707
in_file = File(

0 commit comments

Comments
 (0)