0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039 function headinfo_spec(variable_or_filename)
0040
0041 specGRP_var=0;
0042 tfrGND_var=0;
0043
0044 if ischar(variable_or_filename),
0045 fprintf('Loading specGND. specGRP, or tfrGND struct from file %s.\n',variable_or_filename);
0046 load(variable_or_filename,'-MAT');
0047 if ~exist('specGND','var') && ~exist('specGRP','var') && ~exist('tfrGND','var')
0048 error('File %s does not contain a specGND, specGRP, or tfrGND variable.',variable_or_filename);
0049 end
0050 if exist('specGRP','var'),
0051 specGND=specGRP;
0052 clear GRP;
0053 specGRP_var=1;
0054 elseif exist('tfrGND','var'),
0055 specGND=tfrGND;
0056 clear tfrGND;
0057 tfrGND_var=1;
0058 end
0059 else
0060 specGND=variable_or_filename;
0061 fldnames=fieldnames(specGND);
0062 if ismember('group_desc',fldnames),
0063 specGRP_var=1;
0064 elseif ismember('tfr_fnames',fldnames),
0065 tfrGND_var=1;
0066 end
0067 end
0068
0069
0070
0071 if tfrGND_var,
0072
0073 [n_chans n_freqs n_time]=size(specGND.grands{1});
0074
0075 fprintf('CHANNELS\n');
0076 for c=1:n_chans,
0077 fprintf('%d:%s ',c,specGND.ftrip.label{c});
0078 if ~mod(c,8)
0079 fprintf('\n');
0080 end
0081 end
0082 if mod(c,8),
0083 fprintf('\n');
0084 end
0085
0086 n_bins=length(specGND.bindesc);
0087 fprintf('\nBINS\n');
0088 if n_bins
0089 for b=1:n_bins,
0090 fprintf('Bin %d: %s\n',b,specGND.bindesc{b});
0091 end
0092 else
0093 fprintf('No bins are yet stored with these data.\n');
0094 end
0095
0096 fprintf('\nTIME RANGE\n');
0097 fprintf('%g to %g ms\n',specGND.ftrip.time(1)*1000,specGND.ftrip.time(end)*1000);
0098
0099 fprintf('\nFREQUENCY RANGE\n');
0100 fprintf('%g to %g Hz\n',specGND.ftrip.freq(1),specGND.ftrip.freq(end));
0101
0102 else
0103
0104 [n_chans n_freqs n_bins]=size(specGND.grands_pow_dB);
0105
0106 fprintf('CHANNELS\n');
0107 for c=1:n_chans,
0108 fprintf('%d:%s ',c,specGND.chanlocs(c).labels);
0109 if ~mod(c,8)
0110 fprintf('\n');
0111 end
0112 end
0113 if mod(c,8),
0114 fprintf('\n');
0115 end
0116
0117 if specGRP_var,
0118 fprintf('\nGROUPS\n');
0119 n_groups=length(specGND.group_desc);
0120 for b=1:n_groups,
0121 fprintf('Group %d: %s (%d participants)\n',b,specGND.group_desc{b}, ...
0122 length(specGND.indiv_fnames{b}));
0123 end
0124 end
0125
0126 fprintf('\nTIME RANGE\n');
0127 fprintf('%g to %g ms\n',specGND.time_pts(1),specGND.time_pts(end));
0128
0129 fprintf('\nSAMPLING RATE\n');
0130 fprintf('%g Hz\n',specGND.srate);
0131
0132 fprintf('\nBINS\n');
0133 if n_bins
0134 for b=1:n_bins,
0135 if specGRP_var,
0136 fprintf('Bin %d: %s\n',b,specGND.bin_info(b).bindesc);
0137 else
0138 fprintf('Bin %d: %s\n',b,specGND.bindesc{b});
0139 end
0140 end
0141 else
0142 fprintf('No bins are yet stored with these data.\n');
0143 end
0144 end
0145
0146 fprintf('\nt-TESTS\n');
0147 if tfrGND_var,
0148
0149 n_ptests=length(specGND.stats);
0150
0151 for t=1:n_ptests,
0152 fprintf('t-test %d->Bin(s) %s\n',t,specGND.stats{t}.bins);
0153 fprintf('Multiple comparison correction: %s\n', ...
0154 specGND.stats{t}.correctm);
0155 fprintf('Alpha level: %g\n', ...
0156 specGND.stats{t}.family_alpha);
0157 if strcmpi(specGND.stats{t}.correctm,'cluster'),
0158 fprintf('Test-wise alpha level for cluster inclusion: %g\n', ...
0159 specGND.stats{t}.cfg.clusteralpha);
0160 fprintf('Sensor neighborhood distance threshold: %g\n', ...
0161 specGND.stats{t}.cfg.neighbourdist);
0162 fprintf('Minimum number of neighbors for cluster inclusion: %d\n', ...
0163 specGND.stats{t}.cfg.minnbchan);
0164 end
0165
0166
0167 fprintf('Time points included: %g to %g ms\n',specGND.stats{t}.time(1)*1000, ...
0168 specGND.stats{t}.time(end)*1000);
0169
0170
0171 fprintf('Frequencies included: %g to %g Hz\n',specGND.stats{t}.freq(1), ...
0172 specGND.stats{t}.freq(end));
0173
0174
0175 if strcmpi(specGND.stats{t}.cfg.avgoverchan,'yes')
0176
0177 fprintf('Analysis performed on averaged channel spectra.\n');
0178 end
0179
0180 excluded=setdiff(specGND.ftrip.label,specGND.stats{t}.label);
0181 if isempty(excluded),
0182 fprintf('All channels included\n');
0183 else
0184 fprintf('Excluding channels:');
0185 for c=1:length(excluded),
0186 fprintf(' %s',excluded{c});
0187 end
0188 fprintf('\n');
0189 end
0190
0191
0192 if specGND.stats{t}.cfg.tail==1,
0193 fprintf('Upper tailed test.\n');
0194 elseif specGND.stats{t}.cfg.tail==-1,
0195 fprintf('Lower tailed test.\n');
0196 else
0197 fprintf('Two-tailed test.\n');
0198 end
0199
0200 fprintf('\n');
0201 end
0202 else
0203
0204 n_ptests=length(specGND.t_tests);
0205
0206
0207
0208 for t=1:n_ptests,
0209 fprintf('t-test %d->Bin %d, ',t,specGND.t_tests(t).bin);
0210 if isnan(specGND.t_tests(t).n_perm)
0211 fprintf('q(method=%s)=%f, ',specGND.t_tests(t).mult_comp_method, ...
0212 specGND.t_tests(t).desired_alphaORq);
0213 else
0214 fprintf('Est. Alpha=%f, ',specGND.t_tests(t).estimated_alpha);
0215 end
0216 if strcmpi(specGND.t_tests(t).mean_band,'yes'),
0217 fprintf('Mean power in ');
0218 else
0219 fprintf('Each frequency in ');
0220 end
0221 n_wind=size(specGND.t_tests(t).freq_band,1);
0222 for w=1:n_wind,
0223 if w==n_wind
0224 fprintf('%f-%f Hz, ',rnd_orderofmag(10*specGND.t_tests(t).freq_band(w,1))/10, ...
0225 rnd_orderofmag(10*specGND.t_tests(t).freq_band(w,2))/10);
0226 else
0227 fprintf('%f-%f, ',specGND.t_tests(t).freq_band(w,1), ...
0228 specGND.t_tests(t).freq_band(w,2));
0229 end
0230 end
0231 ex_ids=setdiff(1:length(specGND.chanlocs),specGND.t_tests(t).used_chan_ids);
0232 if isempty(ex_ids),
0233 fprintf('All channels included\n');
0234 else
0235 fprintf('Excluding channels:');
0236 for c=ex_ids,
0237 fprintf(' %s',specGND.chanlocs(c).labels);
0238 end
0239 fprintf('\n');
0240 end
0241 fprintf('\n');
0242 end
0243 end
0244 if ~n_ptests,
0245 fprintf('No t-test results have been stored with these data.\n');
0246 end