Use image stimulus from previous routine

If this template helps then use it. If not then just delete and start from scratch.

OS (e.g. Win10): Mac Os Big Sur 11.6.1
PsychoPy version (e.g. 1.84.x): 2021.2.3
Standard Standalone? (y/n) If not then what?: Y
What are you trying to achieve?:

I want to randomly select a stimulus from a set of four in one routine (I know how to do that), and then use the same stimulus in the next routine (it is an image). I don’t know how to tell Psychopy that it has to take the randomly selected image from the previous routine. What code component do I have to type and what do I have to specify in the image component in the Builder?

Hello Leila

does this toy-example fit your needs? The code just assigns the variable stim2 the value of the variable stim.

stim2 = stim

in a code-component before the stimulus stim is shown. The code is in the Begin routine tab, and the stimuli are set to set every repeat. In the following routine stim2 is shown.

ReuseStim.psyexp (10.6 KB)
ReuseStim.xlsx (8.4 KB)

The example uses numbers instead of images but I assume it will work with images as well.

Best wishes Jens

It was that simple. It works very well. Thank you very much!