Problem drawing a ROI on uiaxes

Hi,
I need to interactively draw a ROI in a uiaxes inside an app. I used the drawpolygon function:
app.polygonal_selection = drawpolygon(app.display_image);
where app.display_image is a uiaxes object. The function works well and returns the ROI, but an error occurs if I right-click while drawing the polygon. This should be allowed - the documentation of the drawpolygon function list this as a possible interaction: "Right-click, which does not add a new vertex but closes the polygon from the previous vertex".
The error I get is the following:
Warning: Error occurred while executing the listener callback for event Hit defined for class matlab.graphics.primitive.world.LineStrip:
Functionality not supported with figures created with the uifigure function. For more information, see Graphics Support in App Designer.
Error in images.roi.internal.AbstractPolygon/showContextMenu
Error in images.roi.internal.ROI/determineSelectionStatus
Error in images.roi.internal.ROI/startROIDrag
Error in images.roi.internal.ROI
Error in uiwait (line 81)
waitfor (hFigDlg, 'WaitStatus', 'inactive');
Error in images.roi.internal.ROI/draw
Error in drawpolygon (line 173)
h.draw;
Error in tiler/DrawROIButtonPushed (line 234)
app.polygonal_selection = drawpolygon(app.display_image);
Error in appdesigner.internal.service.AppManagementService/tryCallback (line 333)
callback(app, event);
Error in
matlab.apps.AppBase>@(source,event)tryCallback(appdesigner.internal.service.AppManagementService.instance(),app,callback,requiresEventData,event)
(line 35)
newCallback = @(source, event)tryCallback(appdesigner.internal.service.AppManagementService.instance(), ...
How can I fix this?
Thanks,
Stefano

Réponses (0)

Produits

Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by