Hdf5 data is not storing all samples from Eyetracking (PupilCore) capture device

Hi all!

I’m using PsychoPy 2022.2.4 on Win10 OS.
And integrating it with PupilLabs Core eye-tracking.

Pupillometry only and save hdf5 file boxes are checked.

At the end of my test experiment, the hdf5 exported data only shows a few of several samples captured by Eyetracking device.
Sometimes it doesn’t show any event at all.

Attached is a screenshot illustrating the issue: only two pupil events from MonocularEyeSampleEvent (left) was captured, and it’s possible to see in the MessageEvent (right) that I set the recording ON at time 23.52 and set it OFF at 33.54.
In the pupil_positions.csv data exported by PupilCore there were 1177 samples recorded.

Any help? Thanks in advance, really appreciate it!

Hi @dbertuzzi,

Could you send your test experiment. A minimal (non) working example would be ideal. :slight_smile: That way I can test it here. You can also PM it to me if you do not want to post it.

Thank you

Hi @sol , thanks for your reply!
Attached is the experiment folder, it’s a simple routine just so I get an idea of how the integration works.
eyetrack_test.zip (597.1 KB)

Thanks!

I can reproduce the type of issue you are having. Samples only seem to be occationally written to the hdf5 file, but I’m not sure why that is. Testing your same example using MouseGaze and it works as expected, so the issue is not the code generated by Bbuilder. Could you contact Pupil Labs and see if they have any suggestions? Thank you

Hi @sol ,
I finally found out why this is happening this weekend. The issue is related to the confidence threshold.

I had to delete this line of code (psychopy/eyetracker.py at dev · psychopy/psychopy · GitHub) from psychopy/iohub/devices/eyetracker/hw/pupil_labs/pupil_core/eyetracker.py file to solve the issue.

From my understanding the samples were being sent sent only if the confidence threshold was < than confidence_threshold set in Psychopy. And it should be the opposite, i.e, the samples should be sent when confidence is greater than the confidence threshold set in Psychopy.
The occasionally samples being stored had a low confidence, i.e., they were blinks or it was when the algorithm failed to detect the pupil.

Thanks a lot for your time! Really appreciate it!