mne-tools / mne-python

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

epochs event_id as dict and support for multiple marker numbers #133

Closed agramfort closed 11 years ago

agramfort commented 12 years ago

I'd like to be able to write

epochs = mne.Epochs(raw, events, event_id=dict(auditory=1, visual=3), ...)
evoked_auditory = epochs.average('auditory')
evoked_visual = epochs.average('visual')
evoked = epochs.average()

and evoked_auditory.comment would then contain "Evoked auditory" and not unknown as it is now.

cc/ @Eric89GXL @mluessi @christianmbrodbeck @dengemann if you want to give it a try...

larsoner commented 11 years ago

Ahh, I see what you mean. I'll do that!

dengemann commented 11 years ago

Great! Let's think about how we do it in a way that is extendible, either via smart args / type checking (dict, list, pandas whatever, R formula), or a private function that does the remapping but with different public interfaces that handle the specification from different, e.g. your proposed merge_epochs_ids, that would take list + string, and then for example gen/make/create/set_espochs_design which would process formulas or whatever and so forth and whatever we will draw from #133 in the future. Makes sense?

larsoner commented 11 years ago

@dengemann, @agramfort, @christianmbrodbeck now that we've made some progress on this, my vote is to close this issue, and start a new, more clearly titled issue when someone formulates the next good potential extension (for 0.6, presumably).

dengemann commented 11 years ago

Good bye #133 and thanks for the fruitful as well as nice discussion we had. Let's continue this in subsequent issues and PRs.