-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathremove ICs
48 lines (47 loc) · 1.83 KB
/
remove ICs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
clear;
close all;
eeglab;
spath = 'D:\ERP\4_1_ICA\';
rpath = 'D:\ERP\5_1_adjust\';
struc = struct('sub1',[1 8 26 41],...
'sub2',[1 3 16],...
'sub3',[1 5 64],...
'sub4',[1 4 64],...
'sub5',[2 3 4 5 6 13 17 41 48 51],...
'sub6',[1 2 23 27 56 57 60],...
'sub7',[1 2 7 18 30 60],...
'sub8',[3 8 45 53],...
'sub9',[1 18 49],...
'sub10',[3 12 15 28 45 48 51],...
'sub11',[1 2 3 4 5 6 7 10 18 22 24],...
'sub12',[1 6 13 21 29 40 48 57],...
'sub13',[1 4 53],...
'sub14',[12 18 56],...
'sub15',[1 4 11 17 33 42 43 47],...
'sub16',[1 2 5 6 19 20 26 28 31 32 34 36 40 47 49 53 58],...
'sub17',[5 6 7 10 11],...
'sub18',[1 3 18 26 29 34 35 51 53 63],...
'sub19',[3 10 29 39 43],...
'sub20',[1 3 8 11 15 18 21 32 34 38 44 46 51 54 56],...
'sub21',[9 10 12 15 16 18 19 23 25 64],...
'sub22',[1 4 9 16 23 43],...
'sub23',[1 2 5 6 8],...
'sub24',[1 5 8 19 55 56],...
'sub25',[1 2 3 4 7 8 36 38 46],...
'sub26',[1 2 3 4 5 7 11 15 22 28 42]);
subj_list = fieldnames(struc);
for n = 1 : 26
sub = subj_list{n};
%% load dataset
setfile = [spath sub '_ica.set'];
EEG = pop_loadset(setfile);
EEG = eeg_checkset( EEG );
%% remove ICs
ICs = struc.(sub);
EEG = pop_subcomp( EEG, ICs, 0);
EEG = eeg_checkset( EEG );
%% save datasets
outfile = [rpath sub '_rmIC.set'];
EEG = pop_saveset( EEG, outfile);
EEG = eeg_checkset( EEG );
end