📄 pop_rejmenu.m
字号:
% pop_rejmenu() - Main menu for rejecting trials in an EEG dataset%% Usage: >> pop_rejmenu(INEEG, typerej);%% Inputs:% INEEG - input dataset% typerej - data to reject on (0 = component activations; % 1 = raw electrode data). {Default: 1 = reject on raw data}%% Author: Arnaud Delorme, CNL / Salk Institute, 2001%% See also: eeglab(), pop_eegplot(), pop_eegthresh, pop_rejtrend()% pop_rejkurt(), pop_jointprob(), pop_rejspec() %123456789012345678901234567890123456789012345678901234567890123456789012% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu%% This program is free software; you can redistribute it and/or modify% it under the terms of the GNU General Public License as published by% the Free Software Foundation; either version 2 of the License, or% (at your option) any later version.%% This program is distributed in the hope that it will be useful,% but WITHOUT ANY WARRANTY; without even the implied warranty of% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the% GNU General Public License for more details.%% You should have received a copy of the GNU General Public License% along with this program; if not, write to the Free Software% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA% $Log: pop_rejmenu.m,v $% Revision 1.32 2004/03/17 22:58:34 arno% debug pop_eegthresh%% Revision 1.31 2004/03/13 03:00:26 arno% change dataset hisotry%% Revision 1.30 2003/12/24 20:04:36 scott% same%% Revision 1.29 2003/12/24 20:03:57 scott% same%% Revision 1.28 2003/12/24 20:01:08 scott% same%% Revision 1.27 2003/12/24 20:00:03 scott% same%% Revision 1.26 2003/12/24 19:59:11 scott% same%% Revision 1.25 2003/12/24 19:56:31 scott% same%% Revision 1.24 2003/12/24 19:55:29 scott% debug same%% Revision 1.23 2003/12/24 19:53:29 scott% fix same%% Revision 1.22 2003/12/24 19:50:57 scott% pop-up text edits%% Revision 1.21 2003/12/24 16:44:30 scott% '(std.)' -> '(std. dev.)'%% Revision 1.20 2003/12/17 18:18:18 arno% debug start time for eeg_thresh%% Revision 1.19 2003/12/05 00:23:27 arno% history%% Revision 1.18 2002/11/14 22:18:36 arno% change default for listbox%% Revision 1.17 2002/11/13 23:32:19 arno% adding update of all rejected method%% Revision 1.16 2002/11/12 16:27:29 scott% added slow warning for spectral rejection%% Revision 1.15 2002/11/12 16:16:57 scott% button text%% Revision 1.14 2002/08/22 02:11:12 arno% text edit%% Revision 1.13 2002/08/14 18:21:53 arno% new supergui arg%% Revision 1.12 2002/08/14 16:06:58 arno% updating size of buttons%% Revision 1.11 2002/08/14 00:58:51 arno% debug some calls%% Revision 1.10 2002/08/13 19:01:06 arno% remove manual size constraint%% Revision 1.9 2002/08/13 17:31:35 arno% new supergui call%% Revision 1.8 2002/08/12 22:26:28 arno% button color and text%% Revision 1.7 2002/08/07 22:23:00 arno% editing spelling%% Revision 1.6 2002/08/02 14:27:15 arno% changing default%% Revision 1.5 2002/07/31 18:25:56 arno% changing default%% Revision 1.4 2002/07/31 17:07:26 arno% debugging%% Revision 1.3 2002/07/30 23:39:34 arno% rejection with lots of colors%% Revision 1.2 2002/07/26 17:01:17 arno% debugging icacomp%% Revision 1.1 2002/04/05 17:46:04 jorn% Initial revision%% 01-25-02 reformated help & license -ad function cb_compthresh = pop_rejmenu( EEG, icacomp ); if icacomp == 0 if isempty( EEG.icasphere ) disp('Error: you must first run ICA on the data'); return; end;end;if icacomp == 1 rejtitle = 'Reject trials using data statistics - pop_rejmenu()'; tagmenu = 'rejtrialraw';else rejtitle = 'Reject trials using component activity statistics - pop_rejmenu()'; tagmenu = 'rejtrialica';end; if ~isempty( findobj('tag', tagmenu)) error('cannot open two identical windows; close the first one first');end;figure('visible', 'off', 'numbertitle', 'off', 'name', rejtitle, 'tag', tagmenu);% definition of callbacks% -----------------------checkstatus = [ 'rejstatus = get( findobj(''parent'', gcbf, ''tag'', ''rejstatus''), ''value'');' ... 'if rejstatus == 3,' ... ' EEG.reject.disprej = {};' ... ' if get( findobj(''parent'', gcbf, ''tag'', ''IManual''), ''value''), EEG.reject.disprej{1} = ''manual''; end;' ... ' if get( findobj(''parent'', gcbf, ''tag'', ''IThresh''), ''value''), EEG.reject.disprej{2} = ''thresh''; end;' ... ' if get( findobj(''parent'', gcbf, ''tag'', ''IConst''), ''value''), EEG.reject.disprej{3} = ''const''; end;' ... ' if get( findobj(''parent'', gcbf, ''tag'', ''IEnt''), ''value''), EEG.reject.disprej{4} = ''jp''; end;' ... ' if get( findobj(''parent'', gcbf, ''tag'', ''IKurt''), ''value''), EEG.reject.disprej{5} = ''kurt''; end;' ... ' if get( findobj(''parent'', gcbf, ''tag'', ''IFreq''), ''value''), EEG.reject.disprej{6} = ''freq''; end;' ... 'end;' ... 'rejstatus = rejstatus-1;' ]; % from 1-3 range, go to 0-2 rangeif icacomp, ICAPREFIX = '';else ICAPREFIX = 'ica';end;% tmp_comall is used when returning from eegplottmp_comall = [ 'set(findobj(''''parent'''', findobj(''''tag'''', ''''' tagmenu ... '''''), ''''tag'''', ''''mantrial''''), ''''string'''', num2str(sum(EEG.reject.' ICAPREFIX 'rejmanual)));' ... 'set(findobj(''''parent'''', findobj(''''tag'''', ''''' tagmenu ... '''''), ''''tag'''', ''''threshtrial''''), ''''string'''', num2str(sum(EEG.reject.' ICAPREFIX 'rejthresh)));' ... 'set(findobj(''''parent'''', findobj(''''tag'''', ''''' tagmenu ... '''''), ''''tag'''', ''''freqtrial''''), ''''string'''', num2str(sum(EEG.reject.' ICAPREFIX 'rejfreq)));' ... 'set(findobj(''''parent'''', findobj(''''tag'''', ''''' tagmenu ... '''''), ''''tag'''', ''''consttrial''''), ''''string'''', num2str(sum(EEG.reject.' ICAPREFIX 'rejconst)));' ... 'set(findobj(''''parent'''', findobj(''''tag'''', ''''' tagmenu ... '''''), ''''tag'''', ''''enttrial''''), ''''string'''', num2str(sum(EEG.reject.' ICAPREFIX 'rejjp)));' ... 'set(findobj(''''parent'''', findobj(''''tag'''', ''''' tagmenu ... '''''), ''''tag'''', ''''kurttrial''''), ''''string'''', num2str(sum(EEG.reject.' ICAPREFIX 'rejkurt)));' ]; cb_manual = [ checkstatus ... 'pop_eegplot( EEG, ' int2str( icacomp ) ', rejstatus, 0,''' tmp_comall ''');' ... 'clear rejstatus;' ]; % -----------------------------------------------------cb_compthresh = [ ' posthresh = get( findobj(''parent'', gcbf, ''tag'', ''threshpos''), ''string'' );' ... ' negthresh = get( findobj(''parent'', gcbf, ''tag'', ''threshneg''), ''string'' );' ... ' startime = get( findobj(''parent'', gcbf, ''tag'', ''threshstart''), ''string'' );' ... ' endtime = get( findobj(''parent'', gcbf, ''tag'', ''threshend''), ''string'' );' ... ' elecrange = get( findobj(''parent'', gcbf, ''tag'', ''threshelec''), ''string'' );' ... checkstatus ... '[EEG Itmp LASTCOM] = pop_eegthresh( EEG,' int2str(icacomp) ... ', elecrange, negthresh, posthresh, str2num(startime)/1000, str2num(endtime)/1000, rejstatus, 0,''' tmp_comall ''');' ... 'EEG = h(LASTCOM, EEG);' ... 'clear com Itmp elecrange posthresh negthresh startime endtime rejstatus;' ];% ' set(findobj(''parent'', gcbf, ''tag'', ''threshtrial''), ''string'', num2str(EEG.trials - length(Itmp)));' ...% 'h(LASTCOM);' ...% 'clear Itmp elecrange posthresh negthresh startime endtime rejstatus;' ];% -----------------------------------------------------cb_compfreq = [ ' posthresh = get( findobj(''parent'', gcbf, ''tag'', ''freqpos''), ''string'' );' ... ' negthresh = get( findobj(''parent'', gcbf, ''tag'', ''freqneg''), ''string'' );' ... ' startfreq = get( findobj(''parent'', gcbf, ''tag'', ''freqstart''), ''string'' );' ... ' endfreq = get( findobj(''parent'', gcbf, ''tag'', ''freqend''), ''string'' );' ... ' elecrange = get( findobj(''parent'', gcbf, ''tag'', ''freqelec''), ''string'' );' ... checkstatus ... '[EEG Itmp LASTCOM] = pop_rejspec( EEG,' int2str(icacomp) ... ', elecrange, negthresh, posthresh, startfreq, endfreq, rejstatus, 0,''' tmp_comall ''');' ... 'EEG = h(LASTCOM, EEG);' ... 'clear Itmp elecrange posthresh negthresh startfreq endfreq rejstatus;' ];% -----------------------------------------------------cb_compconstrej = [ ' minslope = get( findobj(''parent'', gcbf, ''tag'', ''constpnts''), ''string'' );' ... ' minstd = get( findobj(''parent'', gcbf, ''tag'', ''conststd''), ''string'' );' ... ' elecrange = get( findobj(''parent'', gcbf, ''tag'', ''constelec''), ''string'' );' ... checkstatus ... '[rej LASTCOM] = pop_rejtrend(EEG,' int2str(icacomp) ', elecrange, ''' ... int2str(EEG.pnts) ''', minslope, minstd, rejstatus, 0,''' tmp_comall ''');' ... 'EEG = h(LASTCOM, EEG);' ... 'clear rej elecrange minslope minstd rejstatus;' ];% -----------------------------------------------------cb_compenthead = [ ' locthresh = get( findobj(''parent'', gcbf, ''tag'', ''entloc''), ''string'' );', ... ' globthresh = get( findobj(''parent'', gcbf, ''tag'', ''entglob''), ''string'' );', ... ' elecrange = get( findobj(''parent'', gcbf, ''tag'', ''entelec''), ''string'' );' ];cb_compenttail = [ ' set( findobj(''parent'', gcbf, ''tag'', ''entloc''), ''string'', num2str(locthresh) );', ... ' set( findobj(''parent'', gcbf, ''tag'', ''entglob''), ''string'', num2str(globthresh) );', ... ' set( findobj(''parent'', gcbf, ''tag'', ''enttrial''), ''string'', num2str(nrej) );' ... 'EEG = h(LASTCOM, EEG);' ... 'clear nrej elecrange locthresh globthresh rejstatus;' ];cb_compentplot = [ cb_compenthead ... '[EEG locthresh globthresh nrej LASTCOM] = pop_jointprob( EEG, ' int2str(icacomp) ... ', elecrange, locthresh, globthresh, 0, 0,''' tmp_comall ''');', ... cb_compenttail ];cb_compentcalc = [ cb_compenthead ... '[EEG locthresh globthresh nrej LASTCOM] = pop_jointprob( EEG, ' int2str(icacomp) ...
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -