-
Notifications
You must be signed in to change notification settings - Fork 69
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
Preventing losing/altering events when downsampling #1028
Comments
Hi!
I don't really understand what you're saying here, could you please provide an example? Doesn't need to be an MWE, just some illustration of what happens vs what you would expect. This will also help us triage whether this is a Pipeline or an MNE-Python problem. Are you trying to "eject" your data from the Pipeline? Or where does your issue occur? Thank you! |
Sure! I use various trigger codes that do not appear in order, e.g. a list of events extrated from I am trying to use MNE to preprocess my data, without epoching. I.e. running ICA, downsampling, filtering etc, and then having the |
Ah okay, so you're basically running all pre-processing steps to get the "clean" raw data, and that's when you stop using the pipeline and want to proceed working with the data in your own manual code / pipeline, did I get this right? 🙂 |
exactly! our final analysis is a bit more intricate than what |
Thanks! Could you share what the annotations on that clean file look like? |
sure! annotation.zip I think this is intended behaviour in MNE, as far as I can tell, the original trigger values are not saved when running |
You can pass the event_id to control which IDs will be used :) |
I have the following problem
Our trigger channel sometimes doesn't switch on all bits simultaneously, producing events in the STI101 channel (1000 Hz) like
0, 0, 0, 4, 5, 5, 5, 5, 5, 0, 0, 0
when I downsample these data using
mne-bids-pipeline
to 100 Hz, the resulting trigger channel values are downsampled to0, 4, 0
, such that the event is interpreted as a 4 instead of a 5.Usually I would avoid this by extracting events beforehand with appropriate
min_duration
andshortest_event
and resampling jointly (raw, events = raw.resample(100, events=events)
). However, when using mne-bids-pipeline I don't have this option. The events are correctly inserted as annotations into the resampled pipeline data. However, converting back from annotations to events viamne.events_from_annotations(raw)
will scramble the trigger code values, unless manually specified.Is there any way to avoid this without relying on the
_events.json
sidecar (in which the correct event information is saved)?The text was updated successfully, but these errors were encountered: