allensdk.brain_observatory.natural_scenes module

class allensdk.brain_observatory.natural_scenes.NaturalScenes(data_set, **kwargs)[source]

Bases: allensdk.brain_observatory.stimulus_analysis.StimulusAnalysis

Perform tuning analysis specific to natural scenes stimulus.

Parameters:
data_set: BrainObservatoryNwbDataSet object
extralength
static from_analysis_file(data_set, analysis_file)[source]
get_noise_correlation(self, corr='spearman')[source]
get_peak(self)[source]

Computes metrics about peak response condition for each cell.

Returns:
Pandas data frame with the following fields (‘_ns’ suffix is for
natural scene):
  • scene_ns (scene number)
  • reliability_ns
  • peak_dff_ns (peak dF/F)
  • ptest_ns
  • p_run_ns
  • run_modulation_ns
  • time_to_peak_ns
get_representational_similarity(self, corr='spearman')[source]
get_response(self)[source]

Computes the mean response for each cell to each stimulus condition. Return is a (# scenes, # cells, 3) np.ndarray. The final dimension contains the mean response to the condition (index 0), standard error of the mean of the response to the condition (index 1), and the number of trials with a significant (p < 0.05) response to that condition (index 2).

Returns:
Numpy array storing mean responses.
get_signal_correlation(self, corr='spearman')[source]
interlength
number_scenes
open_corona_plot(self, cell_specimen_id=None, cell_index=None)[source]
plot_time_to_peak(self, p_value_max=0.05, color_map=<matplotlib.colors.LinearSegmentedColormap object at 0x7fcdbf7bd1d0>)[source]
populate_stimulus_table(self)[source]

Implemented by subclasses.

reshape_response_array(self)[source]
Returns:response array in cells x stim x repetition for noise correlations
sweeplength