Fit UIAxes to image dimensions automatically

4 ビュー (過去 30 日間)
Ali razi
Ali razi 2022 年 2 月 2 日
回答済み: Dave B 2022 年 2 月 2 日
I use the code (App designer file attach) to mark a ROI. On of the things that I can not solve is that the UIAxes dimension are bigger than the image (white background) as well that the customizable rectangular ROI can be set outside the image dimension.
Therefore, How can I set the UIAxes to fit any image dimensions automatically?

回答 (1 件)

Dave B
Dave B 2022 年 2 月 2 日
How about adding the line:
axis(app.ImageAxes, 'tight');
in the LoadimageButtonPushed method after the imshow line?
Also note, if you really want to ensure the roi never leaves the image, you're best off using images.roi.Rectangle as discussed in this answer.

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by