Skip to content

a random dot kinematogram (RDK) implemented with PyGame

Notifications You must be signed in to change notification settings

GabrielBena/pygame_rdk

 
 

Repository files navigation

Random Dot Kinematogram

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.

Install :

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

Run Experiment

Experiment with random parameters :

-experiment.ipynb

Plot polar repartitions of angles, adjust parameters then run experiments :

-rdk_histograms.ipynb

Examples

The easiest way to get started is to call the rdk script and play around with different parameters

Trials with Fixation

I've also implemented a fixation cross and aperture, as well as a separate class to define trial sequences. Below is an example:
trialseq

Dot coherence

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%
coher100

2. Example with coherence of 50%
coher100

3. Example with 0% coherence
coher100

Dot size and density

Both the number of dots and their size can be adjusted.

1. Example with small and many dots
smallandmany

2. Example with few and large dots
fewandlarge

Dot speed

You can also change the speed with which dots move over the screen (in terms of pixels per frame)

1. Slow dots
fewandlarge

2. Fast dots
fewandlargefast

About

a random dot kinematogram (RDK) implemented with PyGame

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 88.9%
  • Python 11.1%