0001 function [rep_strs, marsS, marsD, changef] = stat_table(marsD, Ic)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 if nargin < 2
0019 Ic = [];
0020 end
0021
0022 changef = 0;
0023 if isempty(Ic)
0024 [Ic marsD changef] = ui_get_contrasts(marsD,'T|F',Inf,...
0025 'Select contrasts ','',1);
0026 end
0027
0028
0029 [marsS] = compute_contrasts(marsD, Ic);
0030
0031
0032 if isempty(marsS), return, end
0033
0034 if marsS.rows{1}.stat == 'T'
0035 numstr = 'Contrast value';
0036 statstr = 't statistic';
0037 else
0038 numstr = 'Extra SS';
0039 statstr = 'F statistic';
0040 end
0041 str = sprintf('%-20s%20s:%15s:%15s:%15s:%15s',...
0042 'Contrast name',...
0043 'ROI name',...
0044 numstr,...
0045 statstr,...
0046 'Uncorrected P',...
0047 'Corrected P');
0048 rep_strs{1} = sprintf('\n%s\n%s\n',str, repmat('-',1,length(str)));
0049
0050 for con = 1:length(marsS.rows)
0051 rep_strs{end+1} = sprintf('%s\n%s\n', ...
0052 marsS.rows{con}.name,...
0053 repmat('-',1,42));
0054 for roi = 1:length(marsS.columns)
0055 rep_strs{end+1} = sprintf('%40s:%15.2f:%15.2f:%15.6f:%15.6f\n', ...
0056 marsS.columns{roi},...
0057 marsS.con(con,roi),...
0058 marsS.stat(con,roi),...
0059 marsS.P(con,roi),...
0060 marsS.Pc(con,roi));
0061 end
0062 end