Skip to content

3D scatter test #152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 2, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Changed hard-coded slice 9 to z-dimension - 1
  • Loading branch information
ruaridhg committed Jun 2, 2023
commit 040b614906b53e8bcc0f6132bddde7e63a08f311
3 changes: 0 additions & 3 deletions src/napari_matplotlib/scatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import napari
import numpy.typing as npt
from numpy import array
from qtpy.QtWidgets import QComboBox, QLabel, QVBoxLayout, QWidget

from .base import NapariMPLWidget
Expand Down Expand Up @@ -94,8 +93,6 @@ def _get_data(self) -> Tuple[npt.NDArray[Any], npt.NDArray[Any], str, str]:
"""
x = self.layers[0].data[self.current_z]
y = self.layers[1].data[self.current_z]
print("x data size = ", array(x).shape)
print("y data size = ", array(y).shape)
x_axis_name = self.layers[0].name
y_axis_name = self.layers[1].name

Expand Down
3 changes: 2 additions & 1 deletion src/napari_matplotlib/tests/scatter/test_scatter.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from copy import deepcopy

import pytest
from numpy import array

from napari_matplotlib import ScatterWidget

Expand Down Expand Up @@ -40,7 +41,7 @@ def test_scatter_3D(make_napari_viewer, brain_data):
viewer.layers.selection.clear()
# pdb.set_trace()
axis = viewer.dims.last_used
slice_no = 9
slice_no = array(brain_data[0]).shape[0] - 1
viewer.dims.set_current_step(axis, slice_no)
# Select images
viewer.layers.selection.add(viewer.layers[0])
Expand Down
3 changes: 2 additions & 1 deletion src/napari_matplotlib/tests/test_histogram.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from copy import deepcopy

import pytest
from numpy import array

from napari_matplotlib import HistogramWidget
from napari_matplotlib.tests.helpers import (
Expand All @@ -24,7 +25,7 @@ def test_histogram_3D(make_napari_viewer, brain_data):
viewer = make_napari_viewer()
viewer.add_image(brain_data[0], **brain_data[1])
axis = viewer.dims.last_used
slice_no = 9
slice_no = array(brain_data[0]).shape[0] - 1
viewer.dims.set_current_step(axis, slice_no)
fig = HistogramWidget(viewer).figure
# Need to return a copy, as original figure is too eagerley garbage
Expand Down
3 changes: 2 additions & 1 deletion src/napari_matplotlib/tests/test_slice.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from copy import deepcopy

import pytest
from numpy import array

from napari_matplotlib import SliceWidget

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