mne-tools / mne-python

MNE: Magnetoencephalography (MEG) and Electroencephalography (EEG) in Python
https://mne.tools
BSD 3-Clause "New" or "Revised" License
2.68k stars 1.31k forks source link

API: Use annotations for read_raw_egi events rather than synthetic channel #12262

Closed larsoner closed 2 months ago

larsoner commented 10 months ago

In https://github.com/mne-tools/mne-python/pull/4017#issuecomment-299519890 we added RawEGI.event_id which disappears on round-trip. This is due to not knowing which/how many DIN channels will get triggers.

Nowadays we should use Annotations rather than synthesize an event channel I think. Not sure if it's worth keeping the event channel synthesizing around for backward compat or deprecating it. But either way adding the annotations will make it possible for people to use modern code rather than relying on raw.event_id here.

See also discourse for discussion.

scott-huberty commented 10 months ago

Given that it's been a while now that we've wanted to switch to using mffpy for reading EGI files ( #6937 , #8038 , #11380 ), maybe it would be a good time to implement that, and while doing so, make this transition from synthetic channels to annotations?

larsoner commented 10 months ago

Perhaps. But I think switching to mffpy is potentially a much bigger undertaking and so far no one has volunteered. And either way we need to go from DIN events (extracted from somewhere) to mne.Annotations, so a first small PR to add DIN-as-annot wouldn't be wasted effort. @scott-huberty if you are interested in learning a bit of EGIMFF the first small PR would be a good place to start :)

scott-huberty commented 10 months ago

I've worked on that module and have used EGI a lot, so go ahead and assign to me!