Welcome! Log In Create A New Profile

Advanced

How to get pupil size signal via TCP/IP Arrington eye tracker

Posted by insularcortex 
How to get pupil size signal via TCP/IP Arrington eye tracker
April 28, 2021 03:38AM
Dear experts,

I have connected the monkeylogic with Arrington eye tracker by TCP/IP and set up the output of the eyetracker.

Although the pupil size signal data will be saved in the bhv file (Eyeextra)

However, during the experiment, I can only get the eye position signal in real time but cannot get the pupil size signal data (or other Eye-extra data I set-up).

In the get_analog_data(sig_name), there are also no such an option to get the Eyeextra data.

Is there a way to get the pupil size signal in real-time as we need the signal to determine the goodmonkey.

Thanks!
Re: How to get pupil size signal via TCP/IP Arrington eye tracker
April 28, 2021 11:55AM
Download the packages again. I added the 'eyeextra' option to get_analog_data(). Please let me know if it does not work.
https://monkeylogic.nimh.nih.gov/docs_RuntimeFunctions.html#get_analog_data
Re: How to get pupil size signal via TCP/IP Arrington eye tracker
May 07, 2021 10:51AM
Hi, Jaewon,

Thank you for your help!

We are able to obtain the pupil size information using your functions.

I have another issue regarding using the program to train the monkey, which was caused by eye-closing.

We want to detect whether the monkey is looking at a fixation point/a pictures.

Here is our problem:

Once the marmoset closes the eye, the eye-tracking will lose the eye signal, and the voltage value (recorded eye position) will be sent as the last voltage value before eye-closing. (Arrington eye tracker using TCP/IP)

If the last value (recorded eye position) is by-accident right on the fixation position, even if the eye close, the monkeylogic will treat that the monkey is fixating correctly. (because the monkey logic will receive the static voltage value on the fixation point)

Thus, we added another judgment to detect whether the eye is open or not, by using pupil size information.

However, different from eyejoytrack ('holdfix',...), the eyejoytrack ('acquirefunc',...) can only detect the eye position at one moment rather than the whole fixation period.


Is there any other method to avoid the problem caused by eye-closing?

Thank you!

Here is our code:


ontarget1 = eyejoytrack('holdfix', fixation_point, fix_radius, hold_time_fix);
ontarget2 = eyejoytrack('acquirefunc', @ComputePupil,0.1,hold_time_fix);
if ontarget1 == false && ontarget2 == false
	toggleobject(fixation_point,'status','off', 'eventmarker',2001);%turn off
	trialerror(3);% broke fixation.
    return
end
toggleobject(fixation_point,'status','off', 'eventmarker',2001);%turn off
goodmonkey(500, 'juiceline',1, 'numreward',1, 'pausetime',500, 'eventmarker',665);


% % calculate the pupil size
function y = ComputePupil(input_args)
pupil = get_analog_data('eyeextra');
if  pupil>input_args
    y = true;%Open the eye
else
    y = false;%Close the eye
end
end



Re: How to get pupil size signal via TCP/IP Arrington eye tracker
May 07, 2021 03:05PM
Use both 'holdfix' and 'acquirefunc' in one eyejoytrack(). See the manual for details.
https://monkeylogic.nimh.nih.gov/docs_RuntimeFunctions.html#eyejoytrack
Re: How to get pupil size signal via TCP/IP Arrington eye tracker
May 07, 2021 10:16PM
Hi, Jaewon

I was trying to put the two in the same command line, but it give the following error:



ontarget1 = eyejoytrack('holdfix', fixation_point, fix_radius, hold_time_fix,'acquirefunc', @ComputePupil,0.05,hold_time_fix);

if ontarget1 ~= [1 1]
	toggleobject(fixation_point,'status','off', 'eventmarker',2001);%turn off
	trialerror(3);% broke fixation.
    return
end
toggleobject(fixation_point,'status','off', 'eventmarker',2001);%turn off
goodmonkey(500, 'juiceline',1, 'numreward',1, 'pausetime',500, 'eventmarker',665); %% 500ms how much reward?


% % calculate the pupil size
function y = ComputePupil(input_args)
pupil = get_analog_data('eyeextra');

if  pupil>input_args
    y = true;%Open the eye
else
    y = false;%Close the eye
end
end




Quote

要执行 RESHAPE,请勿更改元素数目。 (marmoset_movie_task_v1_runtime/eyejoytrack, Line 446)
错误使用 reshape
要执行 RESHAPE,请勿更改元素数目。

出错 marmoset_movie_task_v1_runtime/eyejoytrack (line 446)
ml_bhvanalyzer(:,1:3)=reshape(varargin(1:end-1),3,ml_nbhvanalyzer)';

出错 marmoset_movie_task_v1_runtime (line 1855)
ontarget1=eyejoytrack('holdfix', fixation_point, fix_radius, hold_time_fix, 'acquirefunc',@ComputePupil,0.05,hold_time_fix);

出错 run_trial (line 129)
runtime(MLConfig,TrialRecord,TaskObject,TrialData);

出错 monkeylogic/UIcallback (line 866)
result = run_trial(MLConfig,datafile);

计算 UIControl Callback 时出错。


Sorry that my matlab was in Chinese. I can install an English version later if you could not get the meaning of the error.
Re: How to get pupil size signal via TCP/IP Arrington eye tracker
May 07, 2021 11:19PM
Remove the 4th argument, hold_time_fix.
Re: How to get pupil size signal via TCP/IP Arrington eye tracker
May 08, 2021 02:36AM
Great!Thank you!
Re: How to get pupil size signal via TCP/IP Arrington eye tracker
August 10, 2022 03:11AM
Hi,Jaewon,

Sorry that I come back to this old post.

The 'eyeextra' option to get_analog_data() works great for our application.

But now, I met with a special problem. We were doing a monkey visual task in the MRI.

However, the computer for the MRI-monkeylogic is the Win7 and only the monkeylogic 2.0 can run on that computer.

Because the MRI belongs to a platform that we don't have the authority to update the computer to Win10. Thus, we had to use monkeylogic 2.0 for our study.

I tried to add the 'eyeextra' option get_analog_data() of the monkeylogic.m file, as what shown in the monkeylogic 2.2, but it was not working.

Is there any way that we can got eyeextra option in monkeylogic 2.0?

Thank you very much!

Cirong
Re: How to get pupil size signal via TCP/IP Arrington eye tracker
August 10, 2022 10:32AM
See if the v2.0 installed on the MRI computer has been updated since May 2021. v2.0 is the same as v2.2, except a few things listed in the following link.
https://monkeylogic.nimh.nih.gov/board/read.php?1,411,411#msg-411

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.