MATLAB: How can i browse an image in gui

guimatlab gui

how can i browse an dicom image in matlab gui???

Best Answer

Hi, Usama
Here I give you sample code with GUIDE.
First, you need to create your GUI.
Type 'guide' in command window, and select 'blank GUI'
Then design your GUI. Your GUI must contains Axes, Pushbutton, and Edit as shown in the picture bellow
And type this code at 'pushbutton1_Callback'
function pushbutton1_Callback(hObject, eventdata, handles)
handles.output = hObject;
[fn pn] = uigetfile('*.dcm','select dicom file');
complete = strcat(pn,fn);
set(handles.edit1,'string',complete);
I = dicomread(complete);
imshow(I,[]);
guidata(hObject, handles);
I hope this clear.