File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -6,14 +6,15 @@ build-backend = "setuptools.build_meta"
66write_to = " src/napari_matplotlib/_version.py"
77
88[tool .pytest .ini_options ]
9- qt_api = " pyqt6"
10- addopts = " --mpl --mpl-baseline-relative"
119filterwarnings = [
1210 " error" ,
11+ " ignore:(?s).*Pyarrow will become a required dependency of pandas" ,
1312 # Coming from vispy
1413 " ignore:distutils Version classes are deprecated:DeprecationWarning" ,
1514 " ignore:`np.bool8` is a deprecated alias for `np.bool_`:DeprecationWarning" ,
1615]
16+ qt_api = " pyqt6"
17+ addopts = " --mpl --mpl-baseline-relative"
1718
1819[tool .black ]
1920line-length = 79
Original file line number Diff line number Diff line change 44import numpy as np
55import numpy .typing as npt
66from matplotlib .container import BarContainer
7+ from napari .layers import Image
8+ from napari .layers ._multiscale_data import MultiScaleData
79from qtpy .QtWidgets import (
810 QComboBox ,
911 QLabel ,
@@ -68,14 +70,18 @@ def draw(self) -> None:
6870 """
6971 Clear the axes and histogram the currently selected layer/slice.
7072 """
71- layer = self .layers [0 ]
73+ layer : Image = self .layers [0 ]
74+ data = layer .data
7275
73- if layer .data .ndim - layer .rgb == 3 :
76+ if isinstance (layer .data , MultiScaleData ):
77+ data = data [layer .data_level ]
78+
79+ if layer .ndim - layer .rgb == 3 :
7480 # 3D data, can be single channel or RGB
75- data = layer .data [self .current_z ]
81+ # Slice in z dimension
82+ data = data [self .current_z ]
7683 self .axes .set_title (f"z={ self .current_z } " )
77- else :
78- data = layer .data
84+
7985 # Read data into memory if it's a dask array
8086 data = np .asarray (data )
8187
You can’t perform that action at this time.
0 commit comments