Skip to content

Commit a3a48fa

Browse files
authored
Merge pull request #3 from rmarkello/afni_deconvolve
Afni deconvolve
2 parents b481055 + ac40d22 commit a3a48fa

File tree

1 file changed

+127
-1
lines changed

1 file changed

+127
-1
lines changed

nipype/interfaces/afni/model.py

Lines changed: 127 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,132 @@
3030
AFNICommandBase, AFNICommand, AFNICommandInputSpec, AFNICommandOutputSpec)
3131

3232
class DeconvolveInputSpec(AFNICommandInputSpec):
33-
pass
33+
in_files = InputMultiPath(
34+
File(
35+
exists=True),
36+
desc='fname = filename of 3D+time input dataset '
37+
' [more than one filename can be given] '
38+
' here, and these datasets will be] '
39+
' [auto-catenated in time; if you do this,] '
40+
' [\'-concat\' is not needed and is ignored.] '
41+
'** You can input a 1D time series file here, '
42+
' but the time axis should run along the '
43+
' ROW direction, not the COLUMN direction as '
44+
' in the -input1D option. You can automatically '
45+
' transpose a 1D file on input using the \\\' '
46+
' operator at the end of the filename, as in '
47+
' -input fred.1D\\\' '
48+
' * This is the only way to use 3dDeconvolve '
49+
' with a multi-column 1D time series file.',
50+
argstr='-input %s',
51+
mandatory=True,
52+
copyfile=False)
53+
mask = File(
54+
desc='filename of 3D mask dataset; '
55+
'Only data time series from within the mask '
56+
'will be analyzed; results for voxels outside '
57+
'the mask will be set to zero.',
58+
argstr='-mask %s',
59+
exists=True)
60+
automask = traits.Bool(
61+
usedefault=True,
62+
argstr='-automask',
63+
desc='Build a mask automatically from input data '
64+
'(will be slow for long time series datasets)')
65+
censor = File(
66+
desc=' cname = filename of censor .1D time series '
67+
'* This is a file of 1s and 0s, indicating which '
68+
' time points are to be included (1) and which are '
69+
' to be excluded (0). '
70+
'* Option \'-censor\' can only be used once!',
71+
argstr='-censor %s',
72+
exists=True)
73+
polort = traits.Int(
74+
desc='pnum = degree of polynomial corresponding to the '
75+
' null hypothesis [default: pnum = 1]',
76+
argstr='-polort %d')
77+
ortvec = traits.Tuple(
78+
File(
79+
desc='filename',
80+
exists=True),
81+
Str(
82+
desc='label'),
83+
desc='This option lets you input a rectangular array '
84+
'of 1 or more baseline vectors from file \'fff\', '
85+
'which will get the label \'lll\'. Functionally, '
86+
'it is the same as using \'-stim_file\' on each '
87+
'column of \'fff\' separately (plus \'-stim_base\'). '
88+
'This method is just a faster and simpler way to '
89+
'include a lot of baseline regressors in one step. ',
90+
argstr='ortvec %s')
91+
x1d = File(
92+
desc='save out X matrix',
93+
argstr='-x1D %s')
94+
x1d_stop = traits.Bool(
95+
desc='stop running after writing .xmat.1D file',
96+
argstr='-x1D_stop')
97+
bucket = File(
98+
desc='output statistics file',
99+
argstr='-bucket %s')
100+
jobs = traits.Int(
101+
desc='run the program with given number of sub-processes',
102+
argstr='-jobs %d')
103+
stim_times_subtract = traits.Float(
104+
desc='This option means to subtract \'SS\' seconds from each time '
105+
'encountered in any \'-stim_times*\' option. The purpose of this '
106+
'option is to make it simple to adjust timing files for the '
107+
'removal of images from the start of each imaging run.',
108+
argstr='-stim_times_subtract %f')
109+
num_stimts = traits.Int(
110+
desc='number of stimulus timing files',
111+
argstr='-num_stimts %d')
112+
num_glt = traits.Int(
113+
desc='number of general linear tests (i.e., contrasts)',
114+
argstr='-num_glt %d')
115+
global_times = traits.Bool(
116+
desc='use global timing for stimulus timing files',
117+
argstr='-global_times',
118+
xor=['local_times'])
119+
local_times = traits.Bool(
120+
desc='use local timing for stimulus timing files',
121+
argstr='-local_times',
122+
xor=['global_times'])
123+
fout = traits.Bool(
124+
desc='output F-statistic for each stimulus',
125+
argstr='-fout')
126+
rout = traits.Bool(
127+
desc='output the R^2 statistic for each stimulus',
128+
argstr='-rout')
129+
tout = traits.Bool(
130+
desc='output the T-statistic for each stimulus',
131+
argstr='-tout')
132+
vout = traits.Bool(
133+
desc='output the sample variance (MSE) for each stimulus',
134+
argstr='-vout')
135+
stim_times = traits.List(
136+
traits.Tuple(traits.Int(desc='k-th response model'),
137+
File(desc='stimulus timing file',exists=True),
138+
Str(desc='model')),
139+
desc='Generate the k-th response model from a set of stimulus times'
140+
' given in file \'tname\'.',
141+
argstr='-stim_times %d %s %s')
142+
stim_label = traits.List(
143+
traits.Tuple(traits.Int(desc='k-th input stimulus'),
144+
Str(desc='stimulus label')),
145+
desc='label for kth input stimulus',
146+
argstr='-stim_label %d %s',
147+
requires=['stim_times'])
148+
gltsym = traits.List(
149+
Str(desc='symbolic general linear test'),
150+
desc='general linear tests (i.e., contrasts) using symbolic '
151+
'conventions',
152+
argstr='-gltsym %s')
153+
glt_labels = traits.List(
154+
traits.Tuple(traits.Int(desc='k-th general linear test'),
155+
Str(desc='GLT label')),
156+
desc='general linear test (i.e., contrast) labels',
157+
argstr='-glt_label %d %s',
158+
requires=['glt_sym'])
34159

35160

36161
class DeconvolveOutputSpec(TraitedSpec):
@@ -57,6 +182,7 @@ class Deconvolve(AFNICommand):
57182
'3dDeconvolve -input functional.nii -bucket output.nii -x1D output.1D -stim_times 1 stims1.txt SPMG1(4) 2 stims2.txt SPMG2(4)'
58183
>>> res = deconvolve.run() # doctest: +SKIP
59184
"""
185+
60186
_cmd = '3dDeconvolve'
61187
input_spec = DeconvolveInputSpec
62188
output_spec = DeconvolveOutputSpec

0 commit comments

Comments
 (0)