Hi,
I want to add a freehand draw in my app, with :
d = drawfreehand(app.UIAxes_1,'color','green');
But i have this error:
Error using images.roi.internal.ROI/parseInputs
ROI parent must be a valid Axes object.
Error in images.roi.Freehand
So how can i use drawfreehand in App Designer ?
Thanks a lot in advance.

 採用された回答

Saumya Goel
Saumya Goel 2019 年 5 月 23 日

1 投票

At this time, the "drawfreehand" function only takes an 'axes' objects as an argument, not 'UIAxes', the type of axes that are used in App Designer. More information about the valid arguments for 'drawfreehand' can be found on this documentation page:

2 件のコメント

Stanley Strawbridge
Stanley Strawbridge 2019 年 8 月 8 日
So is there a way to draw a roi on an image in the UIAxes in App designer?
Sean de Wolski
Sean de Wolski 2019 年 8 月 8 日
See my answer below.

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

その他の回答 (1 件)

Sean de Wolski
Sean de Wolski 2019 年 8 月 8 日

3 投票

It's kind of silently supported but you can programmatically (>=R2018b) add an axes to a uifigure and then draw* will work.
ax = axes('Parent', uifigure)
drawfreehand(ax)

5 件のコメント

Stanley Strawbridge
Stanley Strawbridge 2019 年 8 月 8 日
Hi Sean, thanks for the response! This is moving in the right direction.
The commands provided allow me to open a NEW uifigure, separate from my GUI, that I am able to use drawfreehand with:
ax = axes('Parent',uifigure);
drawfreehand(ax);
However I would like to use this on the figure I already have in the GUI. I've tried several permutations of:
ax = axes('Parent',app.UIFigure);
drawfreehand(ax);
But this is not working on either the blank app.UIFigure/UIAxes, or on the image I have plotted with imshow.
Is there a way to get my current app.UIFigure/UIAxes to work?
OR. do I need to go back to the begining and manually add a uifigure to my GUI, do all of the plotting In that window, and then use drawdfreehand (I'm makeing a 3D image viewer that lets you circle things on different slices of a z-stack TIFF). If this is the case, could you point me to how to manually embed the new uifigure such that it has the same properties as the app.UIFigure. (I am interpreting "programatically add an axes", literally code the figure in by hand without the aid of the app designer. Is this what you mean?)
N/A
N/A 2021 年 2 月 9 日
I find myself facing the same challenge you did more than a year ago. Did you manage to find a solution that would allow you to freehand draw within the GUI?
Sean de Wolski
Sean de Wolski 2021 年 2 月 11 日
drawfreehand now works in app designer with uiaxes...
Andrew Keefe
Andrew Keefe 2021 年 2 月 12 日
Is this with the latest version? I'm running R2020A.
Narendra Narisetti
Narendra Narisetti 2021 年 3 月 30 日
Hi, I am also looking for sam solution. When I use uiaxes matlab taing long time and not responding. @Sean de Wolski, could you provide a solution how to develop free hand on ap designer?

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

カテゴリ

ヘルプ センター および File ExchangeDevelop Apps Using App Designer についてさらに検索

製品

リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by