|
25 | 25 | % corrections, is substantially less conservative due to the fact that
|
26 | 26 | % it capitalizes on spatial dependency in the data.
|
27 | 27 | %
|
28 |
| -% [varargout] = matlab_tfce(analysis,tails,imgs,imgs2,covariate,nperm,H,E,C,dh,parworkers) |
29 |
| -% [pcorr] = matlab_tfce(analysis,1,imgs,imgs2,covariate,nperm,H,E,C,dh,parworkers) |
30 |
| -% [pcorr_pos,pcorr_neg] = matlab_tfce(analysis,2,imgs,imgs2,covariate,nperm,H,E,C,dh,parworkers) |
31 |
| -% [pcorr_fac1,pcorr_fac2,pcorr_int] = matlab_tfce(analysis,1,imgs,imgs2,covariate,nperm,H,E,C,dh,parworkers) |
| 28 | +% [varargout] = matlab_tfce(analysis,tails,imgs,imgs2,covariate,nperm,H,E,C,dh,parworkers,nuisance) |
| 29 | +% [pcorr] = matlab_tfce(analysis,1,imgs,imgs2,covariate,nperm,H,E,C,dh,parworkers,nuisance) |
| 30 | +% [pcorr_pos,pcorr_neg] = matlab_tfce(analysis,2,imgs,imgs2,covariate,nperm,H,E,C,dh,parworkers,nuisance) |
| 31 | +% [pcorr_fac1,pcorr_fac2,pcorr_int] = matlab_tfce(analysis,1,imgs,imgs2,covariate,nperm,H,E,C,dh,parworkers,nuisance) |
32 | 32 | %
|
33 | 33 | % Arguments:
|
34 | 34 | %
|
|
89 | 89 | % time consuming so it may be more efficient to do outside the package if
|
90 | 90 | % one is running several analyses.
|
91 | 91 | %
|
| 92 | +% nuisance -- commandline-only argument for specifying which variables in |
| 93 | +% a multiple regression are nuisance regressors. Accepts a (1 x predictor) |
| 94 | +% binary (0/1 true/false) vector. 1s/trues indicate variables that should |
| 95 | +% be treated as nuisance predictors (vs. variables of interest). These |
| 96 | +% variables will be included in the model, but will not be subjected to |
| 97 | +% TFCE, accelerating calculations. Default is all 0s (i.e. all variables |
| 98 | +% treated as of non-nuisance). Ignorned if analysis not regression. |
| 99 | +% |
92 | 100 | % Output:
|
93 | 101 | % If tails == 1, a single output image with the same xyz dimensions as imgs
|
94 | 102 | % consisting of corrected p-values with be returned.
|
|
135 | 143 | if nargin > (fixedargn + 1)
|
136 | 144 | covariate = varargin{2};
|
137 | 145 | end
|
| 146 | +nuisance = zeros([1 size(covariate,2)]); |
138 | 147 | if nargin > (fixedargn + 2)
|
139 | 148 | if ~isempty(varargin{3})
|
140 | 149 | nperm = varargin{3};
|
|
165 | 174 | parworkers = varargin{8};
|
166 | 175 | end
|
167 | 176 | end
|
| 177 | +if nargin > (fixedargn + 8) |
| 178 | + if ~isempty(varargin{9}) |
| 179 | + nuisance = varargin{9}; |
| 180 | + end |
| 181 | +end |
168 | 182 |
|
169 | 183 | % check that tails are appropriate
|
170 | 184 | if ~(sum(tails==[1 2]))
|
|
270 | 284 | end
|
271 | 285 | end
|
272 | 286 |
|
| 287 | +% check nuisance |
| 288 | +if strcmp(analysis,'regression') |
| 289 | + ns = size(nuisance); |
| 290 | + if ~isequal(ns,[1 size(covariate,2)]) |
| 291 | + error('nuisance size does not equal predictor number'); |
| 292 | + end |
| 293 | +end |
| 294 | + |
273 | 295 | %% analysis calls
|
274 | 296 |
|
275 | 297 | % indicate analysis start
|
|
325 | 347 | % multiple regression
|
326 | 348 | case 'regression'
|
327 | 349 | if tails == 1
|
328 |
| - pcorr = matlab_tfce_regression(imgs,covariate,tails,nperm,H,E,C,dh); |
| 350 | + pcorr = matlab_tfce_regression(imgs,covariate,tails,nperm,H,E,C,dh,nuisance); |
329 | 351 | else
|
330 |
| - [pcorr_pos,pcorr_neg] = matlab_tfce_regression(imgs,covariate,tails,nperm,H,E,C,dh); |
| 352 | + [pcorr_pos,pcorr_neg] = matlab_tfce_regression(imgs,covariate,tails,nperm,H,E,C,dh,nuisance); |
331 | 353 | end
|
332 | 354 |
|
333 | 355 | % unrecognized analysis input
|
|
0 commit comments