@@ -158,10 +158,6 @@ class DeconvolveInputSpec(AFNICommandInputSpec):
158
158
requires = ['glt_sym' ])
159
159
160
160
161
- class DeconvolveOutputSpec (TraitedSpec ):
162
- pass
163
-
164
-
165
161
class Deconvolve (AFNICommand ):
166
162
"""Performs OLS regression given a 4D neuroimage file and stimulus timings
167
163
@@ -179,19 +175,23 @@ class Deconvolve(AFNICommand):
179
175
>>> stim_times = [(1, 'stims1.txt', 'SPMG1(4)'), (2, 'stims2.txt', 'SPMG2(4)')]
180
176
>>> deconvolve.inputs.stim_times = stim_times
181
177
>>> 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)'
183
179
>>> res = deconvolve.run() # doctest: +SKIP
184
180
"""
185
181
186
182
_cmd = '3dDeconvolve'
187
183
input_spec = DeconvolveInputSpec
188
- output_spec = DeconvolveOutputSpec
184
+ output_spec = AFNICommandOutputSpec
189
185
190
186
def _list_outputs (self ):
191
187
outputs = self .output_spec ().get ()
192
188
if isdefined (self .inputs .x1D ):
193
189
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
195
195
return outputs
196
196
197
197
def _format_arg (self , name , trait_spec , value ):
@@ -206,5 +206,8 @@ def _format_arg(self, name, trait_spec, value):
206
206
arg += trait_spec .argstr % value
207
207
arg = arg .rstrip ()
208
208
return arg
209
+
210
+ if name == 'stim_times' :
211
+ self .inputs .num_stimts = len (value )
209
212
elif name == 'glt_sym' :
210
213
self .inputs .num_glt = len (value )
0 commit comments