How can I show a big image to the user, and let him zoom on it to click on specified points?

8 views (last 30 days)
Hello I'm showing images (with a huge size) to the user, and he must selct pixels from it. However, selection must be precise and I would allow him to zoom on the shown images to selct the pixels with precision. However, the "zoom on" instruction doesn't work for me. This my code:
fig=figure('Name', 'select Cell pixels', ... 'Position',[1 scrsz(4) scrsz(3) scrsz(4)]); hold on; imshow(IRGB); zoom on; [X,Y]=getpts(fig); close(fig);
Can you help me?? just a note: when I show the image (with imshow()) the user can zoom. After executing the getpts ... the zoom is automatically turned off.

Answers (1)

Image Analyst
Image Analyst on 18 Aug 2018
See my attached zooming demo.
  3 Comments
Elena Casiraghi
Elena Casiraghi on 20 Aug 2018
Edited: Elena Casiraghi on 20 Aug 2018
Thanks again for your quick answer, but I already tried and it behaves exactly as getpts. Precisely, when called, ginput() sets the zoom off. Basically, what I need, is the behaviour of the DataCursor that I find in the menu bar of the figure:
Indeed, afetr zooming in and/or out, with the dataCursor I can move in the image and see the position and rgb value of pixels. However, the observed pixels are not recorded. I believe the behaviour of the DataCursor is implemented in the figure class, but I can't find its implementation. How can I modify the dataCursor behaviour do that it returns the coordinates of the pixels observed by the user? Or ... how can I add a further selection tool to the figure menu bar? Do you have any clue?

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!