Welcome! Log In Create A New Profile

Advanced

Eye data (eyelink) sampling issue

Posted by curiousgeorge 
Eye data (eyelink) sampling issue
October 18, 2021 09:06AM
Hi Jaewon,

I'm having issues with the sampling rate of eye data in Monkeylogic (2.2.19 Oct 12 2021) on Windows 10 2004 running Matlab 2017b.

Eyelink is connected via TCP/IP connection to Monkeylogic. I followed the instructions in the docs, connection test passes and I have disabled Nagel's algorithm as well.

The issue is that after the first trial, the sampling rate drops to ~16ms or lower. I have attached a figure to illustrate this. This is mouse simulated data (from eyelink) and each subplot is a trial. This figure is produced by applying the following code to the eye data to look at when there is a change to the x dimension, and how many samples/ms are changes separated by.


diff(find(diff(session(trial).AnalogData.Eye(:,1)) ~= 0))

As the figure illustrators, it's consistently ~16ms (60hz sampling) or more after the first trial. You can see this in the y dimension of eye data as well as eye data in the behaving animal. I had this issue with the pre-Oct 12th Monkeylogic version and figured the update was a fix for this, but it has not solved this issue.

I have tried the following fixes myself:
- Change of ethernet cable (cat6)
- Connecting to a different ethernet port on monkeylogic computer (not eyelink however).
- Connecting ethernet cable directory from eyelink to monkeylogic computer as opposed to going through an ethernet splitter that's part of the setup.
- Enabling and re-disabling Nagel's algorithm
- Testing with eyelink sampling at 500hz and 1000hz


Any help would be very appreciated
Thank you
Attachments:
open | download - MlogicForumData.jpg (65.2 KB)
Re: Eye data (eyelink) sampling issue
October 18, 2021 10:58AM
I do not have an EyeLink system to test with at the moment, but you cannot do this with mouse-simulated data. Mouse does not change its position that frequently and you do not know how often the EyeLink reads the mouse position to generated the simulated data, do you?
Re: Eye data (eyelink) sampling issue
October 18, 2021 12:56PM
Hi Jaewon,

That's a great question. I do not know what the sampling rate for mouse simulation is (emailed Eyelink to find out). But the issue persists with behavioural data collected from a macaque.

I'm attaching here animalEyeData_allTrials eye data from all trials in a short block where the animal makes 10d saccades to left and and right from (from 0,0). The different color bars are different trials. As you can see the change in eye position is clustered around 16ms. I noticed this when I plotted the data.AnalogData.Eye in a scatter plot for this task and saw that there were no eye traces between the fixation point and targets. I've also attached animalEyeData_SampleTrials which are some select trials in that session if you'd like to have a closer look. The scatter plot is the eye trace plotted on part of the screen, and the line plot is the x-eye plotted.

I've also tried mouse simulation on another setup in the lab, and applying the same analysis (# of ms/sample between changing samples) seems to show the expected behaviour (sampling around the 1ms). I'm attaching that image here as well mouseSimulatedData_Setup2. The axes are the same here as the previous plots.
The only thing I can note that differs between these two setups (aside from hardware details of eyelink pc and monkeylogic pc) is that the "working" pc is running matlab 2021. Same eyelink system as well as same settings.
Attachments:
open | download - animalEyeData_allTrials.jpg (41.4 KB)
open | download - animalEyeData_SampleTrials.jpg (84.2 KB)
open | download - mouseSimulatedData_Setup2.jpg (40.3 KB)
Re: Eye data (eyelink) sampling issue
October 19, 2021 11:57AM
Since you have two EyeLink systems, I would try swapping the eye tracker computers and see if the problem persists. It should be relatively easy since you can just change IP addresses or LAN cables.

The registry keys to disable Nagle's algorithm are case-sensitive. Please check if there was any typo.
Re: Eye data (eyelink) sampling issue
October 19, 2021 02:36PM
Hi Jaewon,

I've traced the source of the problem. In the MonkeyLogic (ML) GUI, under the Task subsection, if the ITI record signals is checked off, the sampling of eye signal drops after the first ITI and stabilizes at 60Hz after the 2nd ITI. The source of this issue being the ITI also makes sense considering my data shows a reasonable sampling on the first trial (before which there is no ITI).

Turning this ITI record signals box off fixes the issue (no longer bottlenecks the sampling rate) and now the sampling rate of the eye signal depends on the eye tracking source (in this case Eyelink at 1khz) with ML sampling at the expected 1khz. This was corroborated by another lab having the same issue and I have tried this on another of our set ups as well.

Interestingly, if the Mouse/Key box is checked off under Other device settings, the sampling rate is not effect by the ITI record signals box being checked off. I have not tried if this is true for any digital input signal, but it is true for the mouse. My guess is that turning on another digital input signal overrides this bottleneck, however you'd know better.

My question is how could we record the ITI eye signal without encountering this sampling issue?

Thanks for your time
Re: Eye data (eyelink) sampling issue
October 20, 2021 11:22AM
Thanks for the information, but there is something that does not add up. If you want to help me with this investigation, would you run the attached task in each condition (tuning on or off the ITI recording while using EyeLink) and send me the data files? The task does not do anything but spending 3 sec in each trial. Since you said the problem occurs from the second trial, just a few trials' recording will be enough. And please let me know the Windows version of the testing system as well.
Attachments:
open | download - test.txt (140 bytes)
open | download - test.m (106 bytes)
Re: Eye data (eyelink) sampling issue
October 21, 2021 09:07AM
Hi Jaewon,

Thank you for following up. I'm attaching two files here, one with ITI recording off and another with ITI recording on. The only addition to the config file was connecting the eyelink. Zipped them in order to attach them as files here.

This is performed on Windows 10 Home version 2004

let me know if I can help in any other way, thanks.
Attachments:
open | download - 211021_mouseSimulation_ITIoff_test.zip (60.1 KB)
open | download - 211021_mouseSimulation_ITIon_test.zip (38.3 KB)
Re: Eye data (eyelink) sampling issue
October 21, 2021 12:52PM
This is very helpful! Thanks!

I just need one more test. This time I need you to turn off the ITI recording and remove EyeLink from the TCP/IP eye tracker menu. Would you run it and send me the datafile?
Re: Eye data (eyelink) sampling issue
October 21, 2021 03:02PM
Not a problem. Files are attached here. ITI recording is off and TCP/IP eye menu is left on None so no eye signal was recorded. Config file is attached. Hope it helps!
Attachments:
open | download - 211021_mouseSimulation_ITIoff_TCPIPoff_test.zip (10.4 KB)
Re: Eye data (eyelink) sampling issue
October 21, 2021 04:02PM
Thanks a lot. You do not need to send the cfg file, since the information is also stored in the data file.

The issue occurs when you turn off the ITI recording, not when you turn it on. The data files you sent show that EyeLink sometimes take an extra long time to check out a new sample. EyeLink has a function to check if a new sample has arrived. My guess is that EyeLink may not discard unread samples (during ITI) and process them only when the function is called. I am not 100% sure about it, since I cannot look into their SDK functions, but, if my guess is right, it will mitigate the problem to make NIMH ML continuously read out samples during ITI even when the ITI recording option is turned off.

I will build a test version and contact you by email.
Re: Eye data (eyelink) sampling issue
October 21, 2021 05:53PM
Thank you for the update.

I'm not sure I understand why you mention the issue is when I turn the ITI recording off. The difference in the sampling shifts to 16ms when the record signals box is checked, recording the eye signal during the ITI. Is there something I'm missing?

Looking forward to your email.
Re: Eye data (eyelink) sampling issue
October 27, 2021 07:57AM
I think the issue is resolved in the new release. Please update your NIMH ML.
Re: Eye data (eyelink) sampling issue
October 27, 2021 11:44AM
Hi Jaewon,

The issue is resolved with the new update! Only problem I have is upon clicking QUIT on the menu after pausing the task, both monkeylogic and matlab quit, and it has to be restarted.

Please let me know if this is a local issue. Thanks for all your help.

The National Institute of Mental Health (NIMH) is part of the National Institutes of Health (NIH), a component of the U.S. Department of Health and Human Services.