File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 11Changelog
22=========
3+ 1.0.2
4+ -----
5+ Bug fixes
6+ ~~~~~~~~~
7+ - A full dataset is no longer read into memory when using ``HistogramWidget ``.
8+ Only the current slice is loaded.
9+
10+ Changes
11+ ~~~~~~~
12+ - Histogram bin limits are now caclualted from the slice being histogrammed, and
13+ not the whole dataset. This is as a result of the above bug fix.
314
4151.0.1
516-----
Original file line number Diff line number Diff line change @@ -33,14 +33,19 @@ def draw(self) -> None:
3333 Clear the axes and histogram the currently selected layer/slice.
3434 """
3535 layer = self .layers [0 ]
36- bins = np .linspace (np .min (layer .data ), np .max (layer .data ), 100 )
3736
3837 if layer .data .ndim - layer .rgb == 3 :
3938 # 3D data, can be single channel or RGB
4039 data = layer .data [self .current_z ]
4140 self .axes .set_title (f"z={ self .current_z } " )
4241 else :
4342 data = layer .data
43+ # Read data into memory if it's a dask array
44+ data = np .asarray (data )
45+
46+ # Important to calculate bins after slicing 3D data, to avoid reading
47+ # whole cube into memory.
48+ bins = np .linspace (np .min (data ), np .max (data ), 100 )
4449
4550 if layer .rgb :
4651 # Histogram RGB channels independently
You can’t perform that action at this time.
0 commit comments