Commit 80b2ef31 authored by lucas_miranda's avatar lucas_miranda
Browse files

Added digging to the list of detected behaviours by

parent b35abc02
......@@ -180,8 +180,7 @@ def huddle(
tol_speed: float,
animal_id: str = "",
) -> np.array:
"""Returns true when the mouse is huddling using simple rules. (!!!) Designed to
work with deepof's default DLC mice models; not guaranteed to work otherwise.
"""Returns true when the mouse is huddling using simple rules.
- pos_dframe (pandas.DataFrame): position of body parts over time
......@@ -220,15 +219,37 @@ def huddle(
def dig(
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 = "",
"""Returns true when the mouse is digging using simple rules.
- 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).
dig (np.array): True if the animal is digging, 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"]
likelihood = likelihood_dframe[animal_id + "Nose"] < tol_likelihood
dig = speed & nose_speed & likelihood
return dig
def sniff(
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