@@ -173,5 +173,38 @@ class Deconvolve(AFNICommand):
173
173
174
174
>>> from nipype.interfaces import afni
175
175
>>> deconvolve = afni.Deconvolve()
176
+ >>> deconvolve.inputs.in_file = 'functional.nii'
177
+ >>> deconvolve.inputs.bucket = 'output.nii'
178
+ >>> deconvolve.inputs.x1D = 'output.1D'
179
+ >>> stim_times = [(1, 'stims1.txt', 'SPMG1(4)'), (2, 'stims2.txt', 'SPMG2(4)')]
180
+ >>> deconvolve.inputs.stim_times = stim_times
181
+ >>> 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)'
183
+ >>> res = deconvolve.run() # doctest: +SKIP
176
184
"""
177
- pass
185
+
186
+ _cmd = '3dDeconvolve'
187
+ input_spec = DeconvolveInputSpec
188
+ output_spec = DeconvolveOutputSpec
189
+
190
+ def _list_outputs (self ):
191
+ outputs = self .output_spec ().get ()
192
+ if isdefined (self .inputs .x1D ):
193
+ if not self .inputs .x1D .endswith ('.xmat.1D' ):
194
+ outputs ['x1D' ] = outputs ['x1D' ] + '.xmat.1D'
195
+ return outputs
196
+
197
+ def _format_arg (self , name , trait_spec , value ):
198
+ """
199
+ Argument num_glt is defined automatically from the number of contrasts
200
+ desired (defined by the length of glt_sym). No effort has been made to
201
+ make this compatible with glt.
202
+ """
203
+ if name in ['stim_times' , 'stim_labels' ]:
204
+ arg = ''
205
+ for st in value :
206
+ arg += trait_spec .argstr % value
207
+ arg = arg .rstrip ()
208
+ return arg
209
+ elif name == 'glt_sym' :
210
+ self .inputs .num_glt = len (value )
0 commit comments