File tree 1 file changed +2
-7
lines changed
1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -136,12 +136,7 @@ def autoset_widget_bins(self, data: npt.NDArray[Any]) -> None:
136
136
"""Update widgets with bins determined from the image data"""
137
137
if data .dtype .kind in {"i" , "u" }:
138
138
# Make sure integer data types have integer sized bins
139
- # We can't use unsigned ints when calculating the step, otherwise
140
- # the following warning is raised:
141
- # 'RuntimeWarning: overflow encountered in scalar subtract'
142
- step = abs (
143
- np .min (data ).astype (int ) - np .max (data ).astype (int ) // 100
144
- )
139
+ step = abs (np .max (data ) - np .min (data )) // 100
145
140
step = max (1 , step )
146
141
bins = np .arange (np .min (data ), np .max (data ) + step , step )
147
142
else :
@@ -213,7 +208,7 @@ def draw(self) -> None:
213
208
# whole cube into memory.
214
209
if data .dtype .kind in {"i" , "u" }:
215
210
# Make sure integer data types have integer sized bins
216
- step = abs (( self .bins_start - self .bins_stop ) // self .bins_num )
211
+ step = abs (self .bins_stop - self .bins_start ) // self .bins_num
217
212
step = max (1 , step )
218
213
bins = np .arange (self .bins_start , self .bins_stop + step , step )
219
214
else :
You can’t perform that action at this time.
0 commit comments