Commit b691903a authored by lucas_miranda's avatar lucas_miranda
Browse files

Added looking around as a tag for single mice

parent 34c8e962
......@@ -231,8 +231,6 @@ def dig(
- speed_dframe (pandas.DataFrame): speed of body parts over time
- likelihood_dframe (pandas.DataFrame): likelihood of body part tracker over time,
as directly obtained from DeepLabCut
- tol_nose_speed (float): Maximum tolerated average distance between spine
body parts
- tol_speed (float): Maximum tolerated speed for the center of the mouse
- tol_likelihood (float): Maximum tolerated likelihood for the nose (if the animal
is digging, the nose is momentarily occluded).
......@@ -251,28 +249,37 @@ def dig(
return digging
def sniff(
pos_dframe: pd.DataFrame,
def look_around(
speed_dframe: pd.DataFrame,
likelihood_dframe: pd.DataFrame,
tol_nose_speed: float,
tol_speed: float,
tol_likelihood: float,
animal_id: str = "",
):
pass
"""Returns true when the mouse is digging using simple rules.
Parameters:
- speed_dframe (pandas.DataFrame): speed of body parts over time
- likelihood_dframe (pandas.DataFrame): likelihood of body part tracker over time,
as directly obtained from DeepLabCut
- tol_speed (float): Maximum tolerated speed for the center of the mouse
- tol_likelihood (float): Maximum tolerated likelihood for the nose (if the animal
is digging, the nose is momentarily occluded).
def look_around(
pos_dframe: pd.DataFrame,
speed_dframe: pd.DataFrame,
likelihood_dframe: pd.DataFrame,
tol_nose_speed: float,
tol_speed: float,
tol_likelihood: float,
animal_id: str = "",
):
pass
Returns:
lookaround (np.array): True if the animal is standing still and looking around, False otherwise
"""
if animal_id != "":
animal_id += "_"
speed = speed_dframe[animal_id + "Center"] < tol_speed
nose_speed = speed_dframe[animal_id + "Center"] < speed_dframe[animal_id + "Nose"]
nose_likelihood = likelihood_dframe[animal_id + "Nose"] > tol_likelihood
lookaround = speed & nose_likelihood & nose_speed
return lookaround
def following_path(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment