Set resize behavior of ROI object
setResizable is not recommended. Use one of the ROI classes
instead, described in ROI Creation Overview.
Create an ellipse ROI object. Specify a position constraint function using
makeConstrainToRectFcn to keep the
ellipse inside the boundary of the image.
imshow('coins.png') h = imellipse(gca,[10 10 100 100]); fcn = makeConstrainToRectFcn('imellipse',get(gca,'XLim'),get(gca,'YLim')); setPositionConstraintFcn(h,fcn);
Click and drag with the mouse to try resizing, reshaping, and moving the ellipse.
Now, disable resizing the ellipse.
Click and drag the ellipse again. You can move it, but not change the size or shape of it.