allensdk.brain_observatory.static_gratings module

class allensdk.brain_observatory.static_gratings.StaticGratings(data_set, **kwargs)[source]

Bases: allensdk.brain_observatory.stimulus_analysis.StimulusAnalysis

Perform tuning analysis specific to static gratings 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 related to each cell’s peak response condition.

Returns:
Panda data frame with the following fields (_sg suffix is
for static grating):
  • ori_sg (orientation)
  • sf_sg (spatial frequency)
  • phase_sg
  • response_variability_sg
  • osi_sg (orientation selectivity index)
  • peak_dff_sg (peak dF/F)
  • ptest_sg
  • time_to_peak_sg
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 (# orientations, # spatial frequencies, # phasees, # 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 response (p < 0.05) to that condition (index 2).

Returns:
Numpy array storing mean responses.
get_signal_correlation(self, corr='spearman')[source]
interlength
number_ori
number_phase
number_sf
open_fan_plot(self, cell_specimen_id=None, include_labels=False, cell_index=None)[source]
orivals
phasevals
plot_orientation_selectivity(self, si_range=[0, 1.5], n_hist_bins=50, color='#ccccdd', p_value_max=0.05, peak_dff_min=3)[source]
plot_preferred_orientation(self, include_labels=False, si_range=[0, 1.5], color='#ccccdd', p_value_max=0.05, peak_dff_min=3)[source]
plot_preferred_spatial_frequency(self, si_range=[0, 1.5], color='#ccccdd', p_value_max=0.05, peak_dff_min=3)[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 conditions x repetition for noise correlations

this is a re-organization of the mean sweep response table

sfvals
sweeplength