Thank you so much for your helpful discussion! I'm also a new guy to pyqtgraph and trying to find a way to get binary ROI, but when I ran the attached testROI.py, an error occurs:
'''
Traceback (most recent call last):
File "testROI.py", line 37, in <module>
mpossx = roi.getArrayRegion(possx,imgview).astype(int)
File "D:\Program\Miniconda3\envs\bs\lib\site-packages\pyqtgraph\graphicsItems\ROI.py", line 2027, in getArrayRegion
sliced = ROI.getArrayRegion(self, data, img, axes=axes, fromBoundingRect=True, **kwds)
File "D:\Program\Miniconda3\envs\bs\lib\site-packages\pyqtgraph\graphicsItems\ROI.py", line 1104, in getArrayRegion
shape, vectors, origin = self.getAffineSliceParams(data, img, axes, fromBoundingRect=fromBR)
File "D:\Program\Miniconda3\envs\bs\lib\site-packages\pyqtgraph\graphicsItems\ROI.py", line 1129, in getAffineSliceParams
raise Exception("ROI and target item must be members of the same scene.")
Exception: ROI and target item must be members of the same scene.
'''
I guess it is because the function 'ROI.getArrayRegion' has been changed/updated over the years. But as a newbie, I don't quite understand how to fix it ... Could you please give me some suggestions? Thank you very much!!
Best,
Xingyu
在 2015年5月18日星期一 UTC+8下午11:50:20,Julien Lhermitte写道: