# Display images randomly between baseline periods

**URL:** <https://discourse.psychopy.org/t/display-images-randomly-between-baseline-periods/42471>\
**Category:** Builder\
**Tags:** randomization, images\
**Created:** [October 16, 2024, 2:31am UTC](https://discourse.psychopy.org/t/display-images-randomly-between-baseline-periods/42471 "2024-10-16T02:31:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MPCHe18](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@MPCHe18](https://discourse.psychopy.org/u/MPCHe18)\
**Post date:** [October 16, 2024, 2:31am UTC](https://discourse.psychopy.org/t/display-images-randomly-between-baseline-periods/42471/1 "2024-10-16T02:31:02Z")

</div>

**OS** : 11  
**PsychoPy version** : 2024.2.2

Hi everyone, I hope someone can help me with my experiment. I’m new using Psychopy. I want to replicate the experimental paradigm of the following diagram:

 ![Par](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/4/b/4bc9a199116243048a467eab80aaa91f676b6b22.png)

During the experiment, the participant will be shown 3 different images and 1 video. One image corresponds to the 20-second rest period before each condition. The other two images and the video tell the participant which movement condition should be performed. What I want is to show one of the conditions (2 images or the video) randomly for each trial.

My question is: in the Builder editor should I create a trial with the rest period image and one of the two images or the video, and then create another trial with a different condition case? And how can I set the random option? Or in one trial use all the images and the video? Below is an option I was trying but I don’t know if the sequence is correct.

 ![screenshot](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/b/7/b73243c81caca2de08f0d90e7232183bebc50ff1.png)  
Thanks in advance for your help.  
Best regards.

---

<div class="post-metadata">

**Author:** ![jderrfuss](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/jderrfuss/32/5245_2.png) [@jderrfuss](https://discourse.psychopy.org/u/jderrfuss)\
**Post date:** [October 16, 2024, 4:35pm UTC](https://discourse.psychopy.org/t/display-images-randomly-between-baseline-periods/42471/2 "2024-10-16T16:35:27Z")

</div>

Hi,

There might be more elegant solutions that I can’t think of right now, but spontaneously I would be leaning towards the approach shown in the attached file. The idea is to have separate routines for the images and the video and to stop the routine from running that is not required on a current trial, based on a column called `trlType` in your condition file.

Hope this helps.

Jan

[img\_vs\_video.psyexp](https://discourse.psychopy.org/uploads/short-url/tOLnYNYvzwrnP99wcnsDVvwuwxW.psyexp) (22.2 KB)  
[input.xlsx](https://discourse.psychopy.org/uploads/short-url/oxKTVIxaEjvF11foetLgHfRU4vL.xlsx) (9.0 KB)

---

<div class="post-metadata">

**Author:** ![MPCHe18](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@MPCHe18](https://discourse.psychopy.org/u/MPCHe18)\
**Post date:** [October 18, 2024, 1:16am UTC](https://discourse.psychopy.org/t/display-images-randomly-between-baseline-periods/42471/3 "2024-10-18T01:16:46Z")

</div>

Thank you so much for your help. I’ll work on the details, but it actually works very well.  
Thanks again.
