Using two axes in one GUI
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Christos Stefos
am 2 Feb. 2014
Bearbeitet: Christos Stefos
am 4 Feb. 2014
%I would like display the image (I) that the user selects in the axis with name axis1 and graph %the values of handle.perc_nu from different images in axis2 with hold on(while keeping previous %plots).A segment of my code follows. I am doing something wrong and it wont work!Can you please %help
function varargout = cell_confluency_calc(varargin)
varargout{1} = handles.output;
--- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
handles.output = hObject;
[fn, pn] = uigetfile('*.jpg','Please select your image file');
impath = strcat(pn,fn);
set(handles.edit1,'string',impath);
I = imread(impath);
imshow(I,[]);
pause(5)
handles.BI = I;%backup gia toggle buttpn
run('grayklim.m');
CI= I;
run('filterit.m');
run ('gemiseholes.m');
imshow(I,[]);
pause(5)
level= graythresh(I)- 0.22;
blackwhite= im2bw(I,level);
blackwhite= bwareaopen(blackwhite,100);
imshow(blackwhite,[] )
handles.bw= blackwhite;
mask =uint8 (blackwhite);
handles.blackcell= CI.*mask;
imshow (handles.blackcell, [] )
pause(5)
guidata(hObject, handles);
-- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
A = sum(sum(handles.bw));
cell_pixels = A;
all_pixels= numel(handles.bw);
handles.perc_nu=(cell_pixels/all_pixels*100)
handles.perc = [num2str(cell_pixels/all_pixels*100) '%'];
set(handles.edit2,'string',handles.perc )
hold
plot(axes2, handles.perc_nu)
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Specifying Target for Graphics Output finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!