question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ENH: Remaining stuff for Epochs annotations

See original GitHub issue

From https://github.com/mne-tools/mne-python/pull/9969, @adam2392 we should take care of these before 1.0. Creating this issue so that we don’t forget:

  • Annotations will be lost on save. (#10019)
  • It is not yet possible to add annotations to the Epochs object programmatically (via code)

The first one here seems less critical to me, so I think we could leave it for 1.1, and the second one is too hard for 1.0:

  • Concatenating :class:~mne.Epochs objects that contain annotations is not supported, and any annotations will be dropped when concatenating.
  • It is not yet possible to add annotations to the Epochs object interactively (through the plot window)

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
larsonercommented, Feb 11, 2022

I see that makes sense. Then set_annotations_by_epoch would set one “annotation” with the duration of the epoch by default. Alternatively, it can set multiple annotations with no duration.

Now we’re talking API… I think maybe a user could pass a list of length n_epochs with onset/duration/desc tuples inside or something. But we can hash that out based on a use case…

I am down to work on this down the line, but am quite busy recently. Maybe a newcomer developer would like to take this on?

… so I think we should wait until someone with a sense of using MNE Epochs and Annotations wants to actually do this sort of thing, and let that guide the API. Having an actual use case will make it clear what we need to add, I think.

2reactions
larsonercommented, Feb 11, 2022

It would be nice to be able to set the annotations specifying epoch indices and times wrt to epoch times. But please correct me if I’m wrong.

Would you be able to illustrate an example for that use case?

A simple one is if someone does read_epochs_eeglab or creates an EpochsArray – it would be nice for them to be able to say “I know in epoch 2 in this time interval something bad happens”, both via interaction in the epochs browser, and programmatically via some suitable method like epochs.set_annotations_by_epoch(...) (name and API TBD)

Read more comments on GitHub >

github_iconTop Results From Across the Web

mne.Epochs — MNE 1.2.2 documentation - MNE-Python
The number of remaining epochs. Notes. This function only works if bad epochs have been dropped. Examples. This can be used as:.
Read more >
automatic bad channel / bad epoch detection · Issue #1737 ...
On a dataset with many subjects and many epochs, eye-balling data to mark bad channels and bad epochs becomes cumbersome.
Read more >
Group Analysis in MNE-Python of Evoked Responses ... - NCBI
An important aim of an analysis pipeline for magnetoencephalographic data is ... the remaining nine seconds were cut into three epochs of non-stimulation....
Read more >
A superposed epoch analysis of auroral evolution during ...
Superposed epoch analysis of the interplanetary magnetic field for ... In each case there is a clear enhancement in auroral brightness at ...
Read more >
Notes from Underground - Wikipedia
Notes from Underground is a novella by Fyodor Dostoevsky, first published in the journal Epoch in 1864. It is a first-person narrative in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found