@@ -54,17 +54,16 @@ pop_editoptions( 'option_storedisk', 1); % only one dataset in memory at a time
54
54
ALLEEG = pop_select( ALLEEG,'rmchannel',{'EXG1','EXG2','EXG3','EXG4','EXG5','EXG6','EXG7','EXG8', 'GSR1', 'GSR2', 'Erg1', 'Erg2', 'Resp', 'Plet', 'Temp'});
55
55
56
56
% compute average reference
57
- ALLEEG = pop_reref( ALLEEG,[]);
57
+ ALLEEG = pop_reref( ALLEEG, []);
58
58
59
59
% clean data using the clean_rawdata plugin
60
60
ALLEEG = pop_clean_rawdata( ALLEEG,'FlatlineCriterion',5,'ChannelCriterion',0.87, ...
61
61
'LineNoiseCriterion',4,'Highpass',[0.25 0.75] ,'BurstCriterion',20, ...
62
62
'WindowCriterion',0.25,'BurstRejection','on','Distance','Euclidian', ...
63
63
'WindowCriterionTolerances',[-Inf 7] ,'fusechanrej',1);
64
64
65
- % recompute average reference interpolating missing channels (and removing
66
- % them again after average reference - STUDY functions handle them automatically)
67
- ALLEEG = pop_reref( ALLEEG,[],'interpchan',[]);
65
+ % recompute average reference
66
+ ALLEEG = pop_reref( ALLEEG,[]);
68
67
69
68
% run ICA reducing the dimension by 1 to account for average reference
70
69
plugin_askinstall('picard', 'picard', 1); % install Picard plugin
@@ -74,6 +73,14 @@ ALLEEG = pop_runica(ALLEEG, 'icatype','picard','concatcond','on','options',{'pca
74
73
ALLEEG = pop_iclabel(ALLEEG, 'default');
75
74
ALLEEG = pop_icflag( ALLEEG,[NaN NaN;0.9 1;0.9 1;NaN NaN;NaN NaN;NaN NaN;NaN NaN]);
76
75
76
+ % Optional: remove flagged ICA components (otherwise done at the STUDY level), then recompute the
77
+ % average reference using the Huber method interpolating missing channels (and removing them again
78
+ % after average reference). See tutorial section 5.b.
79
+ if 0
80
+ ALLEEG = pop_subcomp(ALLEEG, []);
81
+ ALLEEG = pop_reref( ALLEEG,[],'huber', 25, 'interpchan',[]);
82
+ end
83
+
77
84
% extract data epochs
78
85
ALLEEG = pop_epoch( ALLEEG,{'oddball_with_reponse','standard'},[-1 2] ,'epochinfo','yes');
79
86
ALLEEG = eeg_checkset( ALLEEG );
@@ -123,7 +130,7 @@ pop_editoptions( 'option_storedisk', 1); % only one dataset in memory at a time
123
130
ALLEEG = pop_select( ALLEEG,'rmchannel',{'EXG1','EXG2','EXG3','EXG4','EXG5','EXG6','EXG7','EXG8', 'GSR1', 'GSR2', 'Erg1', 'Erg2', 'Resp', 'Plet', 'Temp'});
124
131
125
132
% compute average reference
126
- ALLEEG = pop_reref( ALLEEG,[]);
133
+ ALLEEG = pop_reref( ALLEEG, []);
127
134
128
135
% clean data using the clean_rawdata plugin
129
136
ALLEEG = pop_clean_rawdata( ALLEEG,'FlatlineCriterion',5,'ChannelCriterion',0.87, ...
@@ -133,7 +140,7 @@ ALLEEG = pop_clean_rawdata( ALLEEG,'FlatlineCriterion',5,'ChannelCriterion',0.87
133
140
134
141
% recompute average reference interpolating missing channels (and removing
135
142
% them again after average reference - STUDY functions handle them automatically)
136
- ALLEEG = pop_reref( ALLEEG,[],'interpchan', []);
143
+ ALLEEG = pop_reref( ALLEEG, []);
137
144
138
145
% run ICA reducing the dimension by 1 to account for average reference
139
146
plugin_askinstall('picard', 'picard', 1); % install Picard plugin
@@ -143,6 +150,14 @@ ALLEEG = pop_runica(ALLEEG, 'icatype','picard','concatcond','on','options',{'pca
143
150
ALLEEG = pop_iclabel(ALLEEG, 'default');
144
151
ALLEEG = pop_icflag( ALLEEG,[NaN NaN;0.9 1;0.9 1;NaN NaN;NaN NaN;NaN NaN;NaN NaN]);
145
152
153
+ % Optional: remove flagged ICA components (otherwise done at the STUDY level), then recompute the
154
+ % average reference using the Huber method interpolating missing channels (and removing them again
155
+ % after average reference). See tutorial section 5.b.
156
+ if 0
157
+ ALLEEG = pop_subcomp(ALLEEG, []);
158
+ ALLEEG = pop_reref( ALLEEG,[],'huber', 25, 'interpchan',[]);
159
+ end
160
+
146
161
% extract data epochs
147
162
% this is not necessary if you have resting state data or eyes open
148
163
% eyes closed data, you need to define the design in the STUDY
0 commit comments