I was wondering if anyone has experience with using Pupil in experiments ran on matlab, specifically Psychtoolbox.
I want to use Pupil for subject eye-tracking during my experiments, but could not find a good way so far to link the two. Is there one? At least a way to place markers on Pupil timeline when matlab stimuli is presented or something like that?
So far the timestamps given by both are quite different, and aligning them one to the other is not straightforward.
Thank you very much,
Amir
--
You received this message because you are subscribed to the Google Groups "pupil-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pupil-discus...@googlegroups.com.
To post to this group, send email to pupil-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pupil-discuss/ff193c23-b23d-4036-aac3-1203e296a4e9%40googlegroups.com.
Was going through internet forums to figure out the same thing - interface matlab with pupil labs to get raw eye coordinates. Were you ever able to achieve this, could you share some info regarding this.
Thanks
Vaibhav
Joining events from my lab's cognitive battery has been a major headache with other eye tracking systems that I have used in the past. In Pupil, my thought was to join a Surface marker with each stimulus, then Pupil can get a timestamp from the surface and I can concatenate the Eye camera data with each event. Right now, the the timestamp and frames exported in the surface_events file does not line up perfectly with the timestanmps and frames available in the pupil_positions file.
Any advice?
Regards,
Brock Carlson
Sorry for the delay in replying.
I didn't succeed in implementing any of the more sophisticated and correct solutions offered to me here and elsewhere. What I eventually did was simply record with matlab the point in time in which the 'R' button was hit - beginning recording on Pupil, and used that to align the data from the two parallel running programs.
This is far from ideal but turned out to be at least precise enough for my needs.
I am having the same problem as you had back then. I think about implementing the KbWait function into the beginning of my psychtoolbox code (I know about the random delay between 0-5ms) but I don't know how to specify this function to pushing the R button. How did you solve this issue?
Best regards,
Rob
Hi Rob,
This is the bit of code I used:
done = 0;
while ~done
[keyIsDown, secs, keyCode, ~] = KbCheck();
if keyIsDown & find(keyCode)==KbName('r')
done = 1;
end
end
Hope it helps,
Amir
Hi Matiar
Our lab recently purchased a Pupil Mobile headset and I'm trying to get it to integrate with MATLAB and the Psychtoolbox. I'm running MATLAB 2017b on a mac with OS X SIerra. I downloaded your code from github and I think I'm close to getting it to work. However, I'm having some issues and have some questions...I hope you can help me?
First, is it possible to run everything on one machine (i.e. Pupil Capture, python server, matlab), or is this code designed to be run on two machines (one for Pupil capture and one for matlab)?
Second, if this is possible, what should the socket addresses be set to? I've tried setting the addresses/ports on lines 21,28,30 of pythonPupil.py to the local address displayed in the Pupil Capture software menu, but I get the error below.
If you have any suggestions I'd really appreciate it!
Thanks
Tom Bullock
Postdoc, UCSB Attention Lab
-------------------------------------------------------
>> matlabPython3
Timesync successful.
timeout... 1
timeout... 2
.........................................HARD TIMEOUT.........................................
timeout... 1
timeout... 2
Traceback (most recent call last):
File "/~/Pupil_Labs/pythonPupil.py", line 107, in <module>
my_socket.send(uMsg)
ConnectionRefusedError: [Errno 61] Connection refused
ans =
1
Warning: Unsuccessful read: The specified amount of data was not returned within the Timeout
period.
Reference to non-existent field 'isConnected'.
Error in pupilRead (line 12)
if ~eyeProperties.isConnected,return;end
Error in PupilNetwork2 (line 19)
[pupil_vals] = pupilRead(hUDP, eyeProperties);
Error in matlabPython3 (line 13)
PupilNetwork2