Sign up Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
insularcortex

Junior Member
Registered:
Posts: 7
Reply with quote  #1 
Dear experts of monkeylogic,

I was trying to find the Eye-Pupil-size information in the .bhv2 data file. But in AnalogData.Eye there were only two rows (should be x and y?) and seems not to be the pupil data.
 
Meanwhile, I checked the time script function and only found  "eye_position" that can extract x and y info but not pupil data too.

Is there a way to extract pupil data from the monkeylogic?

For our lab set-up, we using eyelink 1000plus and connect to the monkeylogic computer via PCI-6221, AnalogInput (Eye X:Channel 0, Eye Y: Channel 1, and Eye Pupil Size: Channel 3).

Thanks a lot!



0
Jaewon

Administrator
Registered:
Posts: 730
Reply with quote  #2 
You need to assign AI channel 3 to General Input and read it from AnalogData.General.

During trials, you can access it like get_analog_data('general1',100);
0
insularcortex

Junior Member
Registered:
Posts: 7
Reply with quote  #3 
Thanks lot! It‘s very clear and I will have it tested.
0
insularcortex

Junior Member
Registered:
Posts: 7
Reply with quote  #4 
Hi, Jaewon,

Thanks a lot for your help. I was able to set-up and find the pupil-size data via AnalogData.General and get_analog_data.

However, the get_analog_data  seems not to be a real-time adopter like eyejoytrack.

I want to use the pupil-size (but not the eye position) to control the punishment and rewards. For example, I gave a visual stimulus, if the animal's pupil-size was smaller than a certain threshold during the stimulus, I would give air-puff punishment; if the animal pupil-size is larger and maintain a certain period of time, I would give reword.

This is similar to use eye-position by the eyejoytrack adopter. The difference here is that the pupil-size data was used for the purpose.

Is there a way or adopter that I can get the real-time pupil-size information to control the experiment?

Thanks a lot!   
0
Jaewon

Administrator
Registered:
Posts: 730
Reply with quote  #5 
get_analog_data does get you data acquired on real time. Then it is you that decide what to do with the data.

eyejoytrack of NIMH ML have an option to use a function as a tracking source, so you can define a custom function that checks the pupil size and use it with eyejoytrack. For example, the following code tests if the voltage level of General #1 is below 5.

----- Beginning of timing script -----
ontarget = eyejoytrack('acquirefunc',@pupillessthan,5,5000);
idle(2000);

function tf = pupillessthan(threshold)
    val = get_analog_data('gen1');
    if val < threshold, tf = true; else tf = false; end
end
----- End of timing script -----
0
insularcortex

Junior Member
Registered:
Posts: 7
Reply with quote  #6 
Thanks a lot!

This is very helpful and the example is very clear!

I will test it.
0
insularcortex

Junior Member
Registered:
Posts: 7
Reply with quote  #7 
Hi, Jaewon,

I was trying to ran the code.

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


but it will give me error:

Undefined function or variable 'get_analog_data'.

Error in ComputePupil (line 2)
pupil = get_analog_data('gen1');

Error in marmoset_movie_v1_runtime/eyejoytrack (line 640)
ml_bhvanalyzer{ml_,7}=ml_bhvanalyzer{ml_,2}(ml_bhvanalyzer{ml_,3});

Error in marmoset_movie_v1_runtime (line 1440)
ontarget2=eyejoytrack('acquirefunc',@ComputePupil,-4,wait_for_fix);

Error in run_trial (line 112)
runtime(MLConfig,TrialRecord,TaskObject,TrialData);

Error in monkeylogic/UIcallback (line 1145)
result = run_trial(MLConfig,datafile);

Error while evaluating UIControl Callback.


It seems that the monkeylogic did found the function of get_analog_data. I was using the lastest version of monkey (Aug10).





0
Jaewon

Administrator
Registered:
Posts: 730
Reply with quote  #8 
Did you put the ComputePupil function in a separate file? It should be in the timing script at the bottom.
0
insularcortex

Junior Member
Registered:
Posts: 7
Reply with quote  #9 
I see. I will add it into the script file and try again.


0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.