📄 pop_erpimage.m
字号:
%% Revision 1.73 2002/09/06 16:28:46 arno% same%% Revision 1.72 2002/09/06 16:27:35 arno% debug command%% Revision 1.71 2002/08/31 17:00:47 arno% add yerplabel option%% Revision 1.70 2002/08/30 17:49:23 arno% same%% Revision 1.69 2002/08/30 17:47:34 arno% debug%% Revision 1.68 2002/08/29 01:20:55 arno% nothing%% Revision 1.67 2002/08/23 20:17:20 scott% help msg%% Revision 1.66 2002/08/23 18:31:26 arno% new features, complete gui reprogrammation with tags, new components only options%% Revision 1.65 2002/08/20 23:55:27 arno% updating text and tooltipstring%% Revision 1.64 2002/08/20 23:29:38 scott% changed box labels again - but not the tooltipstring messages!%% Revision 1.63 2002/08/19 23:19:51 arno% back to version 1.47%% Revision 1.47 2002/08/17 03:06:27 arno% same%% Revision 1.46 2002/08/17 02:49:56 arno% listdlg2%% Revision 1.45 2002/08/13 23:12:31 scott% add erpaimge() to figure number%% Revision 1.44 2002/08/12 23:34:36 arno% reordering fields%% Revision 1.43 2002/08/12 18:50:47 arno% errordlg2%% Revision 1.42 2002/08/12 01:35:59 arno% allamp debug%% Revision 1.41 2002/08/12 01:35:36 arno% color%% Revision 1.40 2002/08/11 22:12:40 arno% color%% Revision 1.39 2002/08/09 16:45:47 arno% updating plotamp and phasesort%% Revision 1.38 2002/07/29 23:42:47 arno% same%% Revision 1.37 2002/07/29 23:41:26 arno% updating getdef%% Revision 1.36 2002/07/29 00:20:00 arno% debugging%% Revision 1.35 2002/07/27 01:21:56 arno% debugging last command%% Revision 1.34 2002/07/27 00:45:17 arno% adding messages, changing output command%% Revision 1.33 2002/07/24 19:29:10 arno% removing renorm%% Revision 1.32 2002/07/24 19:27:16 arno% adding back renorm into text output%% Revision 1.31 2002/07/24 19:23:56 arno% ebugging output message%% Revision 1.30 2002/07/24 19:22:05 arno% end debugging%% Revision 1.29 2002/07/24 19:20:58 arno% same%% Revision 1.28 2002/07/24 19:19:34 arno% debugging%% Revision 1.27 2002/07/23 21:32:58 arno% debugging not same size%% Revision 1.26 2002/05/01 23:43:05 arno% additional test%% Revision 1.25 2002/04/29 20:22:22 arno% typo%% Revision 1.24 2002/04/26 21:41:27 arno% phase/coher consistency chack%% Revision 1.23 2002/04/25 18:18:24 arno% debugging spec%% Revision 1.22 2002/04/25 18:13:11 arno% updating command output%% Revision 1.21 2002/04/25 17:55:05 arno% improving commandline message% ,%% Revision 1.20 2002/04/25 17:52:03 arno% modifying renorm%% Revision 1.19 2002/04/25 16:05:57 scott% adding blank line above history entry -sm%% Revision 1.18 2002/04/25 16:03:12 scott% trying to output com into history as well as popcom -sm%% Revision 1.17 2002/04/24 20:36:22 arno% implementing buttons%% Revision 1.16 2002/04/24 19:50:28 arno% updating parameters%% Revision 1.15 2002/04/24 15:22:28 scott% [same] -sm%% Revision 1.14 2002/04/24 15:21:48 scott% [same] -sm%% Revision 1.13 2002/04/24 15:20:47 scott% [same] -sm%% Revision 1.12 2002/04/24 15:19:53 scott% adding note re plotamps -sm%% Revision 1.11 2002/04/23 21:51:01 arno% fixed vert%% Revision 1.10 2002/04/23 21:24:33 scott% *** empty log message ***%% Revision 1.9 2002/04/23 21:20:15 scott% edited help msg -sm%% Revision 1.8 2002/04/23 17:19:45 arno% contextual help modif%% Revision 1.7 2002/04/23 02:01:32 arno% New graphic interface%% Revision 1.6 2002/04/18 19:11:09 arno% testing version control%% Revision 1.5 2002/04/18 15:56:33 scott% editted msgs -sm%% Revision 1.4 2002/04/11 20:02:42 arno% adding last command history%% Revision 1.3 2002/04/11 19:06:43 arno% adding option to default parameters%% Revision 1.2 2002/04/05 23:05:50 arno% Correct typo%% Revision 1.1 2002/04/05 17:32:13 jorn% Initial revision%% 01-25-02 reformated help & license -ad % 02-12-02 added new event format compatibility -ad % 02-15-02 text interface editing -sm & ad % 03-07-02 add the eeglab computeica options -ad% 02-15-02 modified the function accoring to the new event/epoch structure -ad% 03-18-02 added title -ad & sm% 04-04-02 added outputs -ad & smfunction varargout = pop_erpimage( EEG, typeplot, channel, projchan, titleplot, smooth, decimate, sortingtype, ... sortingwin, sortingeventfield, varargin) varargout{1} = '';if nargin < 1 help pop_erpimage; return;end;if typeplot == 0 & isempty(EEG.icasphere) error('no ICA data for this set, first run ICA');end; if EEG.trials == 1 error('erpimage of one trial cannot be plotted');end; if nargin < 2 typeplot = 1; %1=signal; 0=componentend; lastcom = [];if nargin < 3 popup = 1;else popup = isstr(channel) | isempty(channel); if isstr(channel) lastcom = channel; end;end;if popup % get contextual help % ------------------- [txt2 vars2] = gethelpvar('erpimage.m'); txt = { txt2{:}}; vars = { vars2{:}}; % [txt vars] = gethelpvar('erpimopt.m'); % txt = { txt{:} txt2{:}}; % vars = { vars{:} vars2{:}}; commandphase = [ 'if ~isempty(get(findobj(''parent'', gcbf, ''tag'', ''phase''),''string'')),' ... ' if ~isempty(get(findobj(''parent'', gcbf, ''tag'', ''coher''),''string'')), ' ... ' set(findobj(''parent'', gcbf, ''tag'', ''coher''), ''string'', get(findobj(''parent'', gcbf, ''tag'', ''phase''),''string''));' ... 'end; end;' ]; commandcoher = [ 'if ~isempty(get(findobj(''parent'', gcbf, ''tag'', ''coher''),''string'')),' ... ' if ~isempty(get(findobj(''parent'', gcbf, ''tag'', ''phase''),''string'')), ' ... ' set(findobj(''parent'', gcbf, ''tag'', ''phase''), ''string'', get(findobj(''parent'', gcbf, ''tag'', ''coher''),''string''));' ... 'end; end;' ]; commandfield = ['if isempty(EEG.event)' ... ' errordlg2(''No events'');' ... 'else' ... ' tmpfieldnames = fieldnames(EEG.event);' ... ' [tmps,tmpv] = listdlg2(''PromptString'', ''Select fields'', ''SelectionMode'',''single'',''ListString'', tmpfieldnames);' ... ' if tmpv' ... ' set(findobj(''parent'', gcbf, ''tag'', ''field''), ''string'', tmpfieldnames{tmps});' ... ' end;' ... 'end;' ... 'clear tmps tmpv tmpfieldnames;' ]; commandtype = ['if ~isfield(EEG.event, ''type'')' ... ' errordlg2(''No type field'');' ... 'else' ... ' if isstr(EEG.event(1).type)' ... ' tmpfieldnames = unique({EEG.event.type});' ... ' else' ... ' tmpstr = unique(cell2mat({EEG.event.type}));' ... ' tmpfieldnames = cell(1, length(tmpstr));' ... ' for tmps=1:length(tmpstr), tmpfieldnames{tmps} = num2str(tmpstr(tmps)); end;' ... ' end;' ... ' [tmps,tmpv, tmpstr] = listdlg2(''PromptString'',''Select fields'', ''ListString'', tmpfieldnames);' ... ' if tmpv' ... ' set(findobj(''parent'', gcbf, ''tag'', ''type''), ''string'', tmpstr);' ... ' end;' ... 'end;' ... 'clear tmps tmpv tmpstr tmpfieldnames;' ]; geometry = { [1 1 0.1 0.8 2.1] [1 1 1 1 1] [1 1 1 1 1] [1 1 1 1 1] [1] [1] [1 1 1 0.8 0.8 1.2] [1 1 1 0.8 0.8 1.2] [1] [1] ... [1.6 1.7 1.2 1 .5] [1.6 1.7 1.2 1 .5] [1] [1] [1.5 1 1 1 1] [1.5 1 1 1 1] [1] [1] [1.5 1 1 2.2] [1.5 1 1 2.2]}; uilist = { { 'Style', 'text', 'string', fastif(typeplot, 'Channel', 'Component(s)'), 'fontweight', 'bold' } ... { 'Style', 'edit', 'string', getkeyval(lastcom,3,[],'1'), 'tag', 'chan' } { } ... { 'Style', 'text', 'string', 'Figure title', 'fontweight', 'bold' } ... { 'Style', 'edit', 'string', '', 'tag', 'title' } ... ... { 'Style', 'text', 'string', 'Smoothing', 'fontweight', 'bold', 'tooltipstring', context('avewidth',vars,txt) } ... { 'Style', 'edit', 'string', getkeyval(lastcom, 6, [], int2str(min(max(EEG.trials-5,0), 10))), 'tag', 'smooth' } ... { 'Style', 'checkbox', 'string', 'Plot scalp map', 'tooltipstring', 'plot a 2-d head map (vector) at upper left', ... 'value', getkeyval(lastcom, 'topo', 'present', 1), 'tag', 'plotmap' } { } { } ... { 'Style', 'text', 'string', 'Downsampling', 'fontweight', 'bold', 'tooltipstring', context('decimate',vars,txt) } ... { 'Style', 'edit', 'string', getkeyval(lastcom, 7, [], '1'), 'tag', 'decimate' } ... { 'Style', 'checkbox', 'string', 'Plot ERP', 'tooltipstring', context('erp',vars,txt), 'value', getkeyval(lastcom, '''erp''', 'present', 1), 'tag', 'erp' } ... { 'Style', 'text', 'string', fastif(typeplot, 'ERP limits (uV)','ERP limits'), 'tooltipstring', [ 'Plotting limits for ERP trace [min_uV max_uV]' 10 '{Default: ERP data limits}'] } ... { 'Style', 'edit', 'string', getkeyval(lastcom, 'limits', [3:4]), 'tag', 'limerp' } ... { 'Style', 'text', 'string', 'Time limits (ms)', 'fontweight', 'bold', 'tooltipstring', 'Select time subset in ms' } ... { 'Style', 'edit', 'string', getkeyval(lastcom, 'limits', [1:2], num2str(1000*[EEG.xmin EEG.xmax])), 'tag', 'limtime' } ... { 'Style', 'checkbox', 'string', 'Plot colorbar','tooltipstring', context('caxis',vars,txt), 'value', getkeyval(lastcom, 'cbar', 'present', 1), 'tag', 'cbar' } ... { 'Style', 'text', 'string', 'Color limits (see Help)','tooltipstring', context('caxis',vars,txt) } ... { 'Style', 'edit', 'string', getkeyval(lastcom, 'caxis'), 'tag', 'caxis' } ... {} ... { 'Style', 'text', 'string', 'Sort/align trials by epoch event values', 'fontweight', 'bold'} ... { 'Style', 'pushbutton', 'string', 'Epoch-sorting field', 'callback', commandfield, ... 'tooltipstring', 'Epoch-sorting event field name (Ex: latency; default: no sorting):' } ... { 'Style', 'pushbutton', 'string', 'Event type(s)', 'callback', commandtype, 'tooltipstring', ['Event type(s) subset (default: all):' 10 ... '(See ''/Edit/Edit event values'' for event types)'] } ... { 'Style', 'text', 'string', 'Event time range', 'tooltipstring', [ 'Sorting event window [start, end] in milliseconds (default: whole epoch):' 10 ... 'events are only selected within this time window (can be usefull if several' 10 ... 'events of the same type are in the same epoch, or for selecting trials with given response time)']} ... { 'Style', 'text', 'string', 'Rescale', 'tooltipstring', 'Rescale sorting variable to plot window (yes|no|a*x+b)(Ex:3*x+2):' } ... { 'Style', 'text', 'string', 'Align', 'tooltipstring', context('align',vars,txt) } ... { 'Style', 'checkbox', 'string', 'Don''t sort by value', 'tooltipstring', context('nosort',vars,txt), 'value', getkeyval(lastcom, 'nosort', 'present', 0), 'tag', 'nosort' } ... { 'Style', 'edit', 'string', getkeyval(lastcom, 10), 'tag', 'field' } ... { 'Style', 'edit', 'string', getkeyval(lastcom, 8), 'tag', 'type' } ... { 'Style', 'edit', 'string', getkeyval(lastcom, 9), 'tag', 'eventrange' } ... { 'Style', 'edit', 'string', getkeyval(lastcom, 'renorm','', 'no'), 'tag', 'renorm' } ... { 'Style', 'edit', 'string', getkeyval(lastcom, 'align'), 'tag', 'align' } ... { 'Style', 'checkbox', 'string', 'Don''t plot values', 'tooltipstring', context('noplot',vars,txt), 'value', getkeyval(lastcom, 'noplot', 'present', 0), 'tag', 'noplot' } ... {} ... { 'Style', 'text', 'string', 'Sort trials by phase', 'fontweight', 'bold'} ... { 'Style', 'text', 'string', 'Frequency (Hz | minHz maxHz)', 'tooltipstring', ['sort by phase at maximum-power frequency' 10 ... 'in the data within the range [minHz,maxHz]' 10 '(overrides frequency specified in ''coher'' flag)'] } ... { 'Style', 'text', 'string', 'Percent low-amp. trials to ignore', 'tooltipstring', ['percent of trials to reject for low' ... 'amplitude. Else,' 10 'if prct is in the range [-100,0] -> percent to reject for high amplitude'] } ... { 'Style', 'text', 'string', 'Window center (ms)', 'tooltipstring', 'Ending time fo the 3 cycle window' } ... { 'Style', 'text', 'string', 'Wavelet cycles', 'tooltipstring', 'cycles per wavelet window' } {}... { 'Style', 'edit', 'string', getkeyval(lastcom, 'phasesort', [3:4]), 'tag', 'phase', 'callback', commandphase } ... { 'Style', 'edit', 'string', getkeyval(lastcom, 'phasesort', [2]), 'tag', 'phase2' } ... { 'Style', 'edit', 'string', getkeyval(lastcom, 'phasesort', [1]), 'tag', 'phase3' } ... { 'Style', 'text', 'string', ' 3' } {}... {} ...
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -