【发布时间】:2016-05-08 07:19:58
【问题描述】:
要求:
我正在创建一个 matlab gui 项目。我的代码中有一个pushbutton,单击时会创建一个figure,显示来自父GUI 的图像,并带有msgbox 作为弹出窗口。单击msgbox 上的ok 后,我想使用impoly 命令选择感兴趣的区域。
问题:
现在的问题是在单击msgbox 上的ok 按钮后,impoly 命令不起作用。鼠标指针不会变成选择器。我搜索了 matlab 文档,备用的是warndlg,但同样的情况发生了。
这是我的代码:
% --- Executes on button press in roi.
function roi_Callback(hObject, eventdata, handles)
% hObject handle to roi (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
image=getimage(handles.axes2); % acquire image from parent gui
figure; % figure;
msgbox('Select ROI for overlapped area','overlapped region'); %message box
im=imshow(image); % to show the image in figure;
data12=impoly; % creates a roi polygon selector
mask12=createMask(data12,im); % creates a binary mask
【问题讨论】:
标签: matlab user-interface image-processing matlab-figure matlab-guide