How can I use the image files that I defined in the excel file by randomizing them in the same routine?

Hello everyone,
I’m new to Psychopy. I have image files with .bmp extension separated by certain category. I defined these files in excel as follows:

What I want to do is in a single routine; A random picture comes from the ‘stim_16_10’ column when pressing the right arrow key, and a random picture comes up from the ‘stim_16_11’, ‘stim_16_12’…‘stim_16_22’ columns, respectively, when the right arrow key is pressed. Or vice versa, when I press the left arrow key, a random image will come from the ‘stim_16_22’ column, and as I keep pressing the left arrow key, a random image will come from the ‘stim_16_21’, ‘stim_16_20’…‘stim_16_10’ columns, respectively. Then I want to put this routine in the loop. But I couldn’t figure out how to do it. I would be very grateful if you could help me with this. Thank you very much in advance.

Hello Burcu

does the attached toy-example do what you want? You have to press left or right to initiate the trial. A * is displayed. Whenever you press the opposite key in a trial, the trial ends. I used just four columns of text stimuli.

WideStim.psyexp (17.8 KB)
WideStim.xlsx (8.5 KB)

Best wishes Jens

Hello Jens,

Great, it really worked, thank you very much. But that’s not exactly what I wanted to do. I want to make the left and right button presses a continuous button press response. So I want to change images by pressing left or right continuously, not pressing left, left, left… or right, right, right… over and over. Is it possible to integrate this into the toy-example you made?

In addition to this, I want to output the information of the image that the person left on the last screen (or the information of the column to which the image belongs in excel), but I do not know how to do this exactly.

Thank you very much for all your help.

Kind regards,

Burcu

Hello

What do you mean with „a continuous button press“?

Best wishes Jens

Hello Jens,

Actually, let me put it this way, this is just part of the experiment I’m trying to do. I created the image files from a code in matlab, each image consists of a different number of dot arrays. Actually, I want subjects to have numerosity reproductions. While there are different visual versions of the sequences of the same number of dots in each column in Excel, the rows from left to right are the visuals of an increasing number of dot sequences. In each trial, images with a decreasing number of dot arrays should be displayed when subjects continue to press the left button without removing their hands, and images with an increasing number of dot arrays should be displayed when they continue to press the right button without removing their hands. In other words, they should not press the left button 12 times and press the right button 12 times in each trial. That’s what I meant when I said “continuous button press” response. It’s a bit confusing to explain at first, I hope I was able to convey what I mean.

Kind regards,

Burcu

Hello Burcu

yes. I now understand better what you mean. But I am not sure if I can help you with that. Let’s see.

  1. You want to stop the stream of images when the participant lifts the finger from the response button or the end of the stream is reached?

  2. For how long should a single image in the stream be visible?

  3. What would end a trial?

Best wishes Jens

Hello Jens,

The total time for numerosity reproduction is limited to 2000 ms, the duration of a single image is not clear, it’s modifible. However, I will try to set it long enough to allow the subjects to perceive each image, but not to exceed 2000 ms in total. I would also like to explain this part that I think may be important. In each new trial, I want the first stimulus to come randomly from either the highest number of dot array in the last column in excel or the least number of dot array in the first column. When the largest number of dot array is displayed on the screen, the subject should decrease by pressing the left button, and increase by pressing the right button when the least number of dot array is displayed on the screen. The trial will end when the subject removes the hand from the button or after 2000 ms.

Kind regards,

Burcu

Hello Burcu

I am sorry to say but I will not program the experiment for you. Sorry, if I created that impression. You have to program it yourself or find somebody how does it for your, usually for money. See here for instance.

So, what did you try and what did not work out? Here, for instance, is an example where a continuous key press was used.

I am happy to help with problems you experience. So, it is still not clear what you intend to do. In half of the trials, the largest number of dots appears on the screen and when pressing left, the numbers decrease. But what happens when the participants press right or press nothing?

Best wishes Jens

Hello Jens,

No, I didn’t actually have such an expectation, I apologize if it was understood that way. Just because I didn’t know how to do it, I thought if I could get some guiding advice I would try to implement it. I want to design the experiment myself, even if it is difficult. This part where I was stuck was just part of the experimental design. You’ve been really helpful so far, thank you very much for all your help.

Kind regards,

Burcu