a random dot kinematogram implemented in pygame The RDK is fully customisable, i.e. you can change its colour, size, dot coherence, duration of display etc. Each frame is written to a numpy array and returned by the RDK object, which makes this implementation suitable for simulations etc.
git clone https://github.com/GabrielBena/pygame_rdk
cd pygame_rdk
conda env create -f RDK.yml
conda activate RDK
pip install -e.
pip install git+https://github.com/GabrielBena/custom_heatmap.git
pip install git+https://github.com/GabrielBena/pygame-text.git
Experiment with random parameters :
-experiment.ipynb
Plot polar repartitions of angles, adjust parameters then run experiments :
-rdk_histograms.ipynb
The easiest way to get started is to call the rdk script and play around with different parameters
I've also implemented a fixation cross and aperture, as well as a separate class to define trial sequences.
Below is an example:
The coherence of random dot motion, i.e. the percentage of dots moving in the requested direction, can be varied parametrically.
1. Example with coherence of 100%
2. Example with coherence of 50%
Both the number of dots and their size can be adjusted.
1. Example with small and many dots
2. Example with few and large dots
You can also change the speed with which dots move over the screen (in terms of pixels per frame)