How could I make a callback that updates when the user moves an roi?
13 views (last 30 days)
Show older comments
Turlough Hughes
on 15 Feb 2020
Answered: Turlough Hughes
on 6 Jan 2022
I'm making an app which loads and displays the same image side by side in app.UIAxes and app.UIAxes2. I have a rectangle roi object in app.UIAxes2 which the user can move around and adjust the size of. I want to take the coordiantes of the roi in app.UIAxes2 and use that to interactively zoom to those coordinates for the other UIAxes by changing the XLim and YLim accordingly. My issue is I don't know how to setup the callback so that it responds to a change in the position.
My question is really, is it possible to setup a value changing funtion that is called everytime the position values change in the roi, and if so how would I go about it? This would be similar to a value changing callback for a slider but the difference/issue being that draw rectangle is not part of the component library for app designer.
Any help/guidance would be appreciated.
1 Comment
Arthur Roué
on 11 Mar 2020
I'm not familiar with ROI rectangle, but you could try to add a listener on it's DrawingArea property.
addlistener(roi, 'DrawingArea', 'PostSet', @foo)
Accepted Answer
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!