-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDemoStat4Ci.m
48 lines (40 loc) · 2.27 KB
/
DemoStat4Ci.m
1
% DEMOSTAT4CI illustrates the usage of the Stat2Ci toolbox on two classification images from:% Gosselin, F. & Schyns, P. G. (2001). Bubbles: A technique to reveal the use of information % in recognition. Vision Research, 41, 2261-2271.% The Stat4Ci toolbox allows to perform the Pixel and the Cluster tests, both based on Random Field % Theory. These tests are easy to apply, requiring a mere four pieces of information; and they % typically produce statistical thresholds (or p-values) lower than the standard Bonferroni correction.% % An excellent non-technical reference is:% K. J. Worsley (1996) the geometry of random image. Chance, 9, 27-40.% % We borrowed from several sources: the STAT_THRESHOLD function was written by Keith Worsley for the fmristat toolbox% (http://www.math.mcgill.ca/~keith/fmristat); and our DISPLAYCI function calls many functions from the % Image Processing toolbox.% % The Stat4Ci toolbox is free (http://mapageweb.umontreal.ca/gosselif/stat4ci.html); if you use % it in your research, please, cite us:% Chauvin, A., Worsley, K. J., Schyns, P. G., Arguin, M. & Gosselin, F. (2004). A sensitive % statistical test for smooth classification images.% % Alan Chauvin & FrŽdŽric Gosselin ([email protected]), 20/08/2004% % Loads a classification imageSCi = double(imread('GenderFG.tiff')); % from Gosselin & Schyns, 2001, Experiment 1, GENDER, subject FG SCi = double(imread('exnexFG.tiff')); % from Gosselin & Schyns, 2001, Experiment 1, GENDER, subject FG SCi = cIm2hrCi(SCi);sigma_b = 20; %std of smoothing filter% % Specifies a search space; here: the face areaS_r = double(imread('faceMask.tiff'));S_r = (S_r - min(S_r(:))) / (max(S_r(:))-min(S_r(:)));% % Extracts the area outside the mask; used for the estimation of expected mean and variance of the CivecSCi = SCi(eq(S_r,0));% % Z-transforms the SCiRes = ZTransSCi(SCi,mean(vecSCi(:)),std(vecSCi(:)));Res.ZSCi = Res.ZSCi.*S_r;% % Performs the Pixel or Cluster testp = .05; %p-valuetC = 2.7; %threshold (for Cluster test)Res = StatThresh(Res,p,sigma_b,tC,S_r);% % Displays the resultsbackground = double(imread('w1H.JPG')); % a face used by Gosselin & Schyns, 2001, Experiment 1tCi = DiplayRes(Res,background); % the results of one of the tests with a background