Detect range of the image using bottleneck if available

This commit is contained in:
Pietro Zambelli 2014-03-04 16:56:56 +00:00
parent 0045863165
commit dad5d8f733

View File

@ -33,6 +33,11 @@ from .. import debug as debug
from ..SignalProxy import SignalProxy
try:
from bottleneck import nanmin, nanmax
except ImportError:
from numpy import nanmin, nanmax
#try:
#from .. import metaarray as metaarray
#HAVE_METAARRAY = True
@ -526,7 +531,7 @@ class ImageView(QtGui.QWidget):
sl = [slice(None)] * data.ndim
sl[ax] = slice(None, None, 2)
data = data[sl]
return data.min(), data.max()
return nanmin(data), nanmax(data)
def normalize(self, image):
"""