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)

histogram fails at
File "C:\Anaconda2\Lib\site-packages\pyqtgraph\graphicsItems\ImageItem.py", 
line 262, in setImage
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)*
*        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 pyqtgraph+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
For more options, visit https://groups.google.com/d/optout.

Reply via email to