How can I access the natural images used in the Brain Observatory?

brain-observatory-visual-coding
experiment-design
how-to
analysis
allensdk
#1

Each of the experiments contains the images (or info necessary to reconstruct them).

This Jupyter notebook demonstrates how to use the allensdk Python package to get or reconstruct each image:
http://alleninstitute.github.io/AllenSDK/_static/examples/nb/brain_observatory_stimuli.html

Note that these images are warped when displaying them on the monitor so that each image pixel is occupies the same angle of the visual field no matter whether it is in the center of the screen (which is close to the mouse’s eye) or the edge (which is far).

A demonstration of how this warping affects the images can be seen here:
http://alleninstitute.github.io/AllenSDK/_static/examples/nb/brain_observatory_monitor.html

0 Likes

#2

I received a related question to this at Cosyne. Is it possible to download or view the stimuli set without going through an experiment file where that stimulus was used?

0 Likes

#3

Currently stimulus templates are only accessible via NWB files.

For reference, you can access them as follows (example: allensdk 0.16.0, natural_movie_one stimulus template):

from allensdk.core.brain_observatory_cache import BrainObservatoryCache
boc = BrainObservatoryCache(manifest_file='/path/to/manifest.json')
exps = boc.get_ophys_experiments(stimuli=['natural_movie_one'])
ds = boc.get_ophys_experiment_data(exps[0]['id'])
template = ds.get_stimulus_template('natural_movie_one')
1 Like