Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stateChanged is not being called when moving PolyLineROI #53

Open
TammeWollweber opened this issue Apr 6, 2020 · 1 comment
Open

stateChanged is not being called when moving PolyLineROI #53

TammeWollweber opened this issue Apr 6, 2020 · 1 comment

Comments

@TammeWollweber
Copy link

TammeWollweber commented Apr 6, 2020

I tried to print the new coordinates of the handles of a PolyLineROI when I drag it to a new positions.
The signal sigRegionChangeFinished signal is emitted but the stateChanged function is not called such that the positions of the handles are not updated:

self.grid_box = pg.PolyLineROI(pos, closed=True, movable=True)
self.grid_box.sigRegionChangeFinished.connect(self._print_points)
self.refine_btn.setEnabled(True)
def _print_points(self):
     points_obj = self.grid_box.getState()['points']
     points = np.array([list((point[0], point[1])) for point in points_obj])
     print('Points: \n', points)

Points:
[[2127.82468485 34.86386885]
[2472.39864298 412.93394575]
[ 552.62944768 469.88173976]
[ 257.28034072 106.04861136]]
Points:
[[2127.82468485 34.86386885]
[2472.39864298 412.93394575]
[ 552.62944768 469.88173976]
[ 257.28034072 106.04861136]]

If I move each handle independently the positions are updated correctly...

@TammeWollweber
Copy link
Author

When this function is called manually, it raises Recursion Error:
RecursionError: maximum recursion depth exceeded while calling a Python object

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant