allensdk.internal.brain_observatory.itracker_utils module¶
-
allensdk.internal.brain_observatory.itracker_utils.
filter_bad_params
(params, frame_width, frame_height)[source]¶ Replace positions outside image with nan
-
allensdk.internal.brain_observatory.itracker_utils.
initial_cr_point
(image_array, bbox=None)[source]¶ bbox is a tuple of (xmin, xmax, ymin, ymax)
-
allensdk.internal.brain_observatory.itracker_utils.
initial_pupil_point
(image_array, bbox=None)[source]¶ bbox is a tuple of (xmin, xmax, ymin, ymax)
-
allensdk.internal.brain_observatory.itracker_utils.
medfilt_custom
(x, kernel_size=3)[source]¶ This median filter returns ‘nan’ whenever any value in the kernal width is ‘nan’ and the median otherwise
-
allensdk.internal.brain_observatory.itracker_utils.
median_absolute_deviation
(a, consistency_constant=1.4826)[source]¶ Calculate the median absolute deviation of a univariate dataset.
Parameters: - a : numpy.ndarray
Sample data.
- consistency_constant : float
Constant to make the MAD a consistent estimator of the population standard deviation (1.4826 for a normal distribution).
Returns: - float
Median absolute deviation of the data.
-
allensdk.internal.brain_observatory.itracker_utils.
post_process_cr
(cr_params)[source]¶ This will replace questionable values of the CR x and y position with ‘nan’
- threshold ellipse area by 99th percentile area distribution
- median filter using custom median filter
- remove deviations from discontinuous jumps
The ‘nan’ values likely represent obscured CRs, secondary reflections, merges with the secondary reflection, or visual distortions due to the whisker or deformations of the eye
-
allensdk.internal.brain_observatory.itracker_utils.
post_process_pupil
(pupil_params)[source]¶ Filter pupil parameters to replace outliers with nan
Parameters: - pupil_params : numpy.ndarray
(Nx5) array of pupil parameters [x, y, angle, axis1, axis2].
Returns: - numpy.ndarray
Pupil parameters with outliers replaced with nan