After creating a PolyLineROI.getArrayRegion() works just fine, but PolyLine.getArrayRegion() returns the worng array after a translation or scaling, which is the unscaled and untranslated array.
Is there a good solution to fix this?
At the moment, I ended up overwriting getArrayRegion() and getLocalHandlePositions() and run into some trouble with it.
To get the size and position of a PolyLineROI I use:
import pyqtgraph as pg
freeform = pg.PolyLineROI([[000, 100], [050, 150], [200, 100], [200, 400], [100, 100], [000, 400]])
Size = pg.Point(freeform.boundingRect().size())
Pos = pg.Point(freeform.boundingRect().topLeft())
# freeform.pos() returns pg.Point(0, 0)
# freeform.size() returns pg.Point(1,1)
to get the position and size of the bounding Rectangle for other ROIs this works like this:
rect = pg.RectROI([000, 100], [200, 300])
Size = rect.size()
Pos = rect.pos()
Why is this realized like this? Wouldn't it be reasonable to eigther:
1. overwrite PolyLineROI.size() and PolyLineROI.pos() (check below)
or
2. to set PolyLineROI.state['pos'] and PolyLine.state['size'] to the values of the bounding rectangle and use relative positions (between 0.0 and 1.0) for the handles' postions
for the sake of consitency?
I would prefer the second solution. Wouldn't that solve the upper issue too?