Hi all,
I am a beginner, so I hope not to post too trivial question, but I am trying to understand how to do the following: assume I have defined two ROIs and I set the event to print "Hi" when I finish to move a ROI.
I am able to print "Hi" when I move ANY of the two ROIs, but how can recognize WHICH ROI I moved? Like printing "Hi I moved ROI N. 1" or "Hi I moved ROI N. 2" ?
Here a simple code to explain better my question:
import pyqtgraph as pg
app = pg.mkQApp("Examples")
win = pg.GraphicsLayoutWidget(show=True, size=(800,800), border=True)
win.setWindowTitle('ROI Example')
plot = win.addPlot()
plot.setXRange(0,10)
plot.setYRange(0,10)
rois=[]
rois.append(pg.ROI(pos=[3,5],size=[1,1]))
rois.append(pg.ROI(pos=[7,5],size=[1,1]))
for roi in rois:
plot.addItem(roi)
roi.sigRegionChangeFinished.connect(lambda: print('Hi'))
pg.exec()
Thanks in advance for any help
Salvatore