Image file pool
Hello! Is there any way to get 8 images to randomly appear on a sketchpad out of a total 12 images without using python script? I am not experienced in coding at all, so I would prefer the easiest option for doing this.
Thank you!!
Hello! Is there any way to get 8 images to randomly appear on a sketchpad out of a total 12 images without using python script? I am not experienced in coding at all, so I would prefer the easiest option for doing this.
Thank you!!
Comments
Hi @anna_snow
You could use a table with eight columns for the image names and eight columns for the image positions. The number of rows would depend on your specific experimental design (e.g., all possible combinations of eight out of twelve images). Then, set your loop order to 'random' if needed (and/or shuffle rows with minimal coding), and use a sketchpad item to present your pictures.
This is just one way to implement an experiment; there are many others. It just takes a bit of practice and reading through the documentation to fully grasp how you can achieve your intended structure. You may find this tutorial helpful as a starting point.
Hope this helps!
Claire
Check out SigmundAI.eu for our OpenSesame AI assistant! 🤖
Hi @anna_snow,
The implementation would depend on several variables such as whether you want to present the pictures sequentially or simultaneously, whether you want each picture to be presented equally often across the experiement (or even across positions), whether you want all combinations to be implemented etc.
The suggestion from @cvanbuck will work very nicely if you have your sequences set and want to copy and paste them in the loop table.
Reading your message, I just thorugh I'd comment that if you're only interested in a purely random selection of 8 pictures out of a fixed set of 12 with no other condition, one simple way (requiring no Python coding) is to use the
shuffle_horizfunction in the script of the loop (see https://osdoc.cogsci.nl/4.0/manual/structure/loop/#shuffle_horiz). You would just need to include 12 columns (containing the names of the 12 picture files; let's say you call the columns P1 top P12), addshuffle_horiz P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 P11 P12at the end of the loop's script. This wilol shuffle the content of the cells horizontally between columns P1 to P12 such that the file names will be randomized across these columns on every trial.You can download my example here: https://www.dropbox.com/scl/fi/cfjjz99n7qhj73onn4d4e/codeless-rnd-selection-of-pictures-from-a-fixed-pool.osexp?rlkey=k3hxslj9iagnge9h8ibf7k8zk&dl=0
Hopefully you can adapt it to your needs.
If you need quasi-randomization, with specific conditions regarding the probabilities of sampling etc., then you'll most likely have to get to grip with some coding, however.
Best,
Fabrice.