Home > functions > tool_box > time_frequency > plot_scl_stat.m

plot_scl_stat

PURPOSE ^

[t_thresh,p_thresh,thresh_map]=plot_scl_stat(t_out,p_out,scl_frq,scl_time,mn1,mn2,p_crit,thresh_crit);

SYNOPSIS ^

function [t_thresh,p_thresh,thresh_map]=plot_scl_stat(t_out,p_out,scl_frq,scl_time,mn1,mn2,p_crit,thresh_crit);

DESCRIPTION ^

[t_thresh,p_thresh,thresh_map]=plot_scl_stat(t_out,p_out,scl_frq,scl_time,mn1,mn2,p_crit,thresh_crit);
p_crit default = 0.05
thresh_crit retrict range for which stats shown based on mean energy mn1 mn2 
   defalt=0  entire scalogram  

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [t_thresh,p_thresh,thresh_map]=plot_scl_stat(t_out,p_out,scl_frq,scl_time,mn1,mn2,p_crit,thresh_crit);
0002 %[t_thresh,p_thresh,thresh_map]=plot_scl_stat(t_out,p_out,scl_frq,scl_time,mn1,mn2,p_crit,thresh_crit);
0003 %p_crit default = 0.05
0004 %thresh_crit retrict range for which stats shown based on mean energy mn1 mn2
0005 %   defalt=0  entire scalogram
0006 %
0007 % Copyright (C) 2011, ATR All Rights Reserved.
0008 % License : New BSD License(see VBMEG_LICENSE.txt)
0009 [sz_frq,sz_time]=size(t_out);
0010 
0011 if nargin<3
0012    scl_frq=1:sz_frq;
0013 end
0014 if nargin<4
0015    scl_time=1:sz_time;
0016 end
0017 if nargin<5
0018    skip=1;
0019 end
0020 if nargin<7
0021    p_crit=.05;
0022 end
0023 if nargin<8
0024    thresh_crit=0;
0025 end
0026 
0027 if thresh_crit==1
0028    mnb=mean(mn1+mn2,3);
0029    mnb2=reshape(mnb,sz_frq*sz_time,1);
0030    tcr=find(mnb2>((-.5*std(mnb2))+mean(mnb2)));
0031    thresh_map=zeros(sz_frq,sz_time);
0032    thresh_map(tcr)=ones(size(tcr));
0033    %zr=zeros(sz_freq,sz_time));
0034    %zr(:,7:50)=ones(32,44);
0035    %thresh_map=thresh_map.*zr;
0036 else
0037    thresh_map=ones(sz_frq,sz_time);
0038 end
0039 
0040 x=find(abs(p_out)<p_crit);
0041 t_thresh=zeros(sz_frq,sz_time);
0042 t_thresh(x)=t_out(x);
0043 t_thresh=t_thresh.*thresh_map;
0044 cr1=t_thresh~=0;
0045 p_thresh=p_out.*cr1;
0046 
0047 
0048 figure
0049 pcolor(scl_time,scl_frq,mn1);
0050 %shading('interp');
0051 [cmin,cmax]=caxis;
0052 v=[cmin cmax];
0053 title('cond1');
0054 
0055 figure
0056 pcolor(scl_time,scl_frq,mn2);
0057 %shading('interp');
0058 caxis(v);
0059 title('cond2');
0060 
0061 figure
0062 pcolor(scl_time,scl_frq,t_thresh);
0063 %shading('interp');
0064 [cmin,cmax]=caxis;
0065 v=[cmin cmax];
0066 mxv=max(abs(v));
0067 v=[-mxv mxv];
0068 caxis(v);
0069 title('stats cond1<>cond2 (t-value)');
0070

Generated on Tue 27-Aug-2013 11:46:04 by m2html © 2005