Skip to content

Commit e23d72d

Browse files
tsalormarkello
authored andcommitted
Drop output spec and map outputs in list_outputs.
1 parent 453b391 commit e23d72d

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

nipype/interfaces/afni/model.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ class DeconvolveInputSpec(AFNICommandInputSpec):
158158
requires=['glt_sym'])
159159

160160

161-
162161
class DeconvolveOutputSpec(TraitedSpec):
163162
pass
164163

@@ -180,19 +179,23 @@ class Deconvolve(AFNICommand):
180179
>>> stim_times = [(1, 'stims1.txt', 'SPMG1(4)'), (2, 'stims2.txt', 'SPMG2(4)')]
181180
>>> deconvolve.inputs.stim_times = stim_times
182181
>>> deconvolve.cmdline # doctest: +ALLOW_UNICODE
183-
'3dDeconvolve -input functional.nii -bucket output.nii -x1D output.1D -stim_times 1 stims1.txt SPMG1(4) 2 stims2.txt SPMG2(4)'
182+
'3dDeconvolve -input functional.nii -bucket output.nii -x1D output -stim_times 1 stims1.txt SPMG1(4) 2 stims2.txt SPMG2(4)'
184183
>>> res = deconvolve.run() # doctest: +SKIP
185184
"""
186185

187186
_cmd = '3dDeconvolve'
188187
input_spec = DeconvolveInputSpec
189-
output_spec = DeconvolveOutputSpec
188+
output_spec = AFNICommandOutputSpec
190189

191190
def _list_outputs(self):
192191
outputs = self.output_spec().get()
193192
if isdefined(self.inputs.x1D):
194193
if not self.inputs.x1D.endswith('.xmat.1D'):
195-
outputs['x1D'] = outputs['x1D'] + '.xmat.1D'
194+
outputs['x1D'] = self.inputs.x1D + '.xmat.1D'
195+
else:
196+
outputs['x1D'] = self.inputs.x1D
197+
198+
outputs['bucket'] = self.inputs.bucket
196199
return outputs
197200

198201
def _format_arg(self, name, trait_spec, value):
@@ -207,5 +210,8 @@ def _format_arg(self, name, trait_spec, value):
207210
arg += trait_spec.argstr % value
208211
arg = arg.rstrip()
209212
return arg
213+
214+
if name == 'stim_times':
215+
self.inputs.num_stimts = len(value)
210216
elif name == 'glt_sym':
211217
self.inputs.num_glt = len(value)

0 commit comments

Comments
 (0)