-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[MRG] Don't look for an offset in an eyelink message if the message contains only 2 elements #12003
Conversation
Thanks @mscheltienne, it makes me feel better that someone else is using this!
This makes sense to me!
Awh ok, at least at our lab, the string messages sent to the host PC are usually event messages like:
So in my lab's case, we have
The
the offset in the message string can be positive or negative and int-like or float-like.
From a first look it makes sense to me but I'll give it a closer look and test it out ASAP! |
Numericals are handy because you can send the same message as the trigger value delivered to the MEG or EEG device, without a need for mapping strings to numericals. But anyway, thank you @scott-huberty for the explanation!
Can you detail a bit this part? How do you know you are sending the trigger too "late" and how do you estimate the negative offset that accompanies the message?
Does this mean you use a command similar to:
I now notice this offset argument in the |
Makes sense to me!
So my understanding based off my discussions with SR staff, is that if an event like my
I have to admit that we didn't go the open-source way for our experiment design, we just use Eyelink's proprietary Experiment Builder software : ( My guess is that this |
Note: this post is one message late! Not taking yet into account your last reply. If I read your message and
But you do have an
Now, if
It's not perfect, because it fails to triage:
which is now interpreted as an offset of 2; but I don't see how to handle that edge case correctly. |
OK, so in your case, using the Experiment Builder Software, it's able to estimate this delay between an image flip (at which a stimulus is in theory presented and at which the trigger should be marked) and the time at which you requested the trigger. With their python binding, the function is:
It's not pretty, but I stay on my proposition of the last post, use |
exactly, that's my understanding!
I think I am following you here, and agree yes, if
Sure, +1 from me. Sorry maybe I was going way overkill with trying to parse out and apply offsets to begin with (I think Eric tried to improve my YAGNI radar during my GSOC!). I guess I could have just treated everything after the MSG timestamp as a string message that should be passed to the
|
Let's go with that, honestly I think handling the offset is very important, if you have them. Thanks for the back and forth! |
Let's see if that passes your test for now, then I'll check if I can modify one of your test or add something else when able. |
To fix the failing mne-python/mne/io/eyelink/eyelink.py Lines 22 to 30 in 9de0ef6
|
If we change the default If we keep the default I prefer the later, I don't think we should change the default, and I would consider this PR to be a bugfix. |
Oh yes you are right, and agreed. |
@scott-huberty can you review and approve if you're happy? Then I'll take a cursory look and merge |
LGTM. Thanks @mscheltienne ! |
Thanks both! I had this exact problem (https://mne.discourse.group/t/reading-eyelink-data-edf-empty-annotations/7771?u=sappelhoff), and somehow missed this PR before asking my question. This solves it. And this behavior is also what colleagues at my institute get with a Matlab reader they are using (not sure which one it is) 🙏 |
…ontains only 2 elements (mne-tools#12003)
On our site, we tend to send triggers as messages to the eye-link host PC. I have no idea if this is good practice to mark events, but it works 😄 In the ASCII file, you now have lines such as:
Where
20
is thestr
trigger, in this case, a numerical value.So now, when I parse this file with MNE, I'm getting annotations with an empty name because
20
is interpreted as the offset heremne-python/mne/io/eyelink/_utils.py
Lines 280 to 294 in d2883d5
In
raw_extras["event_lines"]["MSG"]
, I have:What is this offset token suppose to be and what is the use-case behind this
tokens[1].lstrip("-").replace(".", "", 1).isnumeric()
line? @scott-huberty Could you review this change/rationale behind the offset?