allensdk.brain_observatory.receptive_field_analysis package

Submodules

allensdk.brain_observatory.receptive_field_analysis.chisquarerf module

allensdk.brain_observatory.receptive_field_analysis.chisquarerf.NLL_to_pvalue(NLLs, log_base=10.0)[source]
allensdk.brain_observatory.receptive_field_analysis.chisquarerf.build_trial_matrix(LSN_template, num_trials)[source]
allensdk.brain_observatory.receptive_field_analysis.chisquarerf.chi_square_binary(events, LSN_template)[source]
allensdk.brain_observatory.receptive_field_analysis.chisquarerf.chi_square_within_mask(exclusion_mask, events_per_pixel, trials_per_pixel)[source]
allensdk.brain_observatory.receptive_field_analysis.chisquarerf.deinterpolate_RF(rf_map, x_pnts, y_pnts, deg_per_pnt)[source]
allensdk.brain_observatory.receptive_field_analysis.chisquarerf.get_disc_masks(LSN_template, radius=3)[source]
allensdk.brain_observatory.receptive_field_analysis.chisquarerf.get_events_per_pixel(responses_np, trial_matrix)[source]
allensdk.brain_observatory.receptive_field_analysis.chisquarerf.get_peak_significance(chi_square_grid_NLL, LSN_template, alpha=0.05)[source]
allensdk.brain_observatory.receptive_field_analysis.chisquarerf.interpolate_RF(rf_map, deg_per_pnt)[source]
allensdk.brain_observatory.receptive_field_analysis.chisquarerf.pvalue_to_NLL(p_values, max_NLL=10.0)[source]
allensdk.brain_observatory.receptive_field_analysis.chisquarerf.smooth_STA(STA, gauss_std=0.75)[source]

allensdk.brain_observatory.receptive_field_analysis.eventdetection module

allensdk.brain_observatory.receptive_field_analysis.eventdetection.detect_events(data, cell_index, stimulus, debug_plots=False)[source]

allensdk.brain_observatory.receptive_field_analysis.fit_parameters module

allensdk.brain_observatory.receptive_field_analysis.fit_parameters.add_to_fit_parameters_dict_single(fit_parameters_dict, p)[source]
allensdk.brain_observatory.receptive_field_analysis.fit_parameters.compute_distance(center_on, center_off)[source]
allensdk.brain_observatory.receptive_field_analysis.fit_parameters.compute_overlap(data_fitted_on, data_fitted_off)[source]
allensdk.brain_observatory.receptive_field_analysis.fit_parameters.get_gaussian_fit_single_channel(rf, fit_parameters_dict)[source]

allensdk.brain_observatory.receptive_field_analysis.fitgaussian2D module

exception allensdk.brain_observatory.receptive_field_analysis.fitgaussian2D.GaussianFitError[source]

Bases: exceptions.RuntimeError

allensdk.brain_observatory.receptive_field_analysis.fitgaussian2D.fitgaussian2D(data)[source]
allensdk.brain_observatory.receptive_field_analysis.fitgaussian2D.fitgaussian2D_fixedcenter(data)[source]
allensdk.brain_observatory.receptive_field_analysis.fitgaussian2D.gaussian2D(height, center_x, center_y, width_x, width_y, rotation)[source]
allensdk.brain_observatory.receptive_field_analysis.fitgaussian2D.moments2(data)[source]

allensdk.brain_observatory.receptive_field_analysis.postprocessing module

allensdk.brain_observatory.receptive_field_analysis.postprocessing.get_gaussian_fit(rf)[source]
allensdk.brain_observatory.receptive_field_analysis.postprocessing.run_postprocessing(data, rf)[source]

allensdk.brain_observatory.receptive_field_analysis.receptive_field module

allensdk.brain_observatory.receptive_field_analysis.receptive_field.compute_receptive_field(data, cell_index, stimulus, **kwargs)[source]
allensdk.brain_observatory.receptive_field_analysis.receptive_field.compute_receptive_field_with_postprocessing(data, cell_index, stimulus, **kwargs)[source]
allensdk.brain_observatory.receptive_field_analysis.receptive_field.events_to_pvalues_no_fdr_correction(data, event_vector, A, number_of_shuffles=5000, response_detection_error_std_dev=0.1, seed=1)[source]
allensdk.brain_observatory.receptive_field_analysis.receptive_field.get_attribute_dict(rf)[source]
allensdk.brain_observatory.receptive_field_analysis.receptive_field.print_summary(rf)[source]
allensdk.brain_observatory.receptive_field_analysis.receptive_field.read_h5_group(g)[source]
allensdk.brain_observatory.receptive_field_analysis.receptive_field.read_receptive_field_from_h5(file_name, path=None)[source]
allensdk.brain_observatory.receptive_field_analysis.receptive_field.write_receptive_field_to_h5(rf, file_name, prefix='')[source]

allensdk.brain_observatory.receptive_field_analysis.tools module

allensdk.brain_observatory.receptive_field_analysis.tools.dict_generator(indict, pre=None)[source]
allensdk.brain_observatory.receptive_field_analysis.tools.list_of_dicts_to_dict_of_lists(list_of_dicts)[source]
allensdk.brain_observatory.receptive_field_analysis.tools.read_h5_group(g)[source]

allensdk.brain_observatory.receptive_field_analysis.utilities module

allensdk.brain_observatory.receptive_field_analysis.utilities.convolve(img, sigma=4)[source]

2D Gaussian convolution

allensdk.brain_observatory.receptive_field_analysis.utilities.get_attribute_dict(rf)[source]
allensdk.brain_observatory.receptive_field_analysis.utilities.get_components(receptive_field_data)[source]
allensdk.brain_observatory.receptive_field_analysis.utilities.get_shuffle_matrix(data, event_vector, A, number_of_shuffles=5000, response_detection_error_std_dev=0.1)[source]
allensdk.brain_observatory.receptive_field_analysis.utilities.get_sparse_noise_epoch_mask_list(st, number_of_acquisition_frames, threshold=7)[source]
allensdk.brain_observatory.receptive_field_analysis.utilities.smooth(x, window_len=11, window='hanning', mode='valid')[source]

smooth the data using a window with requested size.

This method is based on the convolution of a scaled window with the signal. The signal is prepared by introducing reflected copies of the signal (with the window size) in both ends so that transient parts are minimized in the begining and end part of the output signal.

input:

x: the input signal window_len: the dimension of the smoothing window; should be an odd integer window: the type of window from ‘flat’, ‘hanning’, ‘hamming’, ‘bartlett’, ‘blackman’

flat window will produce a moving average smoothing.
output:
the smoothed signal

example:

t=linspace(-2,2,0.1) x=sin(t)+randn(len(t))*0.1 y=smooth(x)

see also:

numpy.hanning, numpy.hamming, numpy.bartlett, numpy.blackman, numpy.convolve scipy.signal.lfilter

TODO: the window parameter could be the window itself if an array instead of a string NOTE: length(output) != length(input), to correct this: return y[(window_len/2-1):-(window_len/2)] instead of just y.

allensdk.brain_observatory.receptive_field_analysis.utilities.upsample_image_to_degrees(img)[source]

allensdk.brain_observatory.receptive_field_analysis.visualization module

allensdk.brain_observatory.receptive_field_analysis.visualization.plot_chi_square_summary(rf_data, ax=None, cax=None, cmap='magma')[source]
allensdk.brain_observatory.receptive_field_analysis.visualization.plot_ellipses(gaussian_fit_dict, ax=None, show=True, close=True, save_file_name=None, color='b')[source]

Example Usage: oeid, cell_index, stimulus = 512176430, 12, ‘locally_sparse_noise’ brain_observatory_cache = BrainObservatoryCache() data_set = brain_observatory_cache.get_ophys_experiment_data(oeid) lsn = LocallySparseNoise(data_set, stimulus) result = compute_receptive_field_with_postprocessing(data_set, cell_index, stimulus, alpha=.05, number_of_shuffles=5000) plot_ellipses(result[‘off’][‘gaussian_fit’], color=’r’)

allensdk.brain_observatory.receptive_field_analysis.visualization.plot_fields(on_data, off_data, on_axes, off_axes, cbar_axes=None, clim=None, cmap='magma')[source]
allensdk.brain_observatory.receptive_field_analysis.visualization.plot_gaussian_fit(rf_data, ax_on, ax_off, ax_cbar=None, cmap='magma')[source]
allensdk.brain_observatory.receptive_field_analysis.visualization.plot_mask(rf_data, ax_on, ax_off, ax_cbar=None, cmap='magma')[source]
allensdk.brain_observatory.receptive_field_analysis.visualization.plot_msr_summary(lsn, cell_index, ax_on, ax_off, ax_cbar=None, cmap=None)[source]
allensdk.brain_observatory.receptive_field_analysis.visualization.plot_p_values(rf_data, ax_on, ax_off, ax_cbar=None, cmap='magma')[source]
allensdk.brain_observatory.receptive_field_analysis.visualization.plot_receptive_field_data(rf, lsn, show=True, save_file_name=None, close=True, cmap='magma')[source]
allensdk.brain_observatory.receptive_field_analysis.visualization.plot_rts_blur_summary(rf_data, ax_on, ax_off, ax_cbar=None, cmap='magma')[source]
allensdk.brain_observatory.receptive_field_analysis.visualization.plot_rts_summary(rf_data, ax_on, ax_off, ax_cbar=None, cmap='magma')[source]
allensdk.brain_observatory.receptive_field_analysis.visualization.pvalue_to_NLL(p_values, max_NLL=10.0)[source]

Module contents