Skip to content

Commit

Permalink
updated dimensions order in poses_to_napari_tracks conversion function
Browse files Browse the repository at this point in the history
  • Loading branch information
niksirbi committed Dec 18, 2024
1 parent b8a390d commit 5d5e5ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion movement/napari/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5d5e5ed

Please sign in to comment.