different image every trial

marcus.haag's Avatar


04 Oct, 2021 04:01 PM

Hey Chris,

I hope you're doing fine
justing starting to use .mwel instead of .xml.

Now I got a rather simple .mwel question I believe.

I would like to present a different image every trial.

I set up a loop for some images. It looks like this:

stimulus_group images {
range_replicator ( variable = index from = 1 to = 100 step = 1 ) { image_file j${index} ( path = 'jpg/j${index}.jpg' x_size = 15 x_position = TRIAL_cali_fixpoint_x y_position = TRIAL_cali_fixpoint_y ) } }

So far so good.

Now when I want to queue the images (sequentially or randomly - does not matter) what will I have to write in the trial procedure

live_queue_stimulus (?)
queue_stimulus (?)

Maybe you have a template of sorts that I can use?
Thanks for your help with this,


  1. Support Staff 1 Posted by Christopher Sta... on 05 Oct, 2021 01:52 PM

    Christopher Stawarz's Avatar

    Hi Marcus,

    You need to write

    queue_stimulus (images[image_index])

    where image_index is an expression that evaluates to an integer between 0 and 99. Typically, you would generate the index expression using either another range replicator within your protocol or with a selection variable. The attached example demonstrates both approaches.

    Note that there's nothing specific to MWEL here. All of this works exactly the same way in an XML-based experiment.


  2. Christopher Stawarz closed this discussion on 10 Nov, 2021 02:56 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

17 May, 2022 02:12 PM
16 May, 2022 03:12 PM
04 May, 2022 06:02 PM
03 May, 2022 01:30 PM
02 May, 2022 10:47 PM