# Access Stimulus Data for Visual Coding Experiments

**URL:** <https://community.brain-map.org/t/access-stimulus-data-for-visual-coding-experiments/1070>\
**Category:** Technical\
**Tags:** brain-observatory-visual-coding, how-to, allensdk\
**Created:** [May 3, 2021, 1:47pm UTC](https://community.brain-map.org/t/access-stimulus-data-for-visual-coding-experiments/1070 "2021-05-03T13:47:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![maxtaylordavies](https://avatars.discourse-cdn.com/v4/letter/m/eb8c5e/32.png) [@maxtaylordavies](https://community.brain-map.org/u/maxtaylordavies)\
**Post date:** [May 3, 2021, 1:47pm UTC](https://community.brain-map.org/t/access-stimulus-data-for-visual-coding-experiments/1070/1 "2021-05-03T13:47:01Z")

</div>

Hello! A massive thank you to everyone involved in making these tools and datasets publicly available - they’re an amazing resource!

I was wondering if it’s possible to get access to the raw stimulus frames used in the NeuroPixels Visual Coding experiments? Specifically natural movies one and three, although the other stimuli (or a link to code used to generate them) would be fantastic too. I looked through both the technical whitepaper and the AllenSDK documentation, but didn’t find any reference to accessing the raw stimulus data itself.

Apologies if I’ve missed something obvious, or if this question has been asked before.

Thank you,  
Max

---

<div class="post-metadata">

**Author:** ![joshs](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/joshs/32/8_2.png) [@joshs](https://community.brain-map.org/u/joshs)\
**Post date:** [May 3, 2021, 3:12pm UTC](https://community.brain-map.org/t/access-stimulus-data-for-visual-coding-experiments/1070/2 "2021-05-03T15:12:30Z")

</div>

Hi Max! Once you’ve set up a `cache` object, you can get the movie stimulus frames as follows:

```
movie = cache.get_natural_movie_template(1) # 1 or 3

```

For the natural scenes, it’s similar:

```
scene = cache.get_natural_scene_template(0) # 0 - 117

```

It’s true that these functions are not obvious from the documentation – we’ll work on getting that fixed.

To generate the other stimuli, we either used PsychoPy’s [GratingStim](https://www.psychopy.org/api/visual/gratingstim.html#psychopy.visual.GratingStim) or [DotStim](https://www.psychopy.org/api/visual/dotstim.html#psychopy.visual.DotStim) classes.
