deepof.utils.mouse_in_roi

deepof.utils.mouse_in_roi(tab, aid, in_roi_criterion, roi_polygon, run_numba=False)

Checks if a given animal for a given table is in a given roi by given criterion.

Parameters:
  • tab (dataTable) – Datatable containing mouse tracking data.

  • aid (str) – ainimal id of the mouse to check

  • in_roi_criterion (str) – Criterion for in roi check, can be a single bodypart, a list of bodyparts or “all” bodyparts of a mouse

  • roi_polygon (np.ndarray) – 2D numpy array containing the coordinats of the ROI

  • run_numba (bool) – Determines if numba versions of functions should be used (run faster but require initial compilation time on first run)

Returns:

A boolean array indicating whether the mouse is inside the ROI.

Return type:

mouse_in_polygon (np.ndarray)