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]

Fit a 2D gaussian to an image

Parameters:
data : np.ndarray

input image

Returns:
p2 : list

height row mean column mean row standard deviation column standard deviation rotation

Notes

see gaussian2D for details about output values

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

Build a function which evaluates a scaled 2d gaussian pdf

Parameters:
height : float

scale factor

center_x : float

first coordinate of mean

center_y : float

second coordinate of mean

width_x : float

standard deviation along x axis

width_y : float

standard deviation along y axis

rotation : float

degrees clockwise by which to rotate the gaussian

Returns:
rotgauss: fn

parameters are x and y positions (row/column semantics are set by your inputs to this function). Return value is the scaled gaussian pdf evaluated at the argued point.

allensdk.brain_observatory.receptive_field_analysis.fitgaussian2D.moments2(data)[source]

Treating input image data as an independent multivariate gaussian, estimate mean and standard deviations

Parameters:
data : np.ndarray

2d numpy array.

Returns:
height : float

The maximum observed value in the data

y : float

Mean row index

x : float

Mean column index

width_y : float

The standard deviation along the mean row

width_x : float

The standard deviation along the mean column

None :

This function returns an instance of None.

Notes

uses original method from website for finding center