Detecting updated position of imellipse?

조회 수: 6 (최근 30일)
Megan
Megan 2015년 4월 4일
답변: Philip Caplan 2015년 4월 13일
Hi,
I can use getPosition to get the original position of imellipse drawn, however i am unable to find the updated position once the ellipse has moved. I know this can be achieved by right clicking on the image screen, however, I am unsure how to do this automatically through code. Any help you could offer would be appreaciated.
  댓글 수: 5
Megan
Megan 2015년 4월 4일
When I double click the ellipse it does return the current size and location parameters. However, I need the current size and location parameters to be returned in script i.e I do not want to have to right click on each of the markers and record the parameters manually to be later fed into the script again. I have tried using getposition(h),where h is the handle to the ellipse object, however it apparently fails to update when the ellipse is dragged to a new position.
Image Analyst
Image Analyst 2015년 4월 5일
It will only give you the parameters once you've finished adjusting it and double click on it, not while you are in the process of making adjustments.

댓글을 달려면 로그인하십시오.

답변 (1개)

Philip Caplan
Philip Caplan 2015년 4월 13일
It looks like you are trying to get the position of the ellipse when you click and drag it interactively. The first example in the documentation for "imellipse" at:
describes how to use "addNewPositionCallback" to write the current position (as the ellipse moves) to the figure title. A better description of this callback is given at:
Similar to the 'position' variable when creating the "imellipse", the input argument to the "addNewPositonCallback" has the same information about the bounding rectangle of the ellipse.

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by