Converting channels labeled stim to misc

  • MNE version: 1.9
  • operating system: e.g. macOS 15.4

I am trying to read our eeg data using mne.io.read_raw_egi. So far so good. The purpose of using mne for us is to setup the data to be fed to another pipeline that uses mne but that does not share our data structure. Part of the process in the other pipeline is that channels that are not of type ‘eeg’ are labeled 'misc. When I looked at out channel types I see:

Channel types t1: [‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘eeg’, ‘stim’, ‘stim’]

I was wondering if I can use the misc flag in mne.io.read_raw_egi to mark them as ‘misc’. I tried submitting a list with the channels names, types and positions but it generates an error -so obviously I am doing it wrong or perhaps it is not what I think the option is.

File "test.py", line 32, in <module>
    raw_data_t1 = mne.io.read_raw_egi(input_fname_t1, eog=None, misc=['stim'], include=None, 
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
packages/mne/io/egi/egimff.py", line 461, in __init__
    assert len(cals) == len(ch_names), (len(cals), len(ch_names))
AssertionError: (132, 131)

Thanks for any pointers.

I think you need to pass the actual channels names to the misc parameter. So For example

mne.io.read-raw_egi(fname, misc=["stm+", "DIN1"]) # use your actual stim names

But I would nudge you to reconsider whether this is actually the right solution for you. stim channels (sometimes called trigger channels) represent the onset of your experimental events, and IMO those stim channels should probably stay labeled as such.

I think the misc channel type is a catch-all for any signals that don’t already have a internal “type” in MNE… Like in eye-tracking, if we have channel for the eye’s distance from the screen, we label it as misc.

If you don’t care about your stim channels for your analyses, maybe a better option is to drop any non-eeg channels in your data by doing raw.pick("eeg")

I tried the syntax and still got the same error. That being said I am going to read thru the other pipeline to see if I can get away with only having eeg channels.