Hi All,
I have a greylevel image and a binary mask.
I would like to display the binary mask (img2 below) as overlay to the greylevel image but with a specific color for the binary mask (let's say red)
import pyqtgraph as pg
import numpy as np
from pyqtgraph.Qt import QtCore, QtGui
pg.setConfigOptions(imageAxisOrder='row-major')
app = QtGui.QApplication([])
win = pg.GraphicsWindow()
vb = win.addViewBox()
img1 = pg.ImageItem(pg.np.random.normal(size=(100, 100)))
img2 = np.zeros_like(img1, dtype='uint8')
img2[40:60, 40:60] = 255
vb.addItem(img1)
vb.addItem(img2)
img2.setZValue(10)
img2.setOpacity(0.5)
img2.scale(10,10)
win.show()
QtGui.QApplication.instance().exec_()
I have looked for a solution on the net for 3 days wi th no success: the only color stuff is about colormaps but I may be wrong but this is not what I am lookign for.
Your help would be appreciated