File tree 2 files changed +14
-7
lines changed
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"
6
6
write_to = " src/napari_matplotlib/_version.py"
7
7
8
8
[tool .pytest .ini_options ]
9
- qt_api = " pyqt6"
10
- addopts = " --mpl --mpl-baseline-relative"
11
9
filterwarnings = [
12
10
" error" ,
11
+ " ignore:(?s).*Pyarrow will become a required dependency of pandas" ,
13
12
# Coming from vispy
14
13
" ignore:distutils Version classes are deprecated:DeprecationWarning" ,
15
14
" ignore:`np.bool8` is a deprecated alias for `np.bool_`:DeprecationWarning" ,
16
15
]
16
+ qt_api = " pyqt6"
17
+ addopts = " --mpl --mpl-baseline-relative"
17
18
18
19
[tool .black ]
19
20
line-length = 79
Original file line number Diff line number Diff line change 4
4
import numpy as np
5
5
import numpy .typing as npt
6
6
from matplotlib .container import BarContainer
7
+ from napari .layers import Image
8
+ from napari .layers ._multiscale_data import MultiScaleData
7
9
from qtpy .QtWidgets import (
8
10
QComboBox ,
9
11
QLabel ,
@@ -68,14 +70,18 @@ def draw(self) -> None:
68
70
"""
69
71
Clear the axes and histogram the currently selected layer/slice.
70
72
"""
71
- layer = self .layers [0 ]
73
+ layer : Image = self .layers [0 ]
74
+ data = layer .data
72
75
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 :
74
80
# 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 ]
76
83
self .axes .set_title (f"z={ self .current_z } " )
77
- else :
78
- data = layer .data
84
+
79
85
# Read data into memory if it's a dask array
80
86
data = np .asarray (data )
81
87
You can’t perform that action at this time.
0 commit comments