Skip to content

Commit 040b614

Browse files
committed
Changed hard-coded slice 9 to z-dimension - 1
1 parent d90990b commit 040b614

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/napari_matplotlib/scatter.py

-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import napari
44
import numpy.typing as npt
5-
from numpy import array
65
from qtpy.QtWidgets import QComboBox, QLabel, QVBoxLayout, QWidget
76

87
from .base import NapariMPLWidget
@@ -94,8 +93,6 @@ def _get_data(self) -> Tuple[npt.NDArray[Any], npt.NDArray[Any], str, str]:
9493
"""
9594
x = self.layers[0].data[self.current_z]
9695
y = self.layers[1].data[self.current_z]
97-
print("x data size = ", array(x).shape)
98-
print("y data size = ", array(y).shape)
9996
x_axis_name = self.layers[0].name
10097
y_axis_name = self.layers[1].name
10198

src/napari_matplotlib/tests/scatter/test_scatter.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from copy import deepcopy
22

33
import pytest
4+
from numpy import array
45

56
from napari_matplotlib import ScatterWidget
67

@@ -40,7 +41,7 @@ def test_scatter_3D(make_napari_viewer, brain_data):
4041
viewer.layers.selection.clear()
4142
# pdb.set_trace()
4243
axis = viewer.dims.last_used
43-
slice_no = 9
44+
slice_no = array(brain_data[0]).shape[0] - 1
4445
viewer.dims.set_current_step(axis, slice_no)
4546
# Select images
4647
viewer.layers.selection.add(viewer.layers[0])

src/napari_matplotlib/tests/test_histogram.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from copy import deepcopy
22

33
import pytest
4+
from numpy import array
45

56
from napari_matplotlib import HistogramWidget
67
from napari_matplotlib.tests.helpers import (
@@ -24,7 +25,7 @@ def test_histogram_3D(make_napari_viewer, brain_data):
2425
viewer = make_napari_viewer()
2526
viewer.add_image(brain_data[0], **brain_data[1])
2627
axis = viewer.dims.last_used
27-
slice_no = 9
28+
slice_no = array(brain_data[0]).shape[0] - 1
2829
viewer.dims.set_current_step(axis, slice_no)
2930
fig = HistogramWidget(viewer).figure
3031
# Need to return a copy, as original figure is too eagerley garbage

src/napari_matplotlib/tests/test_slice.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from copy import deepcopy
22

33
import pytest
4+
from numpy import array
45

56
from napari_matplotlib import SliceWidget
67

@@ -10,7 +11,7 @@ def test_slice_3D(make_napari_viewer, brain_data):
1011
viewer = make_napari_viewer()
1112
viewer.add_image(brain_data[0], **brain_data[1])
1213
axis = viewer.dims.last_used
13-
slice_no = 9
14+
slice_no = array(brain_data[0]).shape[0] - 1
1415
viewer.dims.set_current_step(axis, slice_no)
1516
fig = SliceWidget(viewer).figure
1617
# Need to return a copy, as original figure is too eagerley garbage

0 commit comments

Comments
 (0)