deepof.utils module
Functions and general utilities for the deepof package. |
|
|
Remove rotational variance on the trajectories. |
|
Return a numpy.ndarray with the angles between the provided instances. |
Return x,y position of the center, the lengths of the major and minor axes, and the angle of the recognised arena. |
|
Return numpy.ndarray with information about the arena recognised from the first frames of the video. |
|
Return the DataFrame in polar coordinates. |
|
|
Return a pandas.DataFrame with the scaled distances between all pairs of body parts. |
|
Find the closest side in other polygons to a reference side in the first polygon. |
Compute the transition matrix between clusters and the autocorrelation in the sequence. |
|
Compute a mask of the animal presence in the video. |
|
|
Compute relevant areas (head, torso, back, full) for the provided coordinates. |
|
Return a pandas.DataFrame with the scaled distances between a pair of body parts. |
|
Create a nx.Graph object with the connectivity of the bodyparts in the DLC topview model for a single mouse. |
|
Convert an edge feature matrix to a weighted adjacency matrix. |
Enumerate all 3-node connected sequences in the given graph. |
|
Read a random frame from the selected video, and opens an interactive GUI to let the user delineate the arena manually. |
|
|
Given a set of TableDict columns, returns those that correspond to a given animal, specified in selected_id. |
|
Filter out cluster assignment bouts shorter than min_bout_duration. |
|
Fit an ellipse to the provided polygon. |
|
Iterate over all body parts of experiment, and outputs a dataframe where all x, y positions are replaced by a boolean mask, where True indicates an outlier. |
|
Extract arena parameters from a project or coordinates object. |
|
Fit a Gaussian Mixture Model to the provided data and returns evaluation metrics. |
|
Run GMM clustering model selection on the specified X dataframe. |
|
Mark all outliers in experiment and replaces them using a uni-variate linear interpolation approach. |
|
Perform iterative imputation on occluded body parts. |
|
Apply Kleinberg's algorithm (described in 'Bursty and Hierarchical Structure in Streams'). |
|
Loads a table into a structured pandas data frame. |
|
Return a mask over the bivariate trajectory of a body part, identifying as True all detected outliers. |
|
Fast implementation of a moving average function. |
|
Renames all body parts in the provided dataframe. |
Open a window and waits for the user to click on all corners of the polygonal arena. |
|
|
Return the average speed over n frames in pixels per frame. |
|
Return a 3D numpy.array with a sliding-window extra dimension. |
|
Return a 2D numpy.ndarray with the initial values rotated by angles radians. |
|
Apply the rupture method independently to each experiment, and concatenate into a single dataset at the end. |
|
Scales features in the provided array. |
|
Scales features in a table controlling for both individual body size and interanimal variability. |
|
Set the coordinates of the missing animals to NaN. |
|
Simplify a polygon using the Ramer-Douglas-Peucker algorithm. |
|
Return a boolean array in which isolated appearances of a feature are smoothed. |
Return a smoothed a trajectory using a Savitzky-Golay 1D filter. |
|
Split a numpy.ndarray at the given breakpoints. |
|
Return the passed string as a boolean. |
|
|
Return a pandas.DataFrame in which all the coordinates are polar. |