| Reference | Downloads | Github

Equal distribution of dot stimulus (DotStim) over aperture with long dot life: (how) can I use this GitHub code?

OSX Mojave
PsychoPy v3.0.7 (standalone)

I want to create a dot stimulus with dots that have an infinite dot life time and a 100% coherent motion direction, though with the concentration of dots over the aperture to be homogeneous at any time in the stimulus duration. It is known that this is not the case when using the default DotStim settings in the Builder and only altering coherence to 1.0 and dot life time to -1 (infinite).

I found this GitHub code that exactly describes this problem and, I think, offers a solution:
Link to GitHub

It is unclear to me if this is an earlier version of the DotStim code? Because it is also called “”? Is it is an alteration? And, if so, how could I implement this code when using the builder? Should I store this file at the appropriate folder in the PsychoPy application folder instead of the “” file that came with the installation?

Is any of you familiar with this code on GitHub and does it indeed provide a solution for my problem?

Hi @Myjulo, the link is to a current version of PsychoPy, but it may seem confusing becuase of the commit history for was last updated for version 1.90.2. This means that the code has not been updated since PsychoPy version 1.90.2, but is still the most recent version available.

To implement this code in Builder, you would use the Dots: Random Dot Kinematogram (RDK) component in the Stimuli category in Builder. See DotStim API documentation and also the DotStim RDK for Builder documentation

Hi @dvbridges,

Thank you for the clarification! I have an additional question though. In the code in the link at line 13, there is a comment stating that the dot stimulus can be programmed such that new dots do not appear randomly in the aperture but at the opposite edge of where they are moving to, so that the density of dots over the aperture stays homogeneous. This homogeneity issue is well known for the dot stimulus when using an infinite dot life time and a 100% coherent motion direction. Is there indeed a solution provided in the code?

Hi, I am running into the same problem. Has this been resolved? Any suggestion how to fix?


Hello, I am running into the same issue and am not able to resolve it. Could you please provide addition information?

Much appreciated!

Hi there! I fixed it in a somewhat unelegant way. But what I do is make the dotstimulus larger than I intend it to be and then paste a circular aperture over the dotstimulus to make it smaller. If you now coordinate the speed of the dots and the duation of the trial to the ratio of the dotstimulus and aperture size, you should have homogeneous dots every trial during the whole trial.

1 Like

@dizzie I actually have to add something. I remembered I also use this code in the “Begin Routine” section in a Builder code element:

dots._verticesBase = dots._newDotsXY(400)

where ‘dots’ is the name of the dotstimulus and 400 stands for the number of dots used for that stimulus.