フィルターのクリア

Imellipse ROI not resizing in MATLAB GUIDE (2017b)

1 回表示 (過去 30 日間)
Pawel Tokarczuk
Pawel Tokarczuk 2019 年 11 月 22 日
コメント済み: Jayant 2021 年 11 月 21 日
I want to select a circular ROI in a set of image axes in a GUIDE GUI.
The following test code works as expected:
%% Clear the workspace
clear all
close all
clc
fclose('all');
%% Read a standard test image and display it
x = imread('pout.tif');
hf = figure;
ha = axes(hf);
imshow(x);
%% Initialise a circular ROI, allow it to be moved and re-sized, then save the image masked by the selected ROI
x0 = 40;
y0 = 40;
wd = 60;
ht = 60;
Start = [ x0, y0, wd, ht ];
he = imellipse(ha, Start);
setResizable(he, true);
setFixedAspectRatioMode(he, true);
he.Deletable = false;
Venue = wait(he);
BW = createMask(he);
x(~BW) = 0;
imwrite(x, fullfile(pwd, 'ROI.png'));
delete(he);
delete(ha);
delete(hf);
I get the result:
However, the ROI remains fixed at its original size if I attempt the same thing in my GUIDE project. I can move it and double-click to finish, but although there are 4 visible grab handles (NE, NW, SE, SW), I can't resize the circle. The only material change is:
HE = imellipse(handles.ImageDisplayAxes, Start);
I am using 2017b under W10 on a well-specified Dell Precision workstation. Please advise: it is so odd that stepping into GUIDE causes this very simple code to misbehave.

採用された回答

Pawel Tokarczuk
Pawel Tokarczuk 2019 年 11 月 25 日
編集済み: Pawel Tokarczuk 2019 年 11 月 27 日
To answer my own question: the solution is to use MATLAB 2015aSP1 rather than 2017b.
This is not the first time that problems with regions of interest (polygons, ellipses) in GUIDE have been resolved in this way.
So, case closed. I shall leave the question available for others to find.
  1 件のコメント
Jayant
Jayant 2021 年 11 月 21 日
For me with same case, in matlab 19a, for one GUI it is behaving exactly what i want. But for 2nd GUI, strange but ellipse not resizing. Everything is exactly same, copy paste, but still not resizing imellipse...

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by