|
59 | 59 | disp(status_tbl)
|
60 | 60 | status = table2array(status_tbl);
|
61 | 61 |
|
| 62 | + splitted = split(EEG.filename(1:end-4),'_'); |
| 63 | + modality = splitted{end}; |
| 64 | + |
62 | 65 | fprintf('Running pipeline sequence %s\n', strjoin(opt.pipeline, '->'));
|
63 | 66 | try
|
64 | 67 | for i=1:numel(opt.pipeline)
|
|
88 | 91 | rm_chan_types = {'AUDIO','MEG','EOG','ECG','EMG','EYEGAZE','GSR','HEOG','MISC','PPG','PUPIL','REF','RESP','SYSCLOCK','TEMP','TRIG','VEOG'};
|
89 | 92 | if isfield(EEG.chanlocs, 'type')
|
90 | 93 | EEG = pop_select(EEG, 'rmchantype', rm_chan_types);
|
91 |
| - types = {EEG.chanlocs.type}; |
92 |
| - eeg_indices = strmatch('EEG', types)'; |
93 |
| - if ~isempty(eeg_indices) |
94 |
| - EEG = pop_select(EEG, 'chantype', 'EEG'); |
95 |
| - else |
96 |
| - warning("No EEG channel type detected (for first EEG file). Keeping all channels"); |
97 |
| - end |
| 94 | + if strcmp(modality, 'eeg') |
| 95 | + types = {EEG.chanlocs.type}; |
| 96 | + eeg_indices = strmatch('EEG', types)'; |
| 97 | + if ~isempty(eeg_indices) |
| 98 | + EEG = pop_select(EEG, 'chantype', 'EEG'); |
| 99 | + else |
| 100 | + warning("No EEG channel type detected (for first EEG file). Keeping all channels"); |
| 101 | + end |
| 102 | + end |
98 | 103 | else
|
99 |
| - warning("Channel type not detected (for first EEG file)"); |
| 104 | + warning("Channel type not detected (for first recording file)"); |
100 | 105 | end
|
101 |
| - % ALLEEG = pop_select( ALLEEG,'nochannel',{'VEOG', 'Misc', 'ECG', 'M2'}); |
102 |
| - |
103 | 106 | status_tbl.remove_chan = 1;
|
104 | 107 | end
|
105 | 108 |
|
|
120 | 123 | 'LineNoiseCriterion',4,'Highpass',[0.75 1.25] ,'BurstCriterion',20, ...
|
121 | 124 | 'WindowCriterion',0.25,'BurstRejection','on','Distance','Euclidian', ...
|
122 | 125 | 'WindowCriterionTolerances',[-Inf 7] ,'fusechanrej',1}; % based on Arnaud paper
|
123 |
| - % ALLEEG = parexec(ALLEEG, 'pop_clean_rawdata', opt.logdir, options{:}); |
124 | 126 | EEG = pop_clean_rawdata( EEG, options{:});
|
125 | 127 |
|
126 | 128 | status_tbl.cleanraw = 1;
|
127 | 129 | end
|
128 | 130 |
|
| 131 | + %{ |
129 | 132 | if strcmp(operation, "avg_ref")
|
130 | 133 | if resume && status_tbl.avg_ref
|
131 | 134 | fprintf('Skipping avg_ref\n');
|
|
138 | 141 |
|
139 | 142 | status_tbl.avg_ref = 1;
|
140 | 143 | end
|
| 144 | + %} |
141 | 145 |
|
142 | 146 | if strcmp(operation, "runica")
|
143 | 147 | if resume && status_tbl.runica
|
|
154 | 158 | status_tbl.runica = 1;
|
155 | 159 | end
|
156 | 160 |
|
157 |
| - if strcmp(operation, "iclabel") |
| 161 | + if strcmp(operation, "iclabel") && strcmp(modality, 'eeg') |
158 | 162 | if resume && status_tbl.iclabel
|
159 | 163 | fprintf('Skipping iclabel\n');
|
160 | 164 | continue
|
|
0 commit comments