deepof.post_hoc.align_deepof_kinematics_with_unsupervised_labels

deepof.post_hoc.align_deepof_kinematics_with_unsupervised_labels(deepof_project: deepof_coordinates, kin_derivative: int = 1, center: str = 'Center', align: str = 'Spine_1', include_feature_derivatives: bool = False, include_distances: bool = True, include_angles: bool = True, include_areas: bool = True, animal_id: str | None = None)

Align kinematics with unsupervised labels.

In order to annotate time chunks with as many relevant features as possible, this function aligns the kinematics of a deepof project (speed and acceleration of body parts, distances, and angles) with the hard cluster assignments obtained from the unsupervised pipeline.

Parameters:
  • deepof_project (coordinates) – A deepof.Project object.

  • kin_derivative (int) – The order of the derivative to use for the kinematics. 1 = speed, 2 = acceleration, etc.

  • center (str) – Body part to center coordinates on. “Center” by default.

  • align (str) – Body part to rotationally align the body parts with. “Spine_1” by default.

  • include_feature_derivatives (bool) – Whether to compute speed on distances, angles, and areas, if they are included.

  • include_distances (bool) – Whether to include distances in the alignment.

  • include_angles (bool) – Whether to include angles in the alignment.

  • include_areas (bool) – Whether to include areas in the alignment.

  • animal_id (str) – The animal ID to use, in case of multi-animal projects.

Returns:

A dictionary of aligned kinematics, where the keys are the names of the experimental conditions, and the values are the aligned kinematics for each condition.