-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support reading arbitrary _event.tsv columns #848
Comments
Hello @behinger, I'm not entirely sure about the intended use case here. Are you saying you'd like to have a way to essentially retrieve everything stored in Metadata in MNE is only available for WDYT? |
I intend to use the data with the rERP approach with deconvolution, where it is very common to have several different events, each with multiple predictors, importantly on the continuous EEG. For simple 2*2 designs, annotations might be enough, but for regressions etc it seems quite unwieldy, so I agree. Your solution seems good to me, and indeed I want to have everything of the events.tsv But maybe there is a larger issue, that if you would read and write data using mne-bids, all these eventscolumns would be missing (without intervention) because mne cannot represent all bids information. |
What do you suggest?
I would read the events.tsv file with pandas and do my rERP from this.
You don’t need mne.Epochs so metadata is not relevant.
|
I don't know because I don't know enough about mne.Annotations - if it is a fundamental limit of MNE-annotations to not support any other columns, maybe there is nothing to be done here. And certainly, I don't want to open the can-of-worms of events/annotations/metadata in this issue. Is mne.Annotations extensible to other fields? That would be a natural solution. Many "raw" (straight from recorder) BIDS datasets have only Trigger-Codes, so for those, the current situation is fine. But I have seen BIDS datasets that make use of the custom event fields to identify "normal" conditions for epoching as well. It is therefore not only a problem for rERP, but for any dataset that uses optional BIDS fields and where users want to epoch according to these fields. |
MNE Annotations are essentially a bunch of lists containing onset, duration, and label or description of all annotated segments. Theoretically, you / we could generate annotations for all columns in an events.tsv file. We now also have |
I would need to get access to a dataset that has this to feel the problem.
You can always read in the events with pandas.read_csv
and then pass this to Epochs metadata on construction. It's a few more
lines but I don't see a blocker here.
… |
As an easy-accessible example: This one has ReactionTimes & Stimulus-ID as "extra" columns. As I said before, I, personally, know how to get around this problem. Making the case one last time:
|
Thanks for linking to the example dataset! I will take a look at this. 🤔 |
@behinger I'm a little busy these days, please feel free to ping me sometime later this week should you not see any activity here :) |
ping :) |
could we have a function |
Describe the problem
When loading a BIDS dataset, currently the columns
onset
duration
,key
andvalue
are extracted from_events.tsv
files and saved to raw.annotation.Key + value are combined to
key/value
if I understand correctly.Other columns are ignored. But those other columns are explicitly allowed in the BIDS specification:
Describe your solution
The solution would be to load/save all columns as a Pandas DataFrame (similar afaik to MNE metadata) instead of
raw.Annotation
. I do not know ifraw.Annotation
allows for other arbitrary columns - but I remember that it is somewhat an ongoing discussion between events/annotation/metadata. This is what I am currently doing, using load/overwriting the BIDS events file manually.My use-case is EEG/Eye-Tracking data, which typically has tens of additional columns (e.g. for saccade-events: saccade amplitude, orientation, velocity, size etc.).
This also applies to writing events.tsv, but I haven't looked into it again for this issue.
The text was updated successfully, but these errors were encountered: