Preferred Images, Image Selectivity Index


I’m analyzing image selectivity using the Visual Coding dataset. In the precomputed unit analysis metrics table, there is a column that should contain the preferred images for each neuron. However, the indices in this column do not correspond to the indices in the natural scenes dataset. They range from 4908 to 5026, whereas the natural scene indices obtained using the cache.get_natural_scene_template() method range from 0 to 117.

Can anyone help clarify this discrepancy? How can I get the preferred images based on the indices listed in the precomputed unit analysis metrics table? Also, can anyone send the link to the source code from which one can understand why the numeration differs?

Additionally, for image selectivity analysis in the Visual Coding dataset, there is no p-value calculated (Visual Coding – Neuropixels — Allen SDK dev documentation). However, for the same analysis in the Calcium Imaging dataset, the p-value was computed (Brain Observatory — Allen SDK dev documentation, response p value). Does anyone know why?

Thank you!

The numbers you’re seeing correspond to the stimulus_condition_ids, which are applied to all stimulus types and are unique within each session. In order to translate those to natural scene indices, you’ll need to load the NWB file for each session you’re interested in, extract the stimulus table, and check which image is associated with which condition ID. This was obviously an oversight that was made when calculating these metrics.

The code for performing the Natural Scenes analysis is available here: AllenSDK/allensdk/brain_observatory/ecephys/stimulus_analysis/ at master · AllenInstitute/AllenSDK · GitHub

And this is where the preferred condition is calculated. The output of this function should have been translated to image IDs before saving.

At the time of the Neuropixels data release, we weren’t confident that the methods for calculating response p-values developed for 2P imaging were appropriate to apply to spiking data. If you’re interested in calculating responsiveness metrics for the ephys data, you can take a look at this fork of the AllenSDK, which was created for the analysis performed in this paper.

Thanks a lot! I have one more question - for some units in the precomputed metrics table, both the preferred image and the image selectivity index are set to NaN. Does this indicate that there were no recordings from these units during the presentation of natural scenes?

That’s right!

Many thanks!