ROI maxBounds question

35 views
Skip to first unread message

kyle.p...@gmail.com

unread,
Mar 28, 2018, 4:57:37 PM3/28/18
to pyqtgraph

I've discovered two unexpected behaviors when using the maxBounds argument with pyqtgraph ROIs:

1) The position of the line segment ROI does not appear to be constrained by maxBounds, regardless of which dimensions I choose for the maxBounds QRectF values:

line = pg.LineSegmentROI([[20,20], [80,80]], pen='r', movable=False, maxBounds=QtCore.QRectF(0, 0, 100, 100))

In this case, I am able to move the line segment handles anywhere I please.

2) The area constrained by other ROIs does not take their rotation angle into account. With the following ROI:

rect = pg.RectROI([50, 50], [20, 30], pen='r', movable=True, maxBounds=QtCore.QRectF(0, 0, 100, 100))
rect.addRotateHandle([0,1], [0.5, 0.5])

I am not able to move the rect ROI outside of the are defined by maxBounds (with rect.angle() = 0), however, if I rotate the ROI, portions of the rectangle will exceed the area defined by maxBounds. It appears as though the area defined by the handles is constrained (rect.pos(), rect.size()), however, the angle is not taken into consideration (rect.angle()), resulting in the rect ROI moving beyond the maxBounds region.

I am using the most recent version of pyqtgraph: 0.10.0+g53a3087

Am I perhaps interpreting the maxBounds limits incorrectly?

Thanks in advance for your help.

Luka Drmic

unread,
Dec 21, 2018, 4:12:13 AM12/21/18
to pyqtgraph
Any ideas how to deal with number 1 ?
Reply all
Reply to author
Forward
0 new messages