Welcome! Log In Create A New Profile

Advanced

eye movements control

Posted by annaipata 
eye movements control
October 29, 2023 05:32PM
Hello,

I'm encountering some difficulties integrating eye movements control into my timing script for a specific task involving monkeys holding two bars and releasing one based on stimulus presentation.

The sequence starts with acquiring fixation on a fixation point, followed by the appearance of a sample stimulus at the screen's center. The monkey needs to maintain fixation and keep both bars pressed for 800 milliseconds. After this, the sample is replaced by a target (from row 66 to row 97), and the monkeys must maintain their gaze on the target until releasing the bar.

Here's the challenge: When I include the control for eye movements (line 73), the task only displays the target but not the eye window. I'm currently working in a simulation mode.

I've experimented with different approaches, but none seem to work. It appears that I can either control the eye movements or the bars, but not both simultaneously.

Do you have any suggestions or insights to help resolve this issue?

thank you

Anna
Attachments:
open | download - Button2_eye.m (3.5 KB)
Re: eye movements control
October 30, 2023 11:43AM
I guess you did not understand my previous answer.
https://monkeylogic.nimh.nih.gov/board/read.php?3,1655

You are using toggleobject and eyejoytrack incorrectly. I revised the manual to make it more sense. Please see the last remark of each command.
https://monkeylogic.nimh.nih.gov/docs_RuntimeFunctions.html#eyejoytrack
https://monkeylogic.nimh.nih.gov/docs_RuntimeFunctions.html#toggleobject
ontarget  = eyejoytrack('holdtouch', 2, [], 50);
eyeontarget = eyejoytrack('holdfix', target, hold_radius, 50); % INCORRECT!!!

ontarget = eyejoytrack('holdtouch', 2, [], 'holdfix', target, hold_radius, 50); % CORRECT; ontarget is a 1-by-2 vector
toggleobject(fixation_point)
toggleobject(sample)
t_target =toggleobject(target,  'eventmarker',40); % INCORRECT!!!

t_target =toggleobject([fixation_point sample target],  'eventmarker',40); % CORRECT
Re: eye movements control
October 30, 2023 07:15PM
Thank you,
attached is my original file, the one I use to train the monkey, without the eye movement control. It would be very helpful if you can

here, in red are the sessions of the time scripts where I have to add the control of the eyes movements . I tried you suggestions but it did not work. (I am sure I made mistakes...)

I use the button type signal to control two bars. That means

chosen_target,~,t_acquired] = eyejoytrack('acquiretouch',[1 2],[],2000)

button 1 touched = does not touch the left bar;
button 2 touched = does not touch the right bar.
button 1 not touched : left bar pressed;
button 2 not touched : right bar pressed

ontarget = eyejoytrack('holdtouch', 1, [], 800);
button 1 touched = does not touch the left bar;
button 1 not touched : left bar pressed;
ontarget = eyejoytrack('holdtouch', 2, [], 800);
button 2 touched = does not touch the right bar;
button 2 not touched : right bar pressed;

I have to add to the script the eye movements:

During the fixation period:
monkeys grabs both bars and fixates fixation point.
button 1 not touched : left bar pressed;
button 2 not touched : right bar pressed
add: acquire fixation


hold both bars pressed for 800 ms:
button 1 not touched : left bar pressed;
button 2 not touched : right bar pressed
add: hold fixation

Target (this is a key point)
monkeys maintain the fixation until one of the two bars is releases.
chosen_target,~,t_acquired] = eyejoytrack('acquiretouch',[1 2],[],2000)

button 1 touched = has released left bar
or
button 2 touched = has released right bar

I would really appreciate if someone can help me with this issue.

thank you
Anna
Re: eye movements control
October 31, 2023 06:40PM
Your code for the target period makes no sense to me. I just used my imagination to figure out what you tried to do. See the attached script.
Attachments:
open | download - Button2_eye.m (3.3 KB)
Re: eye movements control
November 01, 2023 01:44PM
Thank you ,
that exactly what I needed
I try my best. but I am still a beginner, and I found the tutorial not very clear.

I'll improve!
best
Anna
Re: eye movements control
November 02, 2023 08:28PM
Hi,
the script you sent to me works.
However, since I use the bars, I have to change the polarity of the buttons.
I tried to change the ontarget output (that means, the bar release is ~ontarget), but it does not work/

I figured out how to do it with the scenes, and it seems that it works with "NotAdapter", (see the attached file).
I do not understand why when the wrong button is pressed, the target disappears immediately , but not when the correct button is pressed.

Your inputs are very helpful for me, and I really appreciate the time you spend to fix my (stupid) troubles.

Best
Anna
Attachments:
open | download - scene_test.m (2.5 KB)
open | download - Test_eyetracker.txt (140 bytes)
Re: eye movements control
November 03, 2023 11:14AM

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.