self.plot = pg.ImageView(view=self.view)
self.plot.setImage(nanToZerosImg,autoRange=True,autoLevels=False, levels=( np.nanmin(img), np.nanmax(img) )
the scale of all images stuck between 0-1
only the option:
self.plot.setLevels(np.nanmin(img), np.nanmax(img))
gives the right scale but doesn't move the colorbar on the right to it.
what can i do
* to use the levels-keyword in setImage
* to move the colorbar to the right scale
thanks a lot,
karl
my imagedata contains some nan-values. therefore i transform those values to 0. because the other data are far aboth 0 'autoLevel' doesn't show the right scale.when i do:self.view=pg.PlotItem(...)self.plot = pg.ImageView(view=self.view)
self.plot.setImage(nanToZerosImg,autoRange=True,autoLevels=False, levels=( np.nanmin(img), np.nanmax(img) )
the scale of all images stuck between 0-1
only the option:
self.plot.setLevels(np.nanmin(img), np.nanmax(img))
import pyqtgraph as pgpg.mkQApp()import numpy as npimg = np.random.normal(size=(100, 100), loc=100)img[img<98] = 0view = pg.ImageView()view.show()view.setImage(img)view.setLevels(97, 103)
--
-- [ You are subscribed to pyqt...@googlegroups.com. To unsubscribe, send email to pyqtgraph+...@googlegroups.com ]
---
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+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
hey luke,sorry for my late response. i tried to to the problem by my own but i failed.of course: setLevels() works. but the HistogramLUTWidget wont be updated.your given example didn't work for me, so i used example/imageView.i wrote imv.setLevels(106,108) right after imv.setImage and the same problem appeared.i attached an image of this.as you see the boundaries of the histogramm remain at the initial state.
Hey Luke,I'm trying to replicate this result of setLevels() with an image object. In the API it says that it is merely a window that wraps a ImageView into it. Unfortunately I can't find a way to access that object. How would you access the ImageView object so that you can call setLevels?