| Reference | Downloads | Github

How to use static component to preload variable image stimuli?

OS (e.g. Win10): macOS High Sierra
PsychoPy version (e.g. 1.84.x): v2021.2.3

What are you trying to achieve?:

I’m creating a task to record reaction time at the appearance of a visual stimuli.

I have created a loop with 2 routines:

  • Routine1: there is a constant image (downloaded directly from my laptop images) with duration: 15 frames
  • Routine2: there is an image that varies at every repetition of the loop (I have an excel file with the corresponding stimuli and have selected “set every repeat”). This routine ends with a keyboard response.

The loop works, however each presentation of an image is a lot slower than the set times.
I’m trying to find a way to avoid imprecision in timing, so that the inter stimuli interval is no more than 0.25 sec (which is equal to 15 frames on a monitor that has a 60Hz refresh rate, if I’m not mistaken)

What did you try to make it work?:

I added a routine before the loop, with a static component that lasts 1 sec, to load the constant image that is in Routine1. I also changed the image to set: during static component.

However, the intervals are still too slow and I think this is caused by the variable images in Routine2 taking time to load from the excel file.

What specifically went wrong when you tried that?:

I tried to create another static component to preload images for Routine2. But given they have to be “set every repeat” I cannot link them to the static component with “set:during static component”?

I’m aware that using a static component may not be the solution here… Am I using it wrong? Do you know a way to prevent delay due to image loading in this case? (where there are different images from the conditions file to be presented at each repetition of the loop)

I’m new to PsychoPy and don’t know how to use the coder which may make things difficult if that is what I need to modify but I’m willing to learn!

Thank you for your help! :slight_smile: I hope my explanation is clear enough.

1 Like