wormpose.pose.centerline¶
This module contains function related to the worm centerline, for example to convert skeleton (x, y) coordinates to angles, flip the head-tail orientation etc
- wormpose.pose.centerline.calculate_skeleton(theta: numpy.ndarray, worm_length: float, canvas_width_height: Tuple[int, int] = (0, 0), out: Optional[numpy.ndarray] = None) numpy.ndarray [source]¶
Calculates (x,y) coordinates of the worm centerline from the tangent angle (theta) vector
- Parameters
theta – centerline angles
worm_length – desired worm length
out – optional numpy array of shape (len(theta), 2) to store the resulting skeleton
canvas_width_height – optional canvas to recenter the skeleton coordinates in the middle
- Returns
output skeleton: numpy array of shape (len(theta), 2) representing the centerline angles
- wormpose.pose.centerline.flip_theta(theta: numpy.ndarray) numpy.ndarray [source]¶
head-tail flip for one value