Allow making evokeds per event type
See original GitHub issueDescribe the new feature or enhancement
It is very common that you want Evokeds for each event type, for example:
epochs = mne.Epochs(raw, events, {'left': 1, 'right': 2})
evokeds = [epochs['left'].average(), epochs['right'].average()] # <-- Make this easier
Describe your proposed implementation
Add a parameter to the Epochs.average
method:
evokeds = epochs.average(per_event_type=True)
Furthermore, the .comment
attribute should be set to the event type.
Describe possible alternatives
Keep the following list comprehension as canonical solution:
evokeds = [epochs[cond] for cond in epochs.event_id.keys()]
for ev, cond in zip(evokeds, epochs.event_id.keys()):
ev.comment = cond
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
mne.Evoked — MNE 1.2.2 documentation - MNE-Python
Make animation of evoked data as topomap timeseries. anonymize ([daysback, keep_his ... Get a list of channel type for each channel.
Read more >Averaging ERPs: Creating MNE Evoked objects
Create Evoked objects#. Unlike Epochs , which by definition contain multiple trials and in which each trial has an associated condition label (event...
Read more >Additional support for MFF · Issue #8038 · mne-tools/mne-python
We may need to create a new type of MFF events class to store this information, as it appears that event info is...
Read more >Event-related potential - Wikipedia
An event-related potential (ERP) is the measured brain response that is the direct result of ... Evoked potentials and induced potentials are subtypes...
Read more >Hosting Candidates at Charitable Events | Bolder Advocacy
hosting a candidate for this type of event, the organization should follow these ... Make every effort to ensure the event does not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
summarizing a conversation with @agramfort during office hours:
dict
, return alist
(because of how we dowrite_evokeds
)grouping
too)works for me. Sleeping over it I like
epochs.average(by_event_id=True | False)