📄 pop_rejmenu.m
字号:
', [ str2num(elecrange) ], str2num(locthresh), str2num(globthresh), 0, 0);', ... cb_compenttail ];cb_compenteeg = [ cb_compenthead ... checkstatus ... '[EEG locthresh globthresh nrej LASTCOM] = pop_jointprob( EEG, ' int2str(icacomp) ... ', elecrange, locthresh, globthresh, rejstatus, 0, 1,''' tmp_comall ''');', ... cb_compenttail ];% -----------------------------------------------------cb_compkurthead =[ ' locthresh = get( findobj(''parent'', gcbf, ''tag'', ''kurtloc''), ''string'' );', ... ' globthresh = get( findobj(''parent'', gcbf, ''tag'', ''kurtglob''), ''string'' );', ... ' elecrange = get( findobj(''parent'', gcbf, ''tag'', ''kurtelec''), ''string'' );' ];cb_compkurttail =[ ' set( findobj(''parent'', gcbf, ''tag'', ''kurtloc''), ''string'', num2str(locthresh) );', ... ' set( findobj(''parent'', gcbf, ''tag'', ''kurtglob''), ''string'', num2str(globthresh) );', ... ' set( findobj(''parent'', gcbf, ''tag'', ''kurttrial''), ''string'', num2str(nrej) );' ... 'EEG = h(LASTCOM, EEG);' ... 'clear nrej elecrange locthresh globthresh rejstatus;' ];cb_compkurtplot = [ cb_compkurthead ... '[EEG locthresh globthresh nrej LASTCOM] = pop_rejkurt( EEG, ' int2str(icacomp) ... ', elecrange, locthresh, globthresh, 0, 0,''' tmp_comall ''');', ... cb_compkurttail ];cb_compkurtcalc = [ cb_compkurthead ... '[EEG locthresh globthresh nrej LASTCOM] = pop_rejkurt( EEG, ' int2str(icacomp) ... ', [ str2num(elecrange) ], str2num(locthresh), str2num(globthresh), 0, 0);', ... cb_compkurttail ];cb_compkurteeg = [ cb_compkurthead ... checkstatus ... '[EEG locthresh globthresh nrej LASTCOM] = pop_rejkurt( EEG, ' int2str(icacomp) ... ', elecrange, locthresh, globthresh, rejstatus, 0, 1,''' tmp_comall ''');', ... cb_compkurttail ];% -----------------------------------------------------cb_reject = [ 'set( findobj(''parent'', gcbf, ''tag'', ''rejstatus''), ''value'', 3);' ... % force status to 3 checkstatus ... '[EEG LASTCOM] = eeg_rejsuperpose(EEG,' int2str(icacomp) ',1,1,1,1,1,1,1); EEG = h(LASTCOM, EEG);' ... '[EEG LASTCOM] = pop_rejepoch( EEG, EEG.reject.rejglobal, 1);' ... 'if ~isempty(LASTCOM), ' ... ' EEG = h(LASTCOM, EEG); [ALLEEG EEG CURRENTSET LASTCOM] = pop_newset(ALLEEG, EEG, CURRENTSET); h(LASTCOM);' ... 'end; eeglab redraw; close(gcbf);' ];cb_clear = [ 'close gcbf; EEG = rmfield( EEG, ''reject''); EEG.reject.rejmanual = [];' ... 'EEG=eeg_checkset(EEG); pop_rejmenu(' inputname(1) ',' int2str(icacomp) ');' ]; cb_close = [ 'close gcbf;' ... 'disp(''Marks stored in dataset'');' ... '[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET);' ... 'h(''[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET);'');']; lisboxoptions = { 'string', [ 'Show only the new trials marked for rejection by the measure selected above|' ... 'Show previous and new trials marked for rejection by the measure selected above|' ... 'Show all trials marked for rejection by the measure selected above or checked below'], 'tag', 'rejstatus', 'value', 1, 'callback', ... [ 'if get(gcbo, ''value'') == 3,' ... ' set(findobj(''parent'', gcbf, ''style'', ''checkbox''), ''enable'', ''on'');' ... 'else' ... ' set(findobj(''parent'', gcbf, ''style'', ''checkbox''), ''enable'', ''off'');' ... 'end;' ] }; chanliststr = [fastif(icacomp,'Electrode(s)','Component(s)') ]; chanlistval = fastif(icacomp, [ '1:' int2str(EEG.nbchan) ], [ '1:' int2str(size(EEG.icaweights,1)) ]); % assess previous rejections % -------------------------- sizeman = 0; sizethresh = 0; sizetrend = 0; sizejp = 0; sizekurt = 0; sizespec = 0; if icacomp == 1 if ~isempty(EEG.reject.rejmanual), sizeman = length(find(EEG.reject.rejmanual)); end; if ~isempty(EEG.reject.rejconst), sizetrend = length(find(EEG.reject.rejconst)); end; if ~isempty(EEG.reject.rejjp), sizejp = length(find(EEG.reject.rejjp)); end; if ~isempty(EEG.reject.rejkurt), sizekurt = length(find(EEG.reject.rejkurt)); end; if ~isempty(EEG.reject.rejfreq), sizespec = length(find(EEG.reject.rejfreq)); end; else if ~isempty(EEG.reject.icarejmanual), sizeman = length(find(EEG.reject.icarejmanual)); end; if ~isempty(EEG.reject.icarejconst), sizetrend = length(find(EEG.reject.icarejconst)); end; if ~isempty(EEG.reject.icarejjp), sizejp = length(find(EEG.reject.icarejjp)); end; if ~isempty(EEG.reject.icarejkurt), sizekurt = length(find(EEG.reject.icarejkurt)); end; if ~isempty(EEG.reject.icarejfreq), sizespec = length(find(EEG.reject.icarejfreq)); end; end; stdl = [0.25 1.2 0.8 1.2 0.8]; % standard line titl = [0.9 0.18 1.55]; % title line geometry = { [0.883 0.195 .2 .45 .4 .4] ... [1] titl stdl stdl stdl stdl ... [1] titl stdl stdl stdl ... [1] titl stdl stdl stdl ... [1] titl stdl stdl stdl ... [1] titl stdl stdl stdl stdl ... [1] [1] [1] [1 1 1] [1 1 1] ... [1] [1 1 1]}; listui = {{'Style', 'text', 'string', 'Mark trials by appearance', 'fontweight', 'bold' }, ... { 'Style', 'pushbutton', 'string', '', 'tag', 'butmanual', ... 'callback', [ 'tmpcolor = uisetcolor(EEG.reject.rejmanualcol); if length(tmpcolor) ~= 1,' ... 'EEG.reject.rejmanualcol=tmpcolor; set(gcbo, ''backgroundcolor'', tmpcolor); end; clear tmpcolor;'] },... { } { 'Style', 'pushbutton', 'string', fastif(icacomp,'Scroll Data','Scroll Comp. Acts.'), 'callback', cb_manual }, ... { 'Style', 'text', 'string', 'Marked trials' }, ... { 'Style', 'text', 'string', int2str(sizeman), 'tag', 'mantrial' }, ... { }, ... ... % --------------------------------------------------------------------------- { 'Style', 'text', 'string', 'Find abnormal values', 'fontweight', 'bold' }, ... { 'Style', 'pushbutton', 'string', '', 'tag', 'butthresh', ... 'callback', [ 'tmpcolor = uisetcolor(EEG.reject.rejthreshcol); if length(tmpcolor) ~= 1,' ... 'EEG.reject.rejthreshcol=tmpcolor; set(gcbo, ''backgroundcolor'', tmpcolor); end; clear tmpcolor;'] }, { },... ... { }, { 'Style', 'text', 'string', ['Upper limit(s) ' fastif(icacomp,'(uV)', '(std. dev.)')] }, ... { 'Style', 'edit', 'string', '25', 'tag', 'threshpos' }, ... { 'Style', 'text', 'string', ['Lower limit(s) ' fastif(icacomp,'(uV)', '(std. dev.)')] }, ... { 'Style', 'edit', 'string', '-25', 'tag', 'threshneg' }, ... ... { }, { 'Style', 'text', 'string', 'Start time(s) (ms)' }, ... { 'Style', 'edit', 'string', int2str(EEG.xmin*1000), 'tag', 'threshstart' }, ... { 'Style', 'text', 'string', 'Ending time(s) (ms)' }, ... { 'Style', 'edit', 'string', int2str(EEG.xmax*1000), 'tag', 'threshend' }, ... ... { }, { 'Style', 'text', 'string', chanliststr }, ... { 'Style', 'edit', 'string', chanlistval, 'tag', 'threshelec' }, ... { 'Style', 'text', 'string', 'Currently marked trials' }, ... { 'Style', 'text', 'string', int2str(sizethresh), 'tag', 'threshtrial' }, ... ... { }, { 'Style', 'pushbutton', 'string', 'Calc / Plot', 'callback', cb_compthresh }, ... { }, { },{ 'Style', 'pushbutton', 'string', 'HELP', 'callback', 'pophelp(''pop_eegthresh'');' }, ... ... % --------------------------------------------------------------------------- { }, { 'Style', 'text', 'string', 'Find abnormal trends', 'fontweight', 'bold' }, ... { 'Style', 'pushbutton', 'string', '', 'tag', 'buttrend', ... 'callback', [ 'tmpcolor = uisetcolor(EEG.reject.rejconstcol); if length(tmpcolor) ~= 1,' ... 'EEG.reject.rejconstcol=tmpcolor; set(gcbo, ''backgroundcolor'', tmpcolor); end; clear tmpcolor;'] }, { },... ... { }, { 'Style', 'text', 'string', ['Max slope ' fastif(icacomp, ... '(uV/epoch)', ... '(std. dev./epoch)') ] }, ... { 'Style', 'edit', 'string', '50', 'tag', 'constpnts' }, ... { 'Style', 'text', 'string', 'R-squared limit (0 to 1)' }, ... { 'Style', 'edit', 'string', '0.3', 'tag', 'conststd' }, ... ... { }, { 'Style', 'text', 'string', chanliststr }, ... { 'Style', 'edit', 'string', chanlistval, 'tag', 'constelec' }, ... { 'Style', 'text', 'string', 'Currently marked trials' }, ... { 'Style', 'text', 'string', int2str(sizetrend), 'tag', 'consttrial' }, ... ... { }, { 'Style', 'pushbutton', 'string', 'Calc / Plot', 'callback', cb_compconstrej }, ... { }, { }, { 'Style', 'pushbutton', 'string', 'HELP', 'callback', 'pophelp(''pop_rejtrend'');' }, ... ... % --------------------------------------------------------------------------- { }, { 'Style', 'text', 'string', 'Find improbable data', 'fontweight', 'bold' }, ... { 'Style', 'pushbutton', 'string', '', 'tag', 'butjp', ... 'callback', [ 'tmpcolor = uisetcolor(EEG.reject.rejjpcol); if length(tmpcolor) ~= 1,' ... 'EEG.reject.rejjpcol=tmpcolor; set(gcbo, ''backgroundcolor'', tmpcolor); end; clear tmpcolor;'] }, { },... ... { }, { 'Style', 'text', 'string', fastif(icacomp, 'Single-channel limit (std. dev.)', 'Single-comp. limit (std. dev.)') }, ... { 'Style', 'edit', 'string', '5', 'tag', 'entloc' }, ... { 'Style', 'text', 'string', fastif(icacomp, 'All channels limit (std. dev.)', 'All comp. limit (std. dev.)') }, ... { 'Style', 'edit', 'string', '5', 'tag', 'entglob' }, ... ... { }, { 'Style', 'text', 'string', chanliststr }, ... { 'Style', 'edit', 'string', chanlistval, 'tag', 'entelec' }, ... { 'Style', 'text', 'string', 'Currently marked trials' }, ... { 'Style', 'text', 'string', int2str(sizejp), 'tag', 'enttrial' }, ... ... { }, { 'Style', 'pushbutton', 'string', 'Calculate', 'callback', cb_compentcalc }, ... { 'Style', 'pushbutton', 'string', 'Scroll Data', 'callback', cb_compenteeg }, ... { 'Style', 'pushbutton', 'string', 'PLOT', 'callback', cb_compentplot }, ... { 'Style', 'pushbutton', 'string', 'HELP', 'callback', 'pophelp(''pop_jointprob'');' }, ... ... % --------------------------------------------------------------------------- { }, { 'Style', 'text', 'string', 'Find abnormal distributions', 'fontweight', 'bold' }, ... { 'Style', 'pushbutton', 'string', '', 'tag', 'butkurt', ... 'callback', [ 'tmpcolor = uisetcolor(EEG.reject.rejkurtcol); if length(tmpcolor) ~= 1,' ... 'EEG.reject.rejkurtcol=tmpcolor; set(gcbo, ''backgroundcolor'', tmpcolor); end; clear tmpcolor;'] }, { },... ... { }, { 'Style', 'text', 'string', fastif(icacomp, 'Single-channel limit (std. dev.)', 'Single-comp. limit (std. dev.)') }, ... { 'Style', 'edit', 'string', '5', 'tag', 'kurtloc' }, ... { 'Style', 'text', 'string', fastif(icacomp, 'All channels limit (std. dev.)', 'All comp. limit (std. dev.)') }, ... { 'Style', 'edit', 'string', '5', 'tag', 'kurtglob' }, ... ... { }, { 'Style', 'text', 'string', chanliststr }, ... { 'Style', 'edit', 'string', chanlistval, 'tag', 'kurtelec' }, ... { 'Style', 'text', 'string', 'Currently marked trials' }, ... { 'Style', 'text', 'string', int2str(sizekurt), 'tag', 'kurttrial' }, ... ... { }, { 'Style', 'pushbutton', 'string', 'Calculate', 'callback', cb_compkurtcalc }, ... { 'Style', 'pushbutton', 'string', 'Scroll Data', 'callback', cb_compkurteeg }, ... { 'Style', 'pushbutton', 'string', 'PLOT', 'callback', cb_compkurtplot }, ... { 'Style', 'pushbutton', 'string', 'HELP', 'callback', 'pophelp(''pop_rejkurt'');' }, ... ... % --------------------------------------------------------------------------- { }, { 'Style', 'text', 'string', 'Find abnormal spectra (efficient but slow)', 'fontweight', 'bold' }, ... { 'Style', 'pushbutton', 'string', '', 'tag', 'butspec', ... 'callback', [ 'tmpcolor = uisetcolor(EEG.reject.rejfreqcol); if length(tmpcolor) ~= 1,' ... 'EEG.reject.rejfreqcol=tmpcolor; set(gcbo, ''backgroundcolor'', tmpcolor); end; clear tmpcolor;'] }, { },... ... { }, { 'Style', 'text', 'string', 'Upper limit(s) (dB)' }, ... { 'Style', 'edit', 'string', '25', 'tag', 'freqpos' }, ... { 'Style', 'text', 'string', 'Lower limit(s) (dB)' }, ... { 'Style', 'edit', 'string', '-25', 'tag', 'freqneg' }, ... ... { }, { 'Style', 'text', 'string', 'Low frequency(s) (Hz)' }, ... { 'Style', 'edit', 'string', '0', 'tag', 'freqstart' }, ... { 'Style', 'text', 'string', 'High frequency(s) (Hz)' }, ... { 'Style', 'edit', 'string', '50', 'tag', 'freqend' }, ... ... { }, { 'Style', 'text', 'string', chanliststr }, ... { 'Style', 'edit', 'string', chanlistval, 'tag', 'freqelec' }, ... { 'Style', 'text', 'string', 'Currently marked trials' }, ... { 'Style', 'text', 'string', int2str(sizespec), 'tag', 'freqtrial' }, ... ... { }, { 'Style', 'pushbutton', 'string', 'Calc / Plot', 'callback', cb_compfreq }, ... { }, { },{ 'Style', 'pushbutton', 'string', 'HELP', 'callback', 'pophelp(''pop_rejspec'');' }, ... ... {}, ... % --------------------------------------------------------------------------- ... { 'Style', 'text', 'string', 'Plotting options', 'fontweight', 'bold' }, ... { 'style', 'listbox', lisboxoptions{:}, 'value', 3 }, ... { 'style', 'checkbox', 'String', 'Abnormal appearance', 'tag', 'IManual', 'value', 1, ... 'callback', 'set(gcbo, ''value'', 1); disp(''This checkbox must be set so that you may mark/unmark data epochs'');'}, ... { 'style', 'checkbox', 'String', 'Abnormal values', 'tag', 'IThresh', 'value', 1}, ... { 'style', 'checkbox', 'String', 'Abnormal trends', 'tag', 'IConst', 'value', 1}, ... { 'style', 'checkbox', 'String', 'Improbable epochs', 'tag', 'IEnt', 'value', 1}, ... { 'style', 'checkbox', 'String', 'Abnormal distributions', 'tag', 'IKurt', 'value', 1}, ... { 'style', 'checkbox', 'String', 'Abnormal spectra', 'tag', 'IFreq', 'value', 1}, ... ... { }, ... { 'Style', 'pushbutton', 'string', 'CLOSE (KEEP MARKS)', 'callback', cb_close }, ... { 'Style', 'pushbutton', 'string', 'CLEAR ALL MARKS', 'callback', cb_clear }, ... { 'Style', 'pushbutton', 'string', 'REJECT MARKED TRIALS', 'callback', cb_reject }}; allh = supergui( gcf, geometry, [], listui{:});% { 'style', 'checkbox', 'String', ['Include ' fastif(icacomp, 'ica data', 'raw data')], 'tag', 'IOthertype', 'value', 1}, { }, ...set(gcf, 'userdata', { allh }); set(findobj('parent', gcf', 'tag', 'butmanual'), 'backgroundcolor', EEG.reject.rejmanualcol);set(findobj('parent', gcf', 'tag', 'butthresh'), 'backgroundcolor', EEG.reject.rejthreshcol);set(findobj('parent', gcf', 'tag', 'buttrend'), 'backgroundcolor', EEG.reject.rejconstcol);set(findobj('parent', gcf', 'tag', 'butjp'), 'backgroundcolor', EEG.reject.rejjpcol);set(findobj('parent', gcf', 'tag', 'butkurt'), 'backgroundcolor', EEG.reject.rejkurtcol);set(findobj('parent', gcf', 'tag', 'butspec'), 'backgroundcolor', EEG.reject.rejfreqcol);set( findobj('parent', gcf, 'tag', 'rejstatus'), 'style', 'popup');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -