# Random dot stimuli used by Shadlen's lab

**URL:** <https://discourse.psychopy.org/t/random-dot-stimuli-used-by-shadlens-lab/8017>\
**Category:** Coding\
**Created:** [June 4, 2019, 9:15pm UTC](https://discourse.psychopy.org/t/random-dot-stimuli-used-by-shadlens-lab/8017 "2019-06-04T21:15:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Servant\_Mathieu](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/servant_mathieu/32/4637_2.png) [@Servant\_Mathieu](https://discourse.psychopy.org/u/Servant_Mathieu)\
**Post date:** [June 4, 2019, 9:15pm UTC](https://discourse.psychopy.org/t/random-dot-stimuli-used-by-shadlens-lab/8017/1 "2019-06-04T21:15:57Z")

</div>

Hi,  
I was wondering if somebody ever coded the random dot kinematogram (RDK) algorithm commonly used by Shadlen’s lab (e.g., Roitman & Shadlen, 2002). This post on the forum ([DotStim with small number of dots (+ ideas on future updates)](https://discourse.psychopy.org/t/dotstim-with-small-number-of-dots-ideas-on-future-updates/1142)) explains issues when trying to approximate the algorithm with Psychopy’s Dots functions, but it looks like nobody followed up.  
Mathieu

on the forum, but it looks like nobody followed up.

---

<div class="post-metadata">

**Author:** ![cherepaha](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/cherepaha/32/1338_2.png) [@cherepaha](https://discourse.psychopy.org/u/cherepaha)\
**Post date:** [June 5, 2019, 9:00am UTC](https://discourse.psychopy.org/t/random-dot-stimuli-used-by-shadlens-lab/8017/2 "2019-06-05T09:00:34Z")

</div>

Hi,

I ended up coding it using ElementArrayStim: [https://github.com/cherepaha/Gamble\_RDK/blob/master/ui/rdk\_mn.py](https://github.com/cherepaha/Gamble_RDK/blob/master/ui/rdk_mn.py), used it in a few experiments since then

Arkady

---

<div class="post-metadata">

**Author:** ![Servant\_Mathieu](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/servant_mathieu/32/4637_2.png) [@Servant\_Mathieu](https://discourse.psychopy.org/u/Servant_Mathieu)\
**Post date:** [June 5, 2019, 9:20am UTC](https://discourse.psychopy.org/t/random-dot-stimuli-used-by-shadlens-lab/8017/3 "2019-06-05T09:20:56Z")

</div>

@cherepaha Excellent. Would be cool to incorporate it in PsychoPy, as this algorithm is massively used.

---

<div class="post-metadata">

**Author:** ![cherepaha](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/cherepaha/32/1338_2.png) [@cherepaha](https://discourse.psychopy.org/u/cherepaha)\
**Post date:** [June 5, 2019, 9:42am UTC](https://discourse.psychopy.org/t/random-dot-stimuli-used-by-shadlens-lab/8017/4 "2019-06-05T09:42:01Z")

</div>

@jon is there interest in this?
