mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-12 12:30:16 +08:00
ENH: Set viewer min-intensity to zero when possible.
Some image dtypes allow negative values, but these are typically not used. If an dtype allows negative values, but no negative values are present in the image, set the minimum value to 0 so that the image doesn't look washed out.
This commit is contained in:
@@ -144,6 +144,8 @@ class ImageViewer(QMainWindow):
|
||||
self._img = image
|
||||
self._image_plot.set_array(image)
|
||||
clim = dtype_range[image.dtype.type]
|
||||
if clim[0] < 0 and image.min() >= 0:
|
||||
clim = (0, clim[1])
|
||||
self._image_plot.set_clim(clim)
|
||||
self.redraw()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user