图像处理工具箱:如何为ROI注册回调

时间:2019-05-22 22:43:11

标签: matlab

当我单击由drawpolygon返回的ROI时,我想注册一个回调。文档(https://de.mathworks.com/help/images/ref/images.roi.polygon-class.html)表示有一个ROIClicked的投资回报事件。但是,我没有找到注册此事件的回调的方法。

f = figure(); 
imagesc(rand(64,64));
roi = drawpolygon();

现在,尝试

roi.ROIClicked = @(~,~)disp('clicked');

失败

Unrecognized property 'ROIClicked' for class 'images.roi.Polygon'.

还有

addlistener(roi, 'ROIClicked', 'PostSet', @(~,~)disp('clicked'));

失败

Error using images.roi.Polygon/addlistener
The name 'ROIClicked' is not an accessible property for an instance of class 'images.roi.Polygon'.

我可能错过了文档中的某些内容,但是我想知道如何注册单击ROI时执行的回调?

0 个答案:

没有答案