Skip to content

Commit 804934c

Browse files
committed
Read data into memory
1 parent 1aa3efd commit 804934c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/napari_matplotlib/histogram.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,21 @@ def draw(self) -> None:
3333
Clear the axes and histogram the currently selected layer/slice.
3434
"""
3535
layer = self.layers[0]
36+
print(layer.data.shape)
3637

3738
if layer.data.ndim - layer.rgb == 3:
3839
# 3D data, can be single channel or RGB
3940
data = layer.data[self.current_z]
4041
self.axes.set_title(f"z={self.current_z}")
4142
else:
4243
data = layer.data
44+
# Read data into memory if it's a dask array
45+
data = np.asarray(data)
4346

4447
# Important to calculate bins after slicing 3D data, to avoid reading
4548
# whole cube into memory.
4649
bins = np.linspace(np.min(data), np.max(data), 100)
50+
print(bins)
4751

4852
if layer.rgb:
4953
# Histogram RGB channels independently

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy