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 all
close all
clc
fclose('all');
x = imread('pout.tif');
hf = figure;
ha = axes(hf);
imshow(x);
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.