Welcome! Log In Create A New Profile

Advanced

How to Present Fixation-Dependent Images Using ImageGraphic

Posted by MBSLAPIK 
How to Present Fixation-Dependent Images Using ImageGraphic
March 24, 2025 10:04PM
Hello everyone,

I am currently working on a task that presents many stimuli (40 - 120), is dependent on fixation, and requires
no subject response except maintained fixation. Because there are so many images and only one "condition", I am trying to
use ImageGraphic in a loop to pull the images from a sequence and present them during fixation.
Currently, I am having difficulty getting even just one image to display.

Here is my scene code:

%Scene 1: Fixation
fix1 = SingleTarget(tracker);
fix1.Target = fixation_point;
fix1.Threshold = fix_radius;
wth1 = WaitThenHold(fix1);
wth1.WaitTime = wait_for_fix;
wth1.HoldTime = initial_fix;
scene1 = create_scene(wth1);

%Scene 2: Presenting sample
fix2 = SingleTarget(tracker);
fix2.Target = fixation_point;
fix2.Threshold = hold_radius;
wth2 = WaitThenHold(fix2);
wth2.WaitTime = 0;
wth2.HoldTime = sample_time;

img = ImageGraphic(null_);
img.List = { 'bwpic2.jpeg', [0 0] };

con2 = Concurrent(wth2);
con2.add(img)
scene2 = create_scene(con2);


The fixation scene seems to run ok in simulation mode, but no images are presented. When I review mlplayer
it lists my chosen eventmarker for fixation onset but then outputs 3 (broke fixation) even when I did not.

I am unsure if the issue is with my use of ImageGraphic/the way I add it to the scene, or with some other element,
such as the fixation point or the way I'm coding the duration of the scene. I have referred to the code for dms2 to create
the fixation point using adapters/GUI inputs since ImageGraphic doesn't work with Task Objects. I saw TimeCounter used in
other posted examples to determine the duration of stimulus presentation, however, since my scene is dependent upon
fixation being maintained I chose to set the target to the fixation point, not the image sample. Thus I thought that wth2
would determine scene duration and that it would suffice to simply add the image using con2 instead of setting it as the target.

Any help or advice would be appreciated.

Thank you
Re: How to Present Fixation-Dependent Images Using ImageGraphic
March 24, 2025 10:54PM
I do not see any problem in the code you showed. The issue must be caused by something else.

If you are saying that you want to present multiple images sequentially during fixation within a trial, you should use ImageChanger. Running ImageGrahphic repeatedly in a loop is a bad idea, because it will introduce a time gap between images.
https://monkeylogic.nimh.nih.gov/docs_RuntimeFunctions.html#ImageChanger

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.