Home > matlabmk > headinfo.m

headinfo

PURPOSE ^

headinfo() - Displays channel, bin and t-test information about the data

SYNOPSIS ^

function headinfo(GND_GRP_or_fname)

DESCRIPTION ^

 headinfo() - Displays channel, bin and t-test information about the data 
              stored in a GND or GRP variable (i.e., the Mass Univariate 
              ERP Toolbox variables for storing ERPs averaged across 
              participants and between groups respectively) in the MATLAB 
              command window.  Similar to Kutaslab UNIX "headinfo" command.

 Usage:
  >> headinfo(GND_GRP_or_fname)

 Input:
  GND_GRP_or_fname  - A Mass Univariate ERP Toolbox GND/GRP structure 
                      variable or the filename of a Mass Univariate ERP
                      Toolbox GND/GRP structure that has been saved to disk.
                      To create a GND variable from Kutaslab ERP files (e.g.,
                      *.nrm files) use avgs2GND.m.  To do the same from
                      EEGLAB *.set files use sets2GND.m.  To create a
                      a GRP structure use GNDs2GRP.m. See Mass Univariate ERP 
                      Toolbox documentation for detailed information about the format
                      of GND and GRP variables. If you specifiy a filename be
                      sure to include the file's path, unless the file is
                      in the current working directory.

 Outputs:
   Text is displayed in command window.

 Examples:
 -For GND variable already in memory
 >>headinfo(GND)

 -For GND variable on disk but not in MATLAB
 >>headinfo('yngvob.GND')

 Author:
 David Groppe
 Kutaslab, 2/2010

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % headinfo() - Displays channel, bin and t-test information about the data
0002 %              stored in a GND or GRP variable (i.e., the Mass Univariate
0003 %              ERP Toolbox variables for storing ERPs averaged across
0004 %              participants and between groups respectively) in the MATLAB
0005 %              command window.  Similar to Kutaslab UNIX "headinfo" command.
0006 %
0007 % Usage:
0008 %  >> headinfo(GND_GRP_or_fname)
0009 %
0010 % Input:
0011 %  GND_GRP_or_fname  - A Mass Univariate ERP Toolbox GND/GRP structure
0012 %                      variable or the filename of a Mass Univariate ERP
0013 %                      Toolbox GND/GRP structure that has been saved to disk.
0014 %                      To create a GND variable from Kutaslab ERP files (e.g.,
0015 %                      *.nrm files) use avgs2GND.m.  To do the same from
0016 %                      EEGLAB *.set files use sets2GND.m.  To create a
0017 %                      a GRP structure use GNDs2GRP.m. See Mass Univariate ERP
0018 %                      Toolbox documentation for detailed information about the format
0019 %                      of GND and GRP variables. If you specifiy a filename be
0020 %                      sure to include the file's path, unless the file is
0021 %                      in the current working directory.
0022 %
0023 % Outputs:
0024 %   Text is displayed in command window.
0025 %
0026 % Examples:
0027 % -For GND variable already in memory
0028 % >>headinfo(GND)
0029 %
0030 % -For GND variable on disk but not in MATLAB
0031 % >>headinfo('yngvob.GND')
0032 %
0033 % Author:
0034 % David Groppe
0035 % Kutaslab, 2/2010
0036 
0037 %%%%%%%%%%%%%%%% REVISION LOG %%%%%%%%%%%%%%%%%
0038 % 3/27/2010-Revised to accommodate GRP variable
0039 %
0040 % 3/30/2010-Revised to deal with GRP/GND variables without bins
0041 %
0042 % 5/6/2010-Revised to deal with FDR control
0043 %
0044 % 6/4/2011-Revised to deal with cluster based tests
0045 
0046 function headinfo(GND_GRP_or_fname)
0047 
0048 GRP_var=0;
0049 %load GND/GRP variable if a filename was passed
0050 if ischar(GND_GRP_or_fname),
0051     fprintf('Loading GND or GRP struct from file %s.\n',GND_GRP_or_fname);
0052     load(GND_GRP_or_fname,'-MAT');
0053     if ~exist('GND','var') && ~exist('GRP','var')
0054         error('File %s does not contain a GND or GRP variable.',GND_GRP_or_fname);
0055     end
0056     if exist('GRP','var'),
0057         GND=GRP; %for simplicity GRP variables are re-named GND
0058         clear GRP;
0059         GRP_var=1;
0060     end
0061 else
0062     GND=GND_GRP_or_fname; %for simplicity GRP and GND variables are named GND
0063     fldnames=fieldnames(GND);
0064     if ismember('group_desc',fldnames),
0065         GRP_var=1;
0066     end
0067 end
0068 
0069 n_chans=length(GND.chanlocs);
0070 n_tpts=length(GND.time_pts);
0071 n_bins=length(GND.bin_info);
0072 
0073 fprintf('CHANNELS\n');
0074 for c=1:n_chans,
0075     fprintf('%d:%s ',c,GND.chanlocs(c).labels);
0076     if ~mod(c,8)
0077         fprintf('\n');
0078     end
0079 end
0080 if mod(c,8),
0081     fprintf('\n');
0082 end
0083 
0084 if GRP_var,
0085     fprintf('\nGROUPS\n');
0086     n_groups=length(GND.group_desc);
0087     for b=1:n_groups,
0088         fprintf('Group %d: %s (%d participants)\n',b,GND.group_desc{b}, ...
0089             length(GND.indiv_fnames{b}));
0090     end
0091 end
0092 
0093 fprintf('\nBINS\n');
0094 if n_bins
0095     for b=1:n_bins,
0096         fprintf('Bin %d: %s\n',b,GND.bin_info(b).bindesc);
0097     end
0098 else
0099     fprintf('No bins are yet stored with these data.\n');
0100 end
0101 
0102 %t-Tests
0103 fprintf('\nt-TESTS\n');
0104 n_ptests=length(GND.t_tests);
0105 
0106 for t=1:n_ptests,
0107      fprintf('t-test %d->Bin %d, ',t,GND.t_tests(t).bin);
0108     if isnan(GND.t_tests(t).n_perm)
0109         fprintf('q(method=%s)=%g, ',GND.t_tests(t).mult_comp_method, ...
0110             GND.t_tests(t).desired_alphaORq);
0111     else
0112         if strcmpi(GND.t_tests(t).mult_comp_method,'tmax perm test')
0113             fprintf('Est. Alpha(method=tmax)=%g, ',GND.t_tests(t).estimated_alpha);
0114         else
0115             fprintf('Est. Alpha(method=cluster mass)=%g, ',GND.t_tests(t).estimated_alpha);
0116         end
0117     end
0118     if strcmpi(GND.t_tests(t).mean_wind,'yes'),
0119         fprintf('Mean uV in ');
0120     else
0121         fprintf('Each time point in ');
0122     end
0123     n_wind=size(GND.t_tests(t).time_wind,1);
0124     for w=1:n_wind,
0125         if w==n_wind
0126             fprintf('%d-%d ms, ',GND.t_tests(t).time_wind(w,1), ...
0127                 GND.t_tests(t).time_wind(w,2));
0128         else
0129             fprintf('%d-%d, ',GND.t_tests(t).time_wind(w,1), ...
0130                 GND.t_tests(t).time_wind(w,2));
0131         end
0132     end
0133     ex_ids=setdiff(1:length(GND.chanlocs),GND.t_tests(t).used_chan_ids);
0134     if isempty(ex_ids),
0135         fprintf('All channels included\n');
0136     else
0137         fprintf('Excluding channels:');
0138         for c=ex_ids,
0139             fprintf(' %s',GND.chanlocs(c).labels);
0140         end
0141         fprintf('\n');
0142     end
0143 end
0144 if ~n_ptests,
0145     fprintf('No t-test results have been stored with these data.\n');
0146 end

Generated on Tue 10-May-2016 16:37:45 by m2html © 2005