I have an image that contains NaNs (indicates invalid pixels). Imageitem appears to handle the NaN but histogramLUTitem does not.
My view is as follows. self.img1 = pg.ImageItem(border='w') self.lut1 = pg.HistogramLUTItem(self.img1) self.view1.addItem(self.img1) histogram fails at File "C:\Anaconda2\Lib\site-packages\pyqtgraph\graphicsItems\ImageItem.py", line 262, in setImage self.sigImageChanged.emit() File "C:\Anaconda2\Lib\site-packages\pyqtgraph\graphicsItems\HistogramLUTItem.py", line 189, in imageChanged h = self.imageItem().getHistogram() File "C:\Anaconda2\Lib\site-packages\pyqtgraph\graphicsItems\ImageItem.py", line 368, in getHistogram hist = np.histogram(stepData, **kwds) File "C:\Anaconda2\Lib\site-packages\numpy\lib\function_base.py", line 507, in histogram 'range parameter must be finite.') besides fixing numpy histogram in function_base.py to handle NaNs it might make sense to change ImageItem.py line 368 from * hist = np.histogram(stepData, **kwds)* to * ind = np.isfinite(stepData)* * hist = np.histogram(stepData[ind], **kwds)* -- You received this message because you are subscribed to the Google Groups "pyqtgraph" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/785ec374-8773-46db-adba-2b6c9df205a0%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
