From c56026bfed316d00085fc69237294fca331c5afa Mon Sep 17 00:00:00 2001 From: niksirbi Date: Mon, 16 Dec 2024 18:39:10 +0000 Subject: [PATCH] updated dimensions order in poses_to_napari_tracks conversion function --- movement/napari/convert.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/movement/napari/convert.py b/movement/napari/convert.py index 890161be..7f910c8c 100644 --- a/movement/napari/convert.py +++ b/movement/napari/convert.py @@ -58,7 +58,7 @@ def poses_to_napari_tracks(ds: xr.Dataset) -> tuple[np.ndarray, pd.DataFrame]: n_tracks = n_individuals * n_keypoints # Construct the napari Tracks array # Reorder axes to (individuals, keypoints, frames, xy) - yx_cols = np.transpose(ds.position.values, (1, 2, 0, 3)).reshape(-1, 2)[ + yx_cols = np.transpose(ds.position.values, (3, 2, 0, 1)).reshape(-1, 2)[ :, [1, 0] # swap x and y columns ] # Each keypoint of each individual is a separate track