Skip to content

Commit 6d64cf2

Browse files
committed
Deconvolve extra options
Added a few extra options to Deconvolve
1 parent f3839ae commit 6d64cf2

File tree

1 file changed

+74
-40
lines changed

1 file changed

+74
-40
lines changed

nipype/interfaces/afni/model.py

Lines changed: 74 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -33,47 +33,76 @@ class DeconvolveInputSpec(AFNICommandInputSpec):
3333
in_files = InputMultiPath(
3434
File(
3535
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] '
36+
desc=' filename(s) of 3D+time input dataset '
37+
' [more than one filename can be given] '
38+
' [here, and these datasets will be] '
3939
' [auto-catenated in time; if you do this,] '
40-
' [\'-concat\' is not needed and is ignored.] '
40+
' [\'concat\' is not needed and is ignored.] '
4141
'** You can input a 1D time series file here, '
4242
' but the time axis should run along the '
4343
' 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.',
44+
' in the \'input1D\' option.',
5045
argstr='-input %s',
5146
mandatory=True,
5247
copyfile=False,
5348
sep=" ")
49+
sat = traits.Bool(
50+
desc='* 3dDeconvolve can check the dataset time series'
51+
' for initial saturation transients, which should'
52+
' normally have been excised before data analysis.'
53+
' If you want to have it do this somewhat time'
54+
' consuming check, use the option \'sat\'.',
55+
argstr='-sat',
56+
xor=['trans'])
57+
trans = traits.Bool(
58+
desc='* 3dDeconvolve can check the dataset time series'
59+
' for initial saturation transients, which should'
60+
' normally have been excised before data analysis.'
61+
' If you want to have it do this somewhat time'
62+
' consuming check, use the option \'trans\'.',
63+
argstr='-trans',
64+
xor=['sat'])
65+
noblock = traits.Bool(
66+
desc='Normally, if you input multiple datasets with'
67+
' \'input\', then the separate datasets are taken to'
68+
' be separate image runs that get separate baseline'
69+
' models. If you want to have the program consider'
70+
' these to be all one big run, use \'noblock\'.'
71+
'* If any of the input dataset has only 1 sub-brick,'
72+
' then this option is automatically invoked!'
73+
'* If the auto-catenation feature isn\'t used, then'
74+
' this option has no effect, no how, no way.',
75+
argstr='-noblock')
76+
force_TR = traits.Int(
77+
desc='Use this value of TR instead of the one in the -input dataset. '
78+
'(It\'s better to fix the input using 3drefit.)',
79+
argstr='-force_TR %d')
80+
input1D = File(
81+
desc='Filename of single (fMRI) .1D time series where time run downs '
82+
'the column.',
83+
argstr='-input1D %s',
84+
exists=True)
5485
mask = File(
55-
desc='filename of 3D mask dataset; '
86+
desc='Filename of 3D mask dataset; '
5687
'Only data time series from within the mask '
5788
'will be analyzed; results for voxels outside '
5889
'the mask will be set to zero.',
5990
argstr='-mask %s',
6091
exists=True)
6192
automask = traits.Bool(
62-
usedefault=True,
6393
argstr='-automask',
64-
desc='Build a mask automatically from input data '
65-
'(will be slow for long time series datasets)')
94+
desc='Build a mask automatically from input data (will be slow for '
95+
'long time series datasets)')
6696
censor = File(
67-
desc=' cname = filename of censor .1D time series '
97+
desc=' filename of censor .1D time series '
6898
'* This is a file of 1s and 0s, indicating which '
6999
' time points are to be included (1) and which are '
70-
' to be excluded (0). '
71-
'* Option \'-censor\' can only be used once!',
100+
' to be excluded (0).',
72101
argstr='-censor %s',
73102
exists=True)
74103
polort = traits.Int(
75-
desc='pnum = degree of polynomial corresponding to the '
76-
' null hypothesis [default: pnum = 1]',
104+
desc='Degree of polynomial corresponding to the null hypothesis '
105+
'[default: 1]',
77106
argstr='-polort %d')
78107
ortvec = traits.Tuple(
79108
File(
@@ -90,75 +119,80 @@ class DeconvolveInputSpec(AFNICommandInputSpec):
90119
'include a lot of baseline regressors in one step. ',
91120
argstr='ortvec %s')
92121
x1D = File(
93-
desc='save out X matrix',
122+
desc='Save out X matrix',
94123
argstr='-x1D %s')
95124
x1D_stop = traits.Bool(
96-
desc='stop running after writing .xmat.1D file',
125+
desc='Stop running after writing .xmat.1D file',
97126
argstr='-x1D_stop')
98127
out_file = File(
99-
desc='output statistics file',
128+
desc='Output statistics file',
100129
argstr='-bucket %s')
101130
jobs = traits.Int(
102-
desc='run the program with given number of sub-processes',
131+
desc='Run the program with provided number of sub-processes',
103132
argstr='-jobs %d')
104133
stim_times_subtract = traits.Float(
105-
desc='This option means to subtract \'SS\' seconds from each time '
106-
'encountered in any \'-stim_times*\' option. The purpose of this '
134+
desc='This option means to subtract specified seconds from each time '
135+
'encountered in any \'stim_times\' option. The purpose of this '
107136
'option is to make it simple to adjust timing files for the '
108137
'removal of images from the start of each imaging run.',
109138
argstr='-stim_times_subtract %f')
110139
num_stimts = traits.Int(
111-
desc='number of stimulus timing files',
140+
desc='Number of stimulus timing files',
112141
argstr='-num_stimts %d')
113142
num_glt = traits.Int(
114-
desc='number of general linear tests (i.e., contrasts)',
143+
desc='Number of general linear tests (i.e., contrasts)',
115144
argstr='-num_glt %d')
116145
global_times = traits.Bool(
117-
desc='use global timing for stimulus timing files',
146+
desc='Use global timing for stimulus timing files',
118147
argstr='-global_times',
119148
xor=['local_times'])
120149
local_times = traits.Bool(
121-
desc='use local timing for stimulus timing files',
150+
desc='Use local timing for stimulus timing files',
122151
argstr='-local_times',
123152
xor=['global_times'])
124153
fout = traits.Bool(
125-
desc='output F-statistic for each stimulus',
154+
desc='Output F-statistic for each stimulus',
126155
argstr='-fout')
127156
rout = traits.Bool(
128-
desc='output the R^2 statistic for each stimulus',
157+
desc='Output the R^2 statistic for each stimulus',
129158
argstr='-rout')
130159
tout = traits.Bool(
131-
desc='output the T-statistic for each stimulus',
160+
desc='Output the T-statistic for each stimulus',
132161
argstr='-tout')
133162
vout = traits.Bool(
134-
desc='output the sample variance (MSE) for each stimulus',
163+
desc='Output the sample variance (MSE) for each stimulus',
135164
argstr='-vout')
136165
stim_times = traits.List(
137166
traits.Tuple(traits.Int(desc='k-th response model'),
138167
File(desc='stimulus timing file',exists=True),
139168
Str(desc='model')),
140-
desc='Generate the k-th response model from a set of stimulus times'
141-
' given in file \'tname\'.',
169+
desc='Generate a response model from a set of stimulus times'
170+
' given in file.',
142171
argstr='-stim_times %d %s %s...')
143172
stim_label = traits.List(
144173
traits.Tuple(traits.Int(desc='k-th input stimulus'),
145174
Str(desc='stimulus label')),
146-
desc='label for kth input stimulus',
175+
desc='Label for kth input stimulus',
147176
argstr='-stim_label %d %s...',
148177
requires=['stim_times'])
149178
gltsym = traits.List(
150179
Str(desc='symbolic general linear test'),
151-
desc='general linear tests (i.e., contrasts) using symbolic '
180+
desc='General linear tests (i.e., contrasts) using symbolic '
152181
'conventions',
153-
argstr='-gltsym %s...')
182+
argstr='-gltsym SYM: %s...')
154183
glt_labels = traits.List(
155184
traits.Tuple(traits.Int(desc='k-th general linear test'),
156185
Str(desc='GLT label')),
157-
desc='general linear test (i.e., contrast) labels',
186+
desc='General linear test (i.e., contrast) labels',
158187
argstr='-glt_label %d %s...',
159188
requires=['gltsym'])
160189

161190

191+
class DeconvolveOutputSpec(AFNICommandOutputSpec):
192+
out_file = File(desc='output statistics file',
193+
exists=True)
194+
195+
162196
class Deconvolve(AFNICommand):
163197
"""Performs OLS regression given a 4D neuroimage file and stimulus timings
164198
@@ -194,7 +228,7 @@ def _parse_inputs(self, skip=None):
194228
return super(Deconvolve, self)._parse_inputs(skip)
195229

196230
def _list_outputs(self):
197-
outputs = self.output_spec().get()
231+
outputs = super(Deconvolve, self)._list_outputs()
198232
if isdefined(self.inputs.x1D):
199233
if not self.inputs.x1D.endswith('.xmat.1D'):
200234
outputs['x1D'] = self.inputs.x1D + '.xmat.1D'

0 commit comments

Comments
 (0)