Removing any previously draw roi on an image

11 ビュー (過去 30 日間)
Jason
Jason 2020 年 7 月 1 日
コメント済み: Jason 2020 年 7 月 1 日
Hello. I have an image in a UIAxes component (app designer) and have the code below. Everytime I run the code (via pushButton callback), I want tod elete any previous roi ellipses and create a new one, hence I try and delete any previous ones. The way I've done doesn't do anything
[sx,sy]=size(app.imgArray{1})
ax=app.UIAxes3;
g=get(ax,'children')
findall(g, 'type', 'Ellipse');
t = findall(g, 'type', 'Ellipse'); delete(t);
h = images.roi.Ellipse(app.UIAxes3,'Center',[round(sy/2) round(sx/2)],'Semiaxes',[round(sx/2) round(sx/2)],'Color','r','StripeColor','b','LineWidth',1);
Have also tried (but didn't work)
findall(g, 'type', 'line');
t = findall(g, 'type', 'line'); delete(t);

採用された回答

Mehmed Saad
Mehmed Saad 2020 年 7 月 1 日
findobj(ax,'Type','images.roi.Ellipse')
  1 件のコメント
Jason
Jason 2020 年 7 月 1 日
Perfect, thankyou

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInstall Products についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by