Presenting a large number of stimuli without making textures

Hello,

I am coding an experiment that requires the presentation of a large number of stimuli (in the order of 2^16). My initial plan was to generate the stimuli at the beginning of the experiment, make textures out of them, and then draw the textures later on during their presentation. However, I realized the number of stimuli is too large to allow me to do this. Now, I’m looking for alternate coding solutions and I’d appreciate your help.

More about the stimuli: The size of each stimulus is 1024*768. Each stimulus is a large circle that contains a number of arcs colored as black or white. An example is shown below (later on we may need to increase the number of arcs to a very larger number)

For all the stimuli, the structure is supposed to remain the same (i.e. the same segmentation), but the color of each arc has to change based on a pseudorandom sequence. The length of that sequence is 2^16 and that’s why I have so many different stimuli.

During the experiment, each of these stimuli is supposed to be presented for only one frame (8.33ms, 120Hz refresh rate) and each stimulus comes right after the previous one, no delay in between.

My setup: My graphics card is an AMD Radeon RX 5700 XT. I run Psychtoolbox-3 on MATLAB2020b and my OS is Ubuntu 20.04.1. I am also using a Bits# to connect my monitor to a DAQ to send a trigger to it, so my stimulus presentation happens through the Bits#.

Thanks,
Sara

My authentication code for priority support:
CZS6KX2Y-202145122119:509c8b2e476ca976cfd253b3f725126098767e9a548cb4f30fa1ea282922433f

You can draw this on the fly each frame using Screen(‘FillArc’). Start with the largest elements (largest diameter) and then progressively draw the smaller ones on top. This allows you to vary the color as you wish as well

2 Likes

I can’t believe this was so easy! I’d totally missed the command.
Thank you very much for your help!

ArcDemo.m demonstrates it. Testing on my graphics cards suggests that you could probably draw on the order of 200 arcs this way without starting to skip frames, depending on the specifics of your code. Maybe a bit more, maybe a bit less. So this is probably the most simple approach, but in the end it depends on what you mean by “…(later on we may need to increase the number of arcs to a very larger number)…” and with “…the structure is supposed to remain the same (i.e. the same segmentation) …”, or if a different approach would be needed.

-mario
[Time spent so far: 20 Minutes]

1 Like