Fix incorrect use of dims_order when 3D painting
Dims order contains the displayed dimensions, but on the data the axes
remain in sorted order. With this commit, the data order is maintaned
correctly when painting and filling.
@@ -1059,7 +1059,7 @@ class Labels(_ImageBase):
):
return
- dims_to_fill = self._dims_order[-self.n_edit_dimensions :]
+ dims_to_fill = sorted(self._dims_order[-self.n_edit_dimensions :])
data_slice_list = list(int_coord)
for dim in dims_to_fill:
data_slice_list[dim] = slice(None)
@@ -1118,8 +1118,8 @@ class Labels(_ImageBase):
calls.
"""
shape = self.data.shape
- dims_to_paint = self._dims_order[-self.n_edit_dimensions :]
- dims_not_painted = self._dims_order[: -self.n_edit_dimensions]
+ dims_to_paint = sorted(self._dims_order[-self.n_edit_dimensions :])
+ dims_not_painted = sorted(self._dims_order[: -self.n_edit_dimensions])
paint_scale = np.array(
[self.scale[i] for i in dims_to_paint], dtype=float
)
