Ignore NaN when checking data range in ImageView.
Merge remote-tracking branch 'zarch/bottleneck_range' into develop
This commit is contained in:
commit
c8f03e828e
@ -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):
|
||||
"""
|
||||
|
11
pyqtgraph/imageview/tests/test_imageview.py
Normal file
11
pyqtgraph/imageview/tests/test_imageview.py
Normal file
@ -0,0 +1,11 @@
|
||||
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()
|
Loading…
Reference in New Issue
Block a user