MATLAB: GUI

guiimage processingMATLAB

Hey, Im trying to build a GUI for the Quality Assessment tools of an X-Ray machine. In this , i have to load an image and then do various operations on it. I have created a push button to load my image and another push button to do operations on it. I have to send the image from the callback of the Load Push Button to the callback of the push button of the Operations. Please help me how to do this! Thanks a lot.
Gaurav

Best Answer

Hi,
In callback of Load Push Button you should write like this :
handles.output = hObject;
[fn pn] = uigetfile('*.jpg','select image');
if fn ~= 0
handles.I = imread(fullfile(pn,fn));
imshow(handles.I);
end
guidata(hObject, handles);
In the other pushbutton, I will threshold the image.
And then in the other push button you can call the image by :
handles.output = hObject;
handles.bw = im2bw(handles.I);
imshow(handles.bw);
guidata(hObject, handles);
Related Question