send imtool image to my GUIDE GUI

1 回表示 (過去 30 日間)
Ely Raz
Ely Raz 2017 年 6 月 1 日
回答済み: Ely Raz 2017 年 6 月 2 日
In the following function, I send an image from my GUI axes to an imtool in order to do some manipulations. How can I transfer the manipulated image back to my GUI axes?
Script:
% --- Executes on button press in imtoolbutton.
function imtoolbutton_Callback(hObject, eventdata, handles)
% hObject handle to imtoolbutton (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
J = getappdata(handles.imageAxes , 'yourVariable');
I=imtool(J);
axes(handles.imageAxes);
imshow(I);
setappdata(handles.imageAxes, 'yourVariable', I);

回答 (2 件)

Walter Roberson
Walter Roberson 2017 年 6 月 1 日
J = getappdata(handles.imageAxes , 'yourVariable');
h = imtool(J);
At this point you would want to give the user time to manipulate the image. Once they have done that,
ax = findobj(h,'tag','hImscrollpanelAxes');
I = ax.Children.CData;
imshow(I, 'Parent', handles.imageAxes);
setappdata(handles.imageAxes, 'yourVariable', I);

Ely Raz
Ely Raz 2017 年 6 月 2 日
Thanks a lot. The imtool works fine but the returned image is not shown, any reason why?

カテゴリ

Help Center および File ExchangeExplore and Edit Images with Image Viewer App についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by