Skip to content

Commit 4fea399

Browse files
authored
Merge pull request nipy#2 from tsalo/afni-deconvolve
Afni deconvolve
2 parents ac40d22 + 7f15322 commit 4fea399

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

nipype/interfaces/afni/model.py

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

160160

161-
class DeconvolveOutputSpec(TraitedSpec):
162-
pass
163-
164-
165161
class Deconvolve(AFNICommand):
166162
"""Performs OLS regression given a 4D neuroimage file and stimulus timings
167163
@@ -179,19 +175,23 @@ class Deconvolve(AFNICommand):
179175
>>> stim_times = [(1, 'stims1.txt', 'SPMG1(4)'), (2, 'stims2.txt', 'SPMG2(4)')]
180176
>>> deconvolve.inputs.stim_times = stim_times
181177
>>> deconvolve.cmdline # doctest: +ALLOW_UNICODE
182-
'3dDeconvolve -input functional.nii -bucket output.nii -x1D output.1D -stim_times 1 stims1.txt SPMG1(4) 2 stims2.txt SPMG2(4)'
178+
'3dDeconvolve -input functional.nii -bucket output.nii -x1D output -stim_times 1 stims1.txt SPMG1(4) 2 stims2.txt SPMG2(4)'
183179
>>> res = deconvolve.run() # doctest: +SKIP
184180
"""
185181

186182
_cmd = '3dDeconvolve'
187183
input_spec = DeconvolveInputSpec
188-
output_spec = DeconvolveOutputSpec
184+
output_spec = AFNICommandOutputSpec
189185

190186
def _list_outputs(self):
191187
outputs = self.output_spec().get()
192188
if isdefined(self.inputs.x1D):
193189
if not self.inputs.x1D.endswith('.xmat.1D'):
194-
outputs['x1D'] = outputs['x1D'] + '.xmat.1D'
190+
outputs['x1D'] = self.inputs.x1D + '.xmat.1D'
191+
else:
192+
outputs['x1D'] = self.inputs.x1D
193+
194+
outputs['bucket'] = self.inputs.bucket
195195
return outputs
196196

197197
def _format_arg(self, name, trait_spec, value):
@@ -206,5 +206,8 @@ def _format_arg(self, name, trait_spec, value):
206206
arg += trait_spec.argstr % value
207207
arg = arg.rstrip()
208208
return arg
209+
210+
if name == 'stim_times':
211+
self.inputs.num_stimts = len(value)
209212
elif name == 'glt_sym':
210213
self.inputs.num_glt = len(value)

0 commit comments

Comments
 (0)