Commit c8f03e82 authored by Luke Campagnola's avatar Luke Campagnola
Browse files

Ignore NaN when checking data range in ImageView.

Merge remote-tracking branch 'zarch/bottleneck_range' into develop
parents 8eb85d97 dad5d8f7
......@@ -66,6 +66,7 @@ pyqtgraph-0.9.9 [unreleased]
- Fixed unicode support in Dock
- Fixed PySide crash caused by emitting signal from GraphicsObject.itemChange
- Fixed possible infinite loop from FiniteCache
- Allow images with NaN in ImageView
pyqtgraph-0.9.8 2013-11-24
......
......@@ -28,6 +28,7 @@ Contributors
* Thomas S.
* Fabio Zadrozny
* Mikhail Terekhov
* Pietro Zambelli
Requirements
------------
......
......@@ -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):
"""
......
import pyqtgraph as pg
import numpy as np
app = pg.mkQApp()
def test_nan_image():
img = np.ones((10,10))
img[0,0] = np.nan
v = pg.image(img)
app.processEvents()
v.window().close()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment