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(corr='spearman')[source]
get_peak()[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(corr='spearman')[source]
get_response()[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(corr='spearman')[source]
interlength
number_ori
number_phase
number_sf
open_fan_plot(cell_specimen_id=None, include_labels=False, cell_index=None)[source]
orivals
phasevals
plot_orientation_selectivity(si_range=[0, 1.5], n_hist_bins=50, color='#ccccdd', p_value_max=0.05, peak_dff_min=3)[source]
plot_preferred_orientation(include_labels=False, si_range=[0, 1.5], color='#ccccdd', p_value_max=0.05, peak_dff_min=3)[source]
plot_preferred_spatial_frequency(si_range=[0, 1.5], color='#ccccdd', p_value_max=0.05, peak_dff_min=3)[source]
plot_time_to_peak(p_value_max=0.05, color_map=<matplotlib.colors.LinearSegmentedColormap object>)[source]
populate_stimulus_table()[source]

Implemented by subclasses.

reshape_response_array()[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