|
39 | 39 | end |
40 | 40 |
|
41 | 41 | if nargin < 2 |
| 42 | + if length(EEG) == 1 |
| 43 | + eeg_icalabelstat(EEG); |
| 44 | + end |
| 45 | + |
42 | 46 | cat = { 'Brain' 'Muscle' 'Eye' 'Heart' 'Line Noise' 'Channel Noise' 'Other' }; |
43 | 47 | defaultMin = { '' '0.9' '0.9' '' '' '' '' }; |
44 | 48 | defaultMax = { '' '1' '1' '' '' '' '' }; |
|
58 | 62 |
|
59 | 63 | res = inputgui(allGeom, allRows); |
60 | 64 | if isempty(res) |
| 65 | + com = ''; |
61 | 66 | return |
62 | 67 | end |
63 | 68 |
|
64 | 69 | thresh = cellfun(@str2double, res); |
65 | 70 | thresh = reshape(thresh, 2, 7)'; |
66 | 71 | end |
67 | 72 |
|
68 | | -com = sprintf('EEG = pop_icflag(EEG, %s);',vararg2str(thresh)); |
69 | | - |
70 | 73 | if length(EEG) > 1 |
71 | | - for iEEG = 1:length(EEG) |
72 | | - % run iclabel |
73 | | - EEG(iEEG) = pop_icflag(EEG(iEEG), thresh); |
| 74 | + [ EEG, com ] = eeg_eval( 'pop_icflag', EEG, 'params', { thresh } ); |
| 75 | +else |
| 76 | + % perform rejection |
| 77 | + flagReject = zeros(1,size(EEG.icaweights,1))'; |
| 78 | + for iCat = 1:7 |
| 79 | + tmpReject = EEG.etc.ic_classification.ICLabel.classifications(:,iCat) > thresh(iCat,1) & EEG.etc.ic_classification.ICLabel.classifications(:,iCat) < thresh(iCat,2); |
| 80 | + flagReject = flagReject | tmpReject; |
74 | 81 | end |
75 | | - return |
| 82 | + EEG.reject.gcompreject = flagReject; |
| 83 | + fprintf('%d components rejected\n', sum(flagReject)); |
| 84 | + com = sprintf('EEG = pop_icflag(EEG, %s);',vararg2str(thresh)); |
76 | 85 | end |
77 | 86 |
|
78 | | -% perform rejection |
79 | | -flagReject = zeros(1,size(EEG.icaweights,1))'; |
80 | | -for iCat = 1:7 |
81 | | - tmpReject = EEG.etc.ic_classification.ICLabel.classifications(:,iCat) > thresh(iCat,1) & EEG.etc.ic_classification.ICLabel.classifications(:,iCat) < thresh(iCat,2); |
82 | | - flagReject = flagReject | tmpReject; |
83 | | -end |
84 | | -EEG.reject.gcompreject = flagReject; |
85 | | -fprintf('%d components rejected\n', sum(flagReject)); |
86 | | - |
87 | | - |
0 commit comments