I have been working step be step through the mne-bids-pipeline, sorting out one problem after the other, but now I am stuck at the âcalculating ICA solutionâ step:
[15:28:51] preprocessing/_04a_run_ica sub-AUAY02MA A critical error occured. The error message was: No EOG channel(s) found
Aborting pipeline run.
âŠ
File â/Users/opt/miniconda3/envs/mne/lib/python3.10/site-packages/mne/preprocessing/eog.pyâ, line 142, in _get_eog_channel_index
raise RuntimeError(âNo EOG channel(s) foundâ)
RuntimeError: No EOG channel(s) found
In my customised config file I have defined the eog as virtual channels as no separate eog channels were recorded.
eog_channels: Optional[Iterable[str]] = ['Fp1', 'Fp2'] (reference has been set to average, and analyse channels to all).
It doesnât seem to recognise the eog-specification. What am I missing? Do I need to specify the eog channels anywhere else?
@fraenni If you cannot get it to work, I invite you to join our tomorrowâs online office hour, where we can try to figure things out together via screen share:
The office hours sound great. thanks. will try to join.
Here is the full error message:
[15:56:05] preprocessing/_04a_run_ica sub-AUAY02MA A critical error occured. The error message was: No EOG channel(s) found
Aborting pipeline run.
Traceback (most recent call last):
File "/Users/PredictiveLanguageCoding_EEG/EEG_analysis/mne-bids-pipeline-main-3/run.py", line 246, in <module>
fire.Fire(process)
File "/Users/opt/miniconda3/envs/mne/lib/python3.10/site-packages/fire/core.py", line 141, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "/Users/opt/miniconda3/envs/mne/lib/python3.10/site-packages/fire/core.py", line 466, in _Fire
component, remaining_args = _CallAndUpdateTrace(
File "/Users/opt/miniconda3/envs/mne/lib/python3.10/site-packages/fire/core.py", line 681, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "/Users//PredictiveLanguageCoding_EEG/EEG_analysis/mne-bids-pipeline-main-3/run.py", line 241, in process
script_module.main()
File "/Users//PredictiveLanguageCoding_EEG/EEG_analysis/mne-bids-pipeline-main-3/scripts/preprocessing/_04a_run_ica.py", line 534, in main
logs = parallel(
File "/Users//PredictiveLanguageCoding_EEG/EEG_analysis/mne-bids-pipeline-main-3/scripts/preprocessing/_04a_run_ica.py", line 535, in <genexpr>
run_func(
File "/Users//PredictiveLanguageCoding_EEG/EEG_analysis/mne-bids-pipeline-main-3/config.py", line 2803, in wrapper
raise(e)
File "/Users//PredictiveLanguageCoding_EEG/EEG_analysis/mne-bids-pipeline-main-3/config.py", line 2785, in wrapper
out = func(*args, **kwargs)
File "/Users//PredictiveLanguageCoding_EEG/EEG_analysis/mne-bids-pipeline-main-3/scripts/preprocessing/_04a_run_ica.py", line 408, in run_ica
eog_ics, eog_scores = detect_bad_components(
File "/Users/PredictiveLanguageCoding_EEG/EEG_analysis/mne-bids-pipeline-main-3/scripts/preprocessing/_04a_run_ica.py", line 204, in detect_bad_components
inds, scores = ica.find_bads_eog(
File "<decorator-gen-423>", line 12, in find_bads_eog
File "/Users/opt/miniconda3/envs/mne/lib/python3.10/site-packages/mne/preprocessing/ica.py", line 1751, in find_bads_eog
eog_inds = _get_eog_channel_index(ch_name, inst)
File "/Users/opt/miniconda3/envs/mne/lib/python3.10/site-packages/mne/preprocessing/eog.py", line 142, in _get_eog_channel_index
raise RuntimeError('No EOG channel(s) found')
RuntimeError: No EOG channel(s) found
Something just came to my mind: Are you sure the channels are actually named Fp1 and Fp2, and not FP1 and FP2, as is sometimes the case? MNE is case-sensitive, hence such a slight change can make all the difference sometimesâŠ
When I am running the code I am still getting this error in run_ica:
[15:40:02] **preprocessing/_04a_run_ica** **sub-TUCO02IR** **A critical error occured. The error message was: No EOG channel found. Cannot reject based on EOG.**
**Aborting pipeline run. The full traceback is:**
**Traceback (most recent call last):**
**File "/Users/Franziska/Dropbox/PredictiveLanguageCoding_EEG/EEG_analysis/mne-bids-pipeline-main/config.py", line 2785, in wrapper**
**out = func(*args, **kwargs)**
**File "/Users/Franziska/Dropbox/PredictiveLanguageCoding_EEG/EEG_analysis/mne-bids-pipeline-main/scripts/preprocessing/_04a_run_ica.py", line 380, in run_ica**
**epochs.drop_bad(reject=cfg.ica_reject)**
**File "<decorator-gen-251>", line 12, in drop_bad**
**File "/Users/Franziska/opt/miniconda3/envs/mne/lib/python3.10/site-packages/mne/epochs.py", line 1269, in drop_bad**
**self._reject_setup(reject, flat)**
**File "/Users/Franziska/opt/miniconda3/envs/mne/lib/python3.10/site-packages/mne/epochs.py", line 772, in _reject_setup**
**raise ValueError("No %s channel found. Cannot reject based on "**
**ValueError: No EOG channel found. Cannot reject based on EOG.**
It seems like the same error, or am I missing something?
This is a slightly different issue now, caused by this line;
since your data doesnât have an EOG channel, you cannot set an EOG rejection threshold. When you specify eog_channels, those channels will be used to detect EOG artifacts. But we wonât change their channel type to eog â in your case, they remain EEG channels.
Simply pass a single eeg rejection threshold and drop the eog threshold, and the issue should go away.
I had briefly discussed this behavior with @agramfort last week and we agreed that it should probably be the right thing to do. But I suppose we need to expand the documentation thereâŠ
Okay, fantastic, that makes sense, and that is exactly what I have done!
One more question regarding the notch filter - at the moment the pipeline does not include one. Do you have any suggestion how I can tackle that from within the pipeline if I want to filter power line noise?