-
Notifications
You must be signed in to change notification settings - Fork 1
/
spm_P.m
48 lines (44 loc) · 1.52 KB
/
spm_P.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
function [P,p,Em,En,EN] = spm_P(c,k,Z,df,STAT,R,n,S)
% Returns the [un]corrected P value using unifed EC theory
% FORMAT [P p Em En EN] = spm_P(c,k,Z,df,STAT,R,n,S)
%
% c - cluster number
% k - extent {RESELS}
% Z - height {minimum over n values}
% df - [df{interest} df{error}]
% STAT - Statisical feild
% 'Z' - Gaussian feild
% 'T' - T - feild
% 'X' - Chi squared feild
% 'F' - F - feild
% R - RESEL Count {defining search volume}
% n - number of component SPMs in conjunction
% S - Voxel count
%
% P - corrected P value - P(n > kmax}
% p - uncorrected P value - P(n > k}
% Em - expected total number of maxima {m}
% En - expected total number of resels per cluster {n}
% EN - expected total number of voxels {N}
%
%___________________________________________________________________________
%
% spm_P determines corrected and uncorrected p values, using the minimum
% of different valid methods.
%
% See the individual methods for details
%
% spm_P_RF
% spm_P_Bonf
%
%___________________________________________________________________________
% @(#)spm_P.m 2.2 Thomas Nichols 01/10/05
% set global var NOBONF to 1 to turn off Bonferroni.
global NOBONF; if ~isempty(NOBONF) & NOBONF, S = []; end
if (nargin<8), S=[]; end
[P,p,Em,En,EN] = spm_P_RF(c,k,Z,df,STAT,R,n);
% Use lower Bonferroni P value (if possible)
%===========================================================================
if ~isempty(S) & (c==1 & k==0) & ~(length(R)==1 & R==1)
P = min(P,spm_P_Bonf(Z,df,STAT,S,n));
end