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_A(*args, **kwargs)[source]
allensdk.brain_observatory.receptive_field_analysis.utilities.get_A_blur(*args, **kwargs)[source]
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]