-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add possibility to read events from a file #8
Comments
Hello, Does that mean that it is not possible at the moment to read event info from a STIM channel in a file? I am using .bdf files that include a STIM channel called "Status" with all event info. However, the "Event info" section of the "Preprocessing" part of Meggie remains empty. Then I am not sure how I could proceed towards epochs. Best regards, |
Hello, Normally mne is able to gather the event information from the raw files automatically, with different loaders trying their best to understand the different formats. |
Sorry, misclicked the close button.. So this issue is really meant for a different scenario where the raw data really does not contain the events and the events have to be loaded in a different way. For your case, we have to figure out why the events do not appear. If you plot the data with raw plot, can you there see the stimulus channel? Just to make sure, the events have not become annotations (that is there is no big colored rectangles overlayed on the plot)? It might be that we need to allow you to specify the name of the stimulus channel if it does not work otherwise. It shouldn't take more than a day to have a new release with that. Hope we can find a solution! |
Hello, I see, it is a different scenario indeed. I do see the "Status" channel on the raw plot, as seen on the picture below. It does look like proper triggers there. I thought it may be a matter of Meggie not finding which channel has the event info indeed. Let me know if there is anything else I could try. Best regards, |
I forgot to mention, I do not know what the "STI101" channel is. When opening the same file on mne, it says I only have one STIM channel, which is "Status". And STI101 seems perfectly flat all the way through. |
With the meggie conda environment activated, can you start python shell:
And then run following commands:
And then paste all the output here.. It might be that it's trying to synthetize the Status channel to STI101, but is failing for some reason.. or it might be that the api is designed so that we need to specify the "Status" channel and the STI101 is there for some other reason.. |
There is some legacy code in meggie that is heuristically specifying STI014 or STI101 as the source of events if it's found. It might be that nowadays mne handles things so well that I should not specify anything and we would get a better result. If both of those, mne.find_events(raw) and mne.find_events(raw, stim_channel="Status") seem to return all the events, I think I'm gonna patch meggie to just use mne.find_events(raw). At some point have to add it as a option that the user can specify. I'll test a few cases myself to see if it works. |
Sure, here is the result:
|
Ok, it seems to do fine. I'll fix meggie quickly and let you know when to update. In the anomaly that mne would not work fine with a different dataset, one can (in the future) still set the environment variable MNE_STIM_CHANNEL. Thanks! |
v1.5.1 with a fix should now be in conda. Can you try to update? EDIT: It seems it's not immediately available as it has to run tests. -- Erkka |
I just tried it and it works perfectly now. Thank you very much for your quick and efficient answer. Best, |
Should make it possible to read events from a file. Can either implement on epochs and spectrum creation, or globally for subject.
The text was updated successfully, but these errors were encountered: