Apparent bug when images.ROI is placed within an hggroup

1 view (last 30 days)
I need to place an ROI within a Graphic Group:
clf
axis([0 10 0 10])
g = hggroup(gca);
images.roi.Circle(g,'Center',[4 5],'Radius',3)
The ROI appears fine on the figure. It can also be dragged just fine.
However, upon trying to resize the ROI with the mouse, I am getting:
Warning: Error occurred while executing the listener callback for event WindowMouseMotion
defined for class matlab.ui.Figure:
Unrecognized method, property, or field 'XDir' for class 'matlab.graphics.primitive.Group'.
Error in images.roi.Circle/setPointerEnterFcn
Error in images.roi.internal.IPTROIPointerManager/motionCallback
Error in images.roi.internal.IPTROIPointerManager>@(src,evt)self.motionCallback(src,evt)
This seems like a bug.
Any thoughts for a work around that will allow placing ROIs within graphic groups?

Accepted Answer

Vimal Rathod
Vimal Rathod on 4 Feb 2020
Edited: Vimal Rathod on 4 Feb 2020
I have heard that this issue is known to the concerned developers and the issue will be resolved in 2020a release. As a work around for your usecase or for any generic ROI grouping cases, you could parent the ROIs directly to the axes and "group" them by using the ROI's "Tag" property. You can then find the grouped ROIs by using findobj with that specific tag.
Refer the following link to know more about how to use findobj function.

More Answers (0)

Categories

Find more on Graphics Object Programming in Help Center and File Exchange

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!