Merge pull request #267 from tonysyu/viewer-adapt-dtype

BUG: Adjust pixel limits based on image data type.
This commit is contained in:
Stefan van der Walt
2012-08-25 07:14:55 -07:00
+3
View File
@@ -5,6 +5,7 @@ import sys
from PyQt4 import QtGui, QtCore
from skimage.util.dtype import dtype_range
from ..utils import figimage, MatplotlibCanvas
@@ -139,6 +140,8 @@ class ImageViewer(QtGui.QMainWindow):
def image(self, image):
self._img = image
self._image_plot.set_array(image)
clim = dtype_range[image.dtype.type]
self._image_plot.set_clim(clim)
self.redraw()
def reset_image(self):