ENH: Preserve annotations in epochs
See original GitHub issueDescribe the new feature or enhancement
Is there a way to map annotations from the raw dataset onto the AverageTFR object? Since the tfr is occurring over windows, then the time scale of the annotations from the original time scale are inherently different.
E.g. if I have an event at sample 10000, with sfreq=1000, then it occurs at 10 seconds into the raw dataset. If i have an averageTFR that was computed with a moving window of say 1 second step size, then the new sample point of the event would be 10.
Describe your proposed implementation
Ideally this would consist of two things that I could see being useful:
-
A public function
map_annotations_to_sfreqthat allows mappingAnnotationsto different time-scales based on a passed say…sfreqvalue. So based on the above example, if I wanted to mapAnnotationsthat are based onsfreq=1000Hz, to some tfr object withsfreq=1Hz, then I would somehow pass that information tomap_annotations_to_sfreqthat returns me a newAnnotationsobject that hasonsetanddurationin the new time-scale. -
Use the public function above to make
AverageTFR, orEpochsTFR, etc. to keep theirAnnotationswhen the time-scale changes.
I strongly would prefer having 1 because besides mne-python objects, I create other derivatives of the raw data that inherently have a “sliding” window component to them, and hence change the time-scale in the same way as a sliding FFT would.
Additional comments
@larsoner’s comment on gitter for reference:
@adam2392 in principle we should be able to do that at least for EpochsTFR, can you open an issue feature request? For AverageTFR I'm not sure because we don't preserve annotations in Evoked even (just Raw and Epochs) so we'd probably want to do that first before doing it for AverageTFR
Issue Analytics
- State:
- Created 3 years ago
- Comments:19 (19 by maintainers)

Top Related StackOverflow Question
on discord, but separate from the office hours. I didn’t find you in a search of the discord users, ping me there and I’ll fill you in.
I think we’ll want some time to fully test + implement this (including viz) so I think this shouldn’t go into 0.24 but rather 0.25/1.0