Skip to content

Commit ffa22d6

Browse files
committed
Fix insertion of extra coordinates in shape data
Adjusts the axis parameter in np.insert to insert extra coordinates at the correct position for higher-dimensional shapes, ensuring proper shape data construction.
1 parent 5e31241 commit ffa22d6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

napari_crop/_function.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,8 @@ def draw_fixed_shapes(
278278
# Insert extra coordinates for higher dimensions
279279
# For example, if the shape is 3D, we need to add the z-coordinates
280280
extra_coords = np.take(coord, indices=dims_order[:-2], axis=0)
281-
for i, ec in enumerate(extra_coords):
282-
shape_data = np.insert(shape_data, 0, round(ec), axis=-1)
281+
for ec in extra_coords:
282+
shape_data = np.insert(shape_data, -2, round(ec), axis=-1)
283283
shape_data = shape_data[:, np.argsort(dims_order)]
284284
shapes_data.append(shape_data)
285285

0 commit comments

Comments
 (0)