mne-tools / mne-tools/mne-python

read_raw_eeglab fails to take `eog` param into account when setting montage

Open
#10,505 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

BUG
Dominant language
Python
Stars
3.5k
Forks
1.6k
Avg merge
1d 6h
Merged PRs (30d)
100

Description

Describe the bug

When reading a raw EEGLAB format data file that contains:

  1. EOG channels
  2. channel locations

and when setting the eog parameter of the read_raw_eeglab function,
then a warning is raised:

RuntimeWarning: Not setting positions of 2 eog channels found in montage:
['VEOG', 'HEOG']
Consider setting the channel types to be of EEG/sEEG/ECoG/DBS/fNIRS using inst.set_channel_types before calling inst.set_montage, or omit these channels when creating your montage.
raw = mne.io.read_raw_eeglab(fname_set, eog=["VEOG", "HEOG"])

Steps to reproduce
  1. download EMP01.set and EMP01.fdt from https://uni-muenster.sciebo.de/s/zg2U8xVNZbRHqzg?path=%2Feeg_eeglab
  2. run the following code:
# %%
import mne

fpath = "~/Downloads/EMP01.set"

# this raises the warning
raw = mne.io.read_raw_eeglab(fpath, eog=["VEOG", "HEOG"])

# NOTE: this passes fine (but VEOG and HEOG have the eeg ch_type instead of the correct eog ch_type)
raw = mne.io.read_raw_eeglab(fpath)
Expected results

No warning should be raised, because the function already has the information about eog channels.

Actual results

RuntimeWarning: Not setting positions of 2 eog channels found in montage:
['VEOG', 'HEOG']
Consider setting the channel types to be of EEG/sEEG/ECoG/DBS/fNIRS using inst.set_channel_types before calling inst.set_montage, or omit these channels when creating your montage.
raw = mne.io.read_raw_eeglab(fname_set, eog=["VEOG", "HEOG"])

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the mne.io.read_raw_eeglab entry point and reproduce the warning with the provided EMP01.set and EMP01.fdt files, passing eog=["VEOG", "HEOG"]. Trace how the eog parameter and channel locations are handled during montage setup; done means the channels retain the eog type and no warning is raised.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.