ds_to_napari_tracks#
- movement.napari.convert.ds_to_napari_tracks(ds)[source]#
Convert
movement
dataset to napari Tracks array and properties.- Parameters:
ds (xr.Dataset) –
movement
dataset containing pose or bounding box tracks, confidence scores, and associated metadata.- Return type:
tuple
[ndarray
,DataFrame
]- Returns:
data (np.ndarray) – napari Tracks array with shape (N, 4), where N is n_keypoints * n_individuals * n_frames and the 4 columns are (track_id, frame_idx, y, x).
properties (pd.DataFrame) – DataFrame with properties (individual, keypoint, time, confidence).
Notes
A corresponding napari Points array can be derived from the Tracks array by taking its last 3 columns: (frame_idx, y, x). See the documentation on the napari Tracks [1] and Points [2] layers.
References