Welcome! Log In Create A New Profile

Advanced

Image Presentation During Saccades

Posted by RN8JR 
Image Presentation During Saccades
August 05, 2019 07:26AM
I am trying to develop a task in which a stream of images are presented in the periphery while the subject makes a saccade from a fixation point to a cued location. Currently, I am doing this with two separate scenes (one for the initial fixation and one with a fixation window around a peripheral saccade target). I'm using concurrent to run imagechanger alongside both of these scenes.

Is there any way to do this in a single scene? The imagechanger description in the manual states that "When the scene ends, the adapter takes one additional frame and clears the screen itself," meaning that I am unable to present an image continuously at the time of transition between the scenes, which is something I would need to be able to do. Furthermore, because image presentation does not start immediately after fixation is acquired in scene one (it is delayed in my task by a few hundred ms via TriggerTimer), I am concerned that timing the alignment of the two image presentation sections is a little more complicated that necessary. The timing of these image presentations is extremely important for our application.
Re: Image Presentation During Saccades
August 05, 2019 12:59PM
It is not clear to me when the image presentation should start. Is it when the fixation to the fixation point is acquired? Initially I thought you wanted to start the images with the fixation point and keep showing them until a saccade is made to the cue, but your later description is a little confusing. It would help if you could show me your script too.
Re: Image Presentation During Saccades
August 05, 2019 04:51PM
I'd like to be able to delay the start of the images flashing. The general structure of a trial would therefore be:

fixation point on -> acquire fixation -> variable delay -> image presentation begins -> fixation point off/saccade target on -> make saccade to target -> image presentation continues for a little longer then stops -> saccade target off/deliver reward.

So there are two periods of fixation, one on an initial fixation point, and a second on a target after executing a saccade to that target. The image presentation begins during the initial fixation period (slightly after the acquisition of fixation) and ends during the second fixation period. I'd like to be able to vary both the timing of image sequence onset (relative to fixation acquisition) and fixation point offset/saccade target onset between trials to make them unpredictable to the subject.

I've attached an example timing script, which has been the closest I've been able to get to what I want. Any of the variables that are globalized are assigned/generated in the corresponding userloop script. As I mentioned in the initial post, I have concerns about the timing of this approach because it uses two separate ImageChanger adapters in two separate scenes to display what should be one sequence of images.
Re: Image Presentation During Saccades
August 06, 2019 07:01PM
The attached is an example task that I made based on your description. It requires the latest NIMH ML, so please update your ML first.

As you know, ImageChanger starts from the first image again, when it is used in a new scene. So the entire period in which serial image presentation is necessary should be one scene (colored in blue below). To monitor other temporal and behavioral requirements in order during image presentation, I added a new adapter, Sequential.
https://monkeylogic.nimh.nih.gov/docs_RuntimeFunctions.html#Sequential

fixation point on -> acquire fixation -> variable delay -> image presentation begins -> fixation point off/saccade target on -> make saccade to target -> image presentation continues for a little longer then stops -> saccade target off/deliver reward.

By the way, you can't use TaskObjects (with create_scene) for this purpose, since TaskObjects cannot be displayed just for a portion of a scene. Use adapter stimuli, as shown in the attached example.
Attachments:
open | download - RN8JR.zip (18.6 KB)
Re: Image Presentation During Saccades
August 07, 2019 05:02PM
This works great, thank you for the help Jaewon.
Re: Image Presentation During Saccades
September 27, 2019 12:01PM
I think that I've encountered a bug in the sequential adapter when it is used in combination with WaitThenHold. I have attached an example based on the one you sent above, but replaced the TimeCounter with a WaitThenHold (to ensure that the eye is within the tolerance window instead of just counting down). To simplify, I also removed the initial scene. It appears that when the values set for fixation time (wth1a.HoldTime) approach the desired time spent waiting for a saccade (wth2a.WaitTime), the sequential adapter proceeds to wth2a but terminates prematurely without waiting at all.

The example I've attached uses fix_time = 2000 and wait_for_saccade = 2000, but I've noticed this error at a range of values (including when fix_time is slightly less than wait_for_saccade, ex. fix_time = 1500 and wait_for_saccade = 2000, although now it does not occur if fixation is acquired right at the start of the trial i.e. the eye is already within the threshold).

I imagine this has to do with when MonkeyLogic is initiating the WaitThenHold time-keeping process within the Sequential adapter, but I wasn't sure.
Attachments:
open | download - RN8JR.zip (65.2 KB)
Re: Image Presentation During Saccades
September 30, 2019 10:22AM
I rewrote the Sequential adapter. Please overwrite the one in your ext directory with the attached file. Or download the package again.
Attachments:
open | download - Sequential.m (2.8 KB)
Re: Image Presentation During Saccades
October 02, 2019 11:58AM
Hi Jaewon,

I'm now getting the following error when I try to start the task:

Undefined function or variable 'clearmarker'.
Error in Sequential/draw (line 79)
clearmarker(obj.Param);

It doesn't look like clearmarker was in the previous version of the Sequential adapter, so is this another file that I need?
Re: Image Presentation During Saccades
October 02, 2019 12:07PM
You need to download the entire package, not just the adapter. Sorry for the inconvenience. I think I designed Sequential for too special cases previously so tried to make it work more generally this time.

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.