I am asking assistance with my experiment, I have been trying to randomise/loop images but they never appear as random, only one of them appears 4 times instaead of 4 different images appearing in random order

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

OS (e.g. Win10):
PsychoPy version (e.g. 2024.2.4 Py 3.8): 2024 version
Standard Standalone Installation? (y/n) If not then what?:
**Do you want it to also run online? (y/n)**yes
What are you trying to achieve?: I am trying to create a task where an experiment/routine will consist of target objects and distractor objects. Each display will have one type images and a differnt kind of image. There will be between 8 and 11 target items (and 8-11 distractors) in each display. The displays of images will be organized into 30 sets of displays. Each display in a set will have one type of target item but different distractors. Before each trial, an image of the target item will be shown in the middle of the screen for 2 seconds. Once the test display appears, a number between 8-11 will be shown in the bottom right-hand corner of the screen and participants will have to press yes/no to see if they chose well/correctly

What did you try to make it work?: I created an experiment where I created a loop and inside the loop there is an excel document that has 4 conditions and 1 parameter, and there is 1 image in the routine that is in the loop. howeve, whenever i try to run the experiment, only the image that is in the routine shows and loops 4 times but no other image loops or appears.

Link to the most relevant existing thread you have found: i don’t have a link

What specifically went wrong when you tried that?: the images are not appearing, only one that is selected in the routine is appearing 4 times as if it is looping
Include pasted full error message if possible. “That didn’t work” is not enough information.

You say you only have one image component. For this number of items I would recommend using a list of images created in a code component. Are you already trying to do this?

I do not understand, I am so sorry this is my first time creating an experiment in general. But how do I do this?

I have tried adding different images in the routine that is in the loop, but whenever I run the experiment, they appear in that order and 4 times (which I am assuming is because the component in the exccel thats in the loop has 4 components and 1 parameter) and they are not random at all

Hello @Mataviola

Well, it might help if you posted a toy-version of your experiment to understand what you are trying to achieve.

Best wishes Jens

Hi, I hope you are well. So this is how my experiment has been designed thus far:

  1. I created a folder
  • Inside the folder there is a folder that has 4 images
  • There is an excel that has the 4 components and 1 parameter
  1. The experiment

  2. There is a welcome routine that has a welcome message

  3. Instruction routine that has instructions

  4. There is a loop

  • Inside the loop there is the trial routine which has the image (this image is the one that appears 4 times when i run the experiment)
  • From one video that i watched, it was said that if i want the experiment to read the data on the excel, i should add the $ - dollar sign in the attachment name (right where i attached the picture that appears) and save it using the name of the parameter on the excel; but whenever i do that, the experiment will read all the information until the instruction and it will end

Ii. the loop has the excel that has the 4 conditions and 1 parameter

  1. The goodbye routine with a goodbye message

- this is how the loop is
- this is the excel that is in the attched in the loop, the names in the condition and in the folder that is in for the experiment are saved exactly the same (e.g. ladder.png, etc)

Hello @Mataviola

Just for clarification of names, you have an Excel file that has four conditions and one column. Your experiment has a certain flow of routines. In your case, the flow is WelcomeScreen, Instruction, Instruction_2, trial, GoodByeScreen. Each routine has one or serveral components, such as text, keyboard aso. These components have parameter or arguments, text size, allowed keys aso.

What is the error message? Does the experiment run till Instruction or does it run till Instruction_2?

Do you mind posting how you set up the component that displays the images?

Best wishes Jens

Hi, yes, that is how it is.

Also, the experiment doesn’t give any error message. But it doesn’'t randomize all the 4 images that are in the image folder. it only plays/appears (4 times) the 1 image that is the component in the trial.

And what I want is that the different images appear at random(these images are in the folder of the experiment, and are named in the excel document as the conditions).

- this is the view of the trial routine
- this is the display of the image component

Your image is set to show one file rather than a variable (your spreadsheet column name).

Hello @Mataviola

as @wakecarter suggested you need to set Image to the column name of your Excel file, that is fruit_images.

Best wishes Jens

Hi, I have changed it and saved it as seen in the attached screenshot below,but whenever I run it ,it crashes, it doesn’t show any image at all. So it just shows from welcomeScreen, instruction, instruction 2 and then ends the experiment

Hello

sorry, change it from fruit_images to $fruit_images

Best wishes Jens

Hi, I changed it and it still crashes after the instruction2. It just ends the experiment without showing a single image.

What is the error message?

Hi, this is what it says on the psychopy runner stdout:

raise IOError(msg % (tex, os.path.abspath(tex)))
OSError: Couldn’t find image images/ladder.png; check path? (tried: C:\Users\tsham\Desktop\Psychopy Experiments\Try again w diff images\images\ladder.png)
ioHub Server Process Completed With Code: 0
################ Experiment ended with exit code 1 [pid:36720] #################
Alert 4705: Column name ‘fruit_images’ in conditions file already exists as a variable in this experiment (user).
For more info see 4705: Column name from conditions file clashes with variable name — PsychoPy v2024.2.5

This is the screenshot of it:

Hello @Mataviola

Well, the error message tells you that the image ladder.png can not be found by the program aka experiment. Follow the link for the Alert 4705 4705: Column name from conditions file clashes with variable name — PsychoPy v2024.2.5

BTW, move your experiment from the Desktop to a designated experiment-folder.

Best wishes Jens

Hi, how do I get this image to be found/detected? Because it is in the folder that has this experiments images and everything related to it.

Okay, no problem, I will move it.

Also, thank you so much for these responses, they are helping a lot and making me feel less anxious about this whole journey.

Hello @Mataviola

Can make a screenshot of the folder with “ladder.png” listing the file “ladder.png”?

Best wishes Jens

1 Like

I believe your files have double extensions (e.g. ladder.png.png)

1 Like

Here is the folder, so when i press the image folder in the first screenshot I get to the folder where the image is listed