Skip to content

Commit

Permalink
Fix dimension indexing in SWCEditorWidget to support variable dimensi…
Browse files Browse the repository at this point in the history
…onality
  • Loading branch information
ClementCaporal committed Jan 20, 2025
1 parent 762370d commit 138b8c4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/napari_swc_editor/_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,10 @@ def _table_clicked(self, event):
current_step = list(viewer.dims.current_step)
current_step[-1] = row
viewer.dims.current_step = current_step
current_step[0] = int(z)
current_step[1] = int(y)
current_step[2] = int(x)
# use negative index to get the order of the dimensions even if len(ndims) > 3
current_step[-3] = int(z)
current_step[-2] = int(y)
current_step[-1] = int(x)

viewer.dims.point = current_step

Expand Down

0 comments on commit 138b8c4

Please sign in to comment.