Hello,
I am displaying an image of integers, a so-called label map. Each integer
corresponds to a different class and should have its own color. It works
fine when the image does not change. However in my application, the label
map changes and new integer values are added. When this happens, the color
assigned to already existing integer values change. I want them to stay the
same.
What happens in practice: in current label map, '1' corresponds to blue.
When I add the new value '2' : '1' changes to red, and '2' adopts blue. I
want '1' to keep its initial color blue, and '2' to adopt a new color.
Any idea?
If it helps, here is how I create the lookuptable (I use a method found in
this group to convert from matplotlib):
colormap = matplotlib.cm.get_cmap('CMRmap')
colormap._init()
lut = (colormap._lut * 255).view(np.ndarray)
# edit alpha channel so that '0'->transparent
alpha = np.ones(lut.shape[0]) * 255
alpha[0] = 0
lut[:,3] = alpha
my_imageItem.setLookupTable(lut)
Best,
Manu
--
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/fb796c04-3b92-4f0e-97eb-767092e6b746%40googlegroups.com.