Event name issues with mne.channels.combine_channels()

  • MNE version: 1.4.0
  • operating system: macOS 13

Hi guys, I wanted to combine channels for an mne.Epochs object with mne.channels.combine_channels but the resulting instance is an mne.Epochs object without the event names. I could map again the name with the event id but I have a lot of different events and it can be repetitive.

In the code on Github I noticed in the function combine_channels the epochs are re-built back with mne.EpochsArray (line 2296) with the parameters events specified: inst.events, but event_id is not provided.

So I was wondering if it would work if instead of:

combined_inst = EpochsArray(
            new_data,
            info,
            events=inst.events,
            tmin=inst.times[0],
            baseline=inst.baseline,
        )

It would be possible to add event_id:

combined_inst = EpochsArray(
            new_data,
            info,
            events=inst.events,
            event_id=inst.event_id
            tmin=inst.times[0],
            baseline=inst.baseline,
        )

I am creating a new issue on Github and submitting a pull request that should solve the issue. The modification will be what I described above, hope this microscopic contribution can help! :stuck_out_tongue:

1 Like

Hello, even tiny contributions are greatly appreciated! Please do feel free to contribute no matter how “minor” you perceive your contribution to be — it could make a huge difference to other users!

Best wishes,
Richard

2 Likes

Thanks! My pleasure, happy to help anytime!

UPDATE: This topic has been addressed in Github in issue #11784 and have been solved in (closed) pull request #11786

2 Likes