Responses of 10,000 neurons to 2,800 natural images
Code to analyze recordings of 10,000 neurons in response to 2,800 natural images presented twice
This code produces the figures from Stringer, Pachitariu et al, 2018b:
Carsen Stringer, Marius Pachitariu, Nicholas Steinmetz, Matteo Carandini, Kenneth D. Harris. High-dimensional geometry of population responses in visual cortex. bioRxiv. (link)
It relies on data deposited on figshare at:
Carsen Stringer, Marius Pachitariu, Nicholas Steinmetz, Matteo Carandini, Kenneth D. Harris. Recordings of ten thousand neurons in visual cortex in response to 2,800 natural images. (link)
The datasets to produce all the main figures are available. The script 'process_data.m' is the main processing script. Set useGPU=0 if you do not have a GPU. The calls to the figure functions live in 'make_figs.m'.
If you use the data please cite the original paper and the figshare DOI.
Each visual stimulus is presented across 3 screens surrounding the mice. Each of the following stimulus sets was presented at least twice in a recording:
Each of the following stimulus sets was presented 96 times in a recording:
dbstims.mat: Database of recording information. In summary there are 32 total recordings: 7 natimg2800, 4 natimg2800_white, 6 natimg2800_8D, 4 natimg2800_4D, 3 natimg2800_small, 4 ori, 4 natimg32
stimset_mname_date.mat
Each file is a different session with images given by "stimset" with mouse_name "mname" and date "date"
All image files contain a matrix imgs which is 68 degrees by 270 degrees by number of images, where degrees represent degrees of the mouse's visual space.
Extra: sparseStats.mat are the powerlaws from sparse noise recordings; allimgs.mat contains example images from the images*.mat
See also notebook powerlaws.ipynb.
import scipy.io as sio
mt = sio.loadmat('natimg2800_M160825_MP027_2016-12-14.mat')
### stimulus responses
resp = mt[‘stim’][0]['resp'][0] # stimuli by neurons
istim = mt[‘stim’][0]['istim'][0] # identities of stimuli in resp
spont = mt[‘stim’][0]['spont'][0] # timepoints by neurons
### cell information
med = mt[‘med’] # cell centers (X Y Z)
mt[‘stat’][0] # first cell’s stats
mt[‘stat’][0][‘npix’] # one example field, tells you how pixels make up the cell
### loading images
mt = sio.loadmat('images_natimg2800_all.mat')
imgs = mt['imgs'] # 68 by 270 by number of images
# check out first image using matplotlib.pyplot
plt.imshow(imgs[:,:,0])
The stimuli in the present study is composed of natural images from several several natural categories; their class assignment was not used at all in the analysis.
However, manually labeled class assignment is avaialable in the classes
folder:
claeeses/stimuli_class_assignment.mat
contains categorization of the stimuli into 15 classes ('birds', 'cats', 'flowers', 'hamsters', 'holes', 'insects', 'mice', 'mushrooms', 'nests', 'pellets', 'snakes', 'wildcats', 'other animals', 'other natural', 'other man made') and an additional 'unknown' class.claeeses/stimuli_class_assignment_confident.mat
contains categorization of the stimuli into 11 classes ('birds', 'cats', 'flowers', 'hamsters', 'holes', 'insects', 'mice', 'mushrooms', 'nests', 'pellets', 'snakes') where the 'wildcats' class was merged into 'cats' and 'other animals', 'other natural', 'other man made' are considered 'unknown'.Both mat
files contains:
class_assignment
variable which is a vector of length 2800 with the corresponding class id;class_names
variable with the corresponding class names (zero-based, so that the first entry is 'unknown' which correspond to id=0, the second is 'birds' and correspond to id=1, etc.).A matlab GUI application used to perform the classification is also provided in classes/class_verify
. It is provided here just for referrence and is not further documented.