Welcome! Log In Create A New Profile

Advanced

Trial time at which ImageChanger presented images

Posted by Mitch 
Trial time at which ImageChanger presented images
October 15, 2019 05:38PM
Is there a way for me to access the trial time at which ImageChanger presented each of its images in ImageList? Basically like running trialtime each time ImageChanger moves onto a new row in ImageList.
Re: Trial time at which ImageChanger presented images
October 15, 2019 06:52PM
You can set eventmarkers in each row of the image list.
https://monkeylogic.nimh.nih.gov/docs_RuntimeFunctions.html#ImageChanger
Re: Trial time at which ImageChanger presented images
October 16, 2019 02:05PM
Is this accessible during the trial? I can't seem to find where the eventmarker times are stored for the current trial.
Re: Trial time at which ImageChanger presented images
October 16, 2019 03:57PM
Can you explain the details more? What is the purpose of getting the time during the trial? Eventmarker times usually become available after a trial via the TrialRecord structure.
Re: Trial time at which ImageChanger presented images
October 29, 2019 04:03PM
It was great to meet you at SfN. As we spoke about at the conference, my task involves making a saccade to the correct image after it has been presented. I need to deliver the reward only if the saccade was initiated 100-400ms after the image appeared on the screen so I know the reaction time was long enough to be in response to the image rather than a timed guess. As we spoke about, the eye trace can be used to determine when the saccade started, but I’m not sure how to modify the ImageChanger adapter so that I have access to the time of image presentation. I’ve made a simplified version of the task that has all of these characteristics and attached it to this post. It includes a minimally modified version of ImageChanger that moves CurrentImageNum from protected to set access protected.
Attachments:
open | download - ImageReactionTime.zip (59.4 KB)
Re: Trial time at which ImageChanger presented images
October 29, 2019 05:45PM
Thank, Mitch. Please give me some time to take a look at the files.
Re: Trial time at which ImageChanger presented images
November 01, 2019 11:48AM
I added a property (OnsetTime) to ImageChanger so that you can tell when the "correct" image was presented. The OnsetTime (an n-by-1 vector) is NaN for the images not presented during the scene.

I think the easiest way to retrieve the eye trace is to use get_analog_data().
correct_image = 10;
onset = img.OnsetTime(correct_image);

if isnan(onset)
    % The correct image was not presented
else
    warning off;  % to suppress occasional 'insufficient sample' warnings
    eye = get_analog_data('eye',round(trialtime));  % in degrees
    warning on;
    eye_after_correct_image = eye(round(onset):end,:);

    % do something with eye_after_correct_image
end
Attachments:
open | download - ImageChanger.m (5.4 KB)

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.