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 ādot.pyā? 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 ādot.pyā 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 dot.py was last updated for version 1.90.2. This means that the dot.py 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
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 dot.py code?
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.
Iāve made a couple of edits to the github code to make things work for my purposes.
Let me know if youād like a copy of my version.
(Iām not enough of a programmer to post things on github, but happy to share.)
Sure thing! Iām not sure whether you can get an email attachment via PsychoPy - Iāll try. If it doesnāt come through, please give me your email address and Iāll send the code directly.
For this to work, youāll first have to find the place on your computer where the original dot.py file is stored.
On my PC, I could get there by right-clicking on the PsychoPy icon, then choosing āopen file locationā, and navigating to PsychoPy3\Lib\site-packages\psychopy\visual.
On my Mac, I navigated to PsychoPy in the Applications folder, right-clicked, and chose āShow Package Contentsā, then found the files under Applications/PsychoPy3/Contents/Resources/lib/python3.6/psychopy/visual.
Iād then copy the dot.py file thatās in there (youāll probably need admin privileges) to some other location for safekeeping.
Then re-name the attached file to dot.py and put it into the āvisualā folder (again, youāll probably need admin privileges).
Any call to DotStim will then use this code - and hopefully work without dot density inhomogeneities.
(As you can see above, Iām using PsychoPy3.6 - no clue whether it works with earlier versions.
I left pretty extensive comments in the code to mark my edits - look towards the end of the file if youāre curious.)