Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%THIs is main working
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%now
- function varargout = gui_replica(varargin)
- % gui_replica MATLAB code for gui_replica.fig
- % gui_replica, by itself, creates a new gui_replica or raises the existing
- % singleton*.
- %
- % H = gui_replica returns the handle to a new gui_replica or the handle to
- % the existing singleton*.
- %
- % gui_replica('CALLBACK',hObject,eventData,handles,...) calls the local
- % function named CALLBACK in gui_replica.M with the given input arguments.
- %
- % gui_replica('Property','Value',...) creates a new gui_replica or raises the
- % existing singleton*. Starting from the left, property value pairs are
- % applied to the GUI before gui_replica_OpeningFcn gets called. An
- % unrecognized property name or invalid value makes property application
- % stop. All inputs are passed to gui_replica_OpeningFcn via varargin.
- %
- % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
- % instance to run (singleton)".
- %
- % See also: GUIDE, GUIDATA, GUIHANDLES
- % Edit the above text to modify the response to help gui_replica
- % Last Modified by GUIDE v2.5 21-Dec-2017 20:59:26
- % Begin initialization code - DO NOT EDIT
- gui_Singleton = 1;
- gui_State = struct('gui_Name', mfilename, ...
- 'gui_Singleton', gui_Singleton, ...
- 'gui_OpeningFcn', @gui_replica_OpeningFcn, ...
- 'gui_OutputFcn', @gui_replica_OutputFcn, ...
- 'gui_LayoutFcn', [] , ...
- 'gui_Callback', []);
- if nargin && ischar(varargin{1})
- gui_State.gui_Callback = str2func(varargin{1});
- end
- if nargout
- [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
- else
- gui_mainfcn(gui_State, varargin{:});
- end
- % End initialization code - DO NOT EDIT
- % --- Executes just before gui_replica is made visible.
- function gui_replica_OpeningFcn(hObject, eventdata, handles, varargin)
- % This function has no output args, see OutputFcn.
- % hObject handle to figure
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- % varargin command line arguments to gui_replica (see VARARGIN)
- handles.output = hObject;
- % Update handles structure
- guidata(hObject, handles);
- % img = imread('logo-tbl.png');
- % axes(handles.axes4)
- % imshow(img)
- % axis off
- % axis image
- % % Choose default command line output for gui_replica
- % handles.output = hObject;
- %
- % % Update handles structure
- % guidata(hObject, handles);
- % UIWAIT makes gui_replica wait for user response (see UIRESUME)
- % uiwait(handles.figure1);
- % --- Outputs from this function are returned to the command line.
- function varargout = gui_replica_OutputFcn(hObject, eventdata, handles)
- % varargout cell array for returning output args (see VARARGOUT);
- % hObject handle to figure
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- % Get default command line output from handles structure
- % varargout{1} = handles.output;
- varargout{1} = handles.output;
- % --- Executes on button press in pushbutton1.
- function pushbutton1_Callback(hObject, eventdata, handles)
- % hObject handle to pushbutton1 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- % [file_name,path_name] = uigetfile('*.jpg','Select image file');
- % full_path = [path_name,'\',file_name];
- % handles.filename=full_path;
- % guidata(hObject,handles)
- % img = imread(full_path);
- % axes(handles.axes1)
- % imshow(img)
- % axis off
- % axis image
- % --- Executes on button press in btnChooseSample.
- function btnChooseSample_Callback(hObject, eventdata, handles)
- % hObject handle to btnChooseSample (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- modeSelectedObj = get(handles.modeSelection,'SelectedObject')
- modeSelectedLabel = get(modeSelectedObj,'String')
- if (strcmp(modeSelectedLabel,'Single Mode') == 1)
- [FileName,PathName] = uigetfile('*.jpg','Select the image file');
- img = imread(FileName);
- [H,W] = size(img);
- t_crop = 80;
- r_crop = 55;
- b_crop = 700;
- l_crop = 105;
- % %
- [img_crp,H,W] = crop(img,H,W,l_crop,r_crop,t_crop,b_crop);
- %
- %
- % img_crop = img(t_crop+1:H-b_crop,l_crop+1:W-r_crop);
- % [H_crop,W_crop] = size(img_crop);
- gsigma1 = 2; %gsigma1_arr(sbj_no,part_no);
- %gsigma1 = 25;
- %img_gau = img_crp;
- img_gau = imgaussfilt(img_crp,gsigma1);
- diff_rl = 2;
- img_diff_bef = filt_diff(img_gau,H,W,diff_rl);
- [img_rl_bef,ind_rl_bef,avg_rl_bef] = find_srf(img_diff_bef,H,W); %img_rl
- med = 20; %med_arr(sbj_no,part_no); %med_arr(sbj_no,part_no); %60
- diff_idl = 2;
- %med = 10;
- img_med = medfilt2(img_gau,[med*2 med*2],'symmetric');
- % figure()
- % imshow(img_med,[]);
- img_med = filt_diff(img_med,H,W,diff_idl);
- % figure()
- % imshow(img_med,[]);
- [img_idl,ind_idl,~] = find_srf(img_med,H,W);
- mrg = 10;
- [img_flt,H,W] = flatten(img_crp,H,W,ind_idl,mrg);
- gsigma2 = 4; %gsigma2_arr(sbj_no,part_no); %60 gsigma_arr(sbj_no,part_no);
- % gsigma = 10; %11
- img_gau = imgaussfilt(img_flt,gsigma2);
- diff_rl = 2;
- img_diff = filt_diff(img_gau,H,W,diff_rl);
- % figure()
- % imshow(img_diff,[]);
- [img_rl,ind_rl,avg_rl] = find_srf(img_diff,H,W); %img_rl
- [avg_rgh,rms_rgh,max_rgh] = rgh_single(avg_rl,ind_rl);
- % axes(handles.axes6)
- % imshow(img_crp);
- % axis off
- % axis image
- axes(handles.outputImage)
- imshow(img_rl,[]);
- axis off
- axis image
- text_avg_rough_front = sprintf('%.2f', avg_rgh);
- text_rms_rough_front = sprintf('%.2f', rms_rgh);
- text_max_rough_front = sprintf('%.2f', max_rgh);
- set(handles.avgValueText, 'String', text_avg_rough_front);
- set(handles.rmsValueText, 'String', text_rms_rough_front);
- set(handles.maxValueText, 'String', text_max_rough_front);
- elseif (strcmp(modeSelectedLabel,'Batch Mode') == 1)
- OpenfilePath = uigetdir;
- max_step = 500;
- avg_rough_front = zeros(1,max_step);
- rms_rough_front = zeros(1,max_step);
- max_rough_front = zeros(1,max_step);
- t_crop = 20;
- r_crop = 55;
- b_crop = 500;
- l_crop = 110;
- img_name = strcat('Image',num2str(2,'%04d'),'.jpg');
- img = imread([OpenfilePath,'\',img_name]);
- [H,W] = size(img);
- %[img_crp,H,W] = crop(img,H,W,l_crop,r_crop,t_crop,b_crop);
- img3d = zeros(H,W,max_step,'uint8');
- for step = 1:max_step
- %file_name = strcat('bb _',num,'.jpg');
- %img_name = strcat('Image',num2str(2,'%04d'),'.jpg');
- img_name = strcat('Image',num2str(step-1,'%04d'),'.jpg');
- img = imread([OpenfilePath,'\',img_name]);
- img3d(:,:,step) = img;
- [H,W] = size(img);
- t_crop = 80;
- r_crop = 55;
- b_crop = 700;
- l_crop = 105;
- % %
- [img_crp,H,W] = crop(img,H,W,l_crop,r_crop,t_crop,b_crop);
- %
- %
- % img_crop = img(t_crop+1:H-b_crop,l_crop+1:W-r_crop);
- % [H_crop,W_crop] = size(img_crop);
- gsigma1 = 2; %gsigma1_arr(sbj_no,part_no);
- %gsigma1 = 25;
- %img_gau = img_crp;
- img_gau = imgaussfilt(img_crp,gsigma1);
- diff_rl = 2;
- img_diff_bef = filt_diff(img_gau,H,W,diff_rl);
- [img_rl_bef,ind_rl_bef,avg_rl_bef] = find_srf(img_diff_bef,H,W); %img_rl
- med = 20; %med_arr(sbj_no,part_no); %med_arr(sbj_no,part_no); %60
- diff_idl = 2;
- %med = 10;
- img_med = medfilt2(img_gau,[med*2 med*2],'symmetric');
- % figure()
- % imshow(img_med,[]);
- img_med = filt_diff(img_med,H,W,diff_idl);
- % figure()
- % imshow(img_med,[]);
- [img_idl,ind_idl,~] = find_srf(img_med,H,W);
- mrg = 10;
- [img_flt,H,W] = flatten(img_crp,H,W,ind_idl,mrg);
- gsigma2 = 4; %gsigma2_arr(sbj_no,part_no); %60 gsigma_arr(sbj_no,part_no);
- % gsigma = 10; %11
- img_gau = imgaussfilt(img_flt,gsigma2);
- diff_rl = 2;
- img_diff = filt_diff(img_gau,H,W,diff_rl);
- % figure()
- % imshow(img_diff,[]);
- [img_rl,ind_rl,avg_rl] = find_srf(img_diff,H,W); %img_rl
- %[avg_rgh,rms_rgh,max_rgh] = rgh_single(avg_rl,ind_rl);
- [avg_rough_front(step),rms_rough_front(step),max_rough_front(step)] = rgh(avg_rl,ind_rl);
- end
- mean_avg_rgh_front = mean(avg_rough_front);
- mean_rms_rgh_front = mean(rms_rough_front);
- mean_max_rgh_front = mean(max_rough_front);
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % text_avg_rough_front = sprintf('%.2f', mean_avg_rgh_front);
- % text_rms_rough_front = sprintf('%.2f', mean_rms_rgh_front);
- % text_max_rough_front = sprintf('%.2f', mean_max_rgh_front);
- %
- % set(handles.frontAvgValueText, 'String', text_avg_rough_front);
- % set(handles.frontRMSValueText, 'String', text_rms_rough_front);
- % set(handles.frontMaxValueText, 'String', text_max_rough_front);
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- [H,W,I] = size(img3d);
- max_iter = W;
- avg_rough_side = zeros(1,max_iter);
- rms_rough_side = zeros(1,max_iter);
- max_rough_side = zeros(1,max_iter);
- for img_no = 1:1 %200
- avgSide = img3d(:,img_no,:);
- % avgSide = avgSide([20:H-400],:); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- avgSide2 = squeeze(avgSide);
- img = avgSide2;
- [H,W] = size(img);
- gsigma1 = 2; %gsigma1_arr(sbj_no,part_no);
- img_gau = imgaussfilt(img,gsigma1);
- med = 20; %med_arr(sbj_no,part_no); %med_arr(sbj_no,part_no); %60
- diff_idl = 2;
- img_med = medfilt2(img_gau,[med*2 med*2],'symmetric');
- img_med = filt_diff(img_med,H,W,diff_idl);
- [img_idl,ind_idl,~] = find_srf(img_med,H,W);
- mrg = 60;
- [img_flt,H,W] = flatten(img,H,W,ind_idl,mrg);
- gsigma2 = 4; %gsigma2_arr(sbj_no,part_no);
- img_gau = imgaussfilt(img_flt,gsigma2);
- diff_rl = 2;
- img_diff = filt_diff(img_gau,H,W,diff_rl);
- [img_rl,ind_rl,avg_rl] = find_srf(img_diff,H,W); %img_rl
- [avg_rough_side(img_no),rms_rough_side(img_no),max_rough_side(img_no)] = rgh(avg_rl,ind_rl);
- end
- mean_avg_rgh_side = mean(avg_rough_side);
- mean_rms_rgh_side = mean(rms_rough_side);
- mean_max_rgh_side = mean(max_rough_side);
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % text_avg_rough_side = sprintf('%.4f', mean_avg_rgh_side);
- % text_rms_rough_side = sprintf('%.4f', mean_rms_rgh_side);
- % text_max_rough_sidet = sprintf('%.4f', mean_max_rgh_side);
- %
- % set(handles.sideAvgValueText, 'String', text_avg_rough_side);
- % set(handles.sideRMSValueText, 'String', text_rms_rough_side);
- % set(handles.sideMaxValueText, 'String', text_max_rough_sidet);
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%s
- axes(handles.outputImage)
- imshow(img_rl,[]);
- axis off
- axis image
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- avg_area_rgh = mean_avg_rgh_front * mean_avg_rgh_side;
- rms_area_rgh = mean_rms_rgh_front * mean_rms_rgh_side;
- max_area_rgh = max(mean_max_rgh_front,mean_max_rgh_side);
- text_avg_area_rgh = sprintf('%.4f', avg_area_rgh);
- text_rms_area_rgh = sprintf('%.4f', rms_area_rgh);
- text_max_area_rgh = sprintf('%.4f', max_area_rgh);
- set(handles.avgValueText, 'String', text_avg_area_rgh);
- set(handles.rmsValueText, 'String', text_rms_area_rgh);
- set(handles.maxValueText, 'String', text_max_area_rgh);
- % set(handles.avgAreaRgh, 'String', text_avg_area_rgh);
- % set(handles.rmsAreaRgh, 'String', text_rms_area_rgh);
- % set(handles.maxAreaRgh, 'String', text_max_area_rgh);
- else
- end
- % --- Executes on button press in pushbutton3.
- function pushbutton3_Callback(hObject, eventdata, handles)
- % hObject handle to pushbutton3 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- % --- Executes on button press in pushbutton4.
- function pushbutton4_Callback(hObject, eventdata, handles)
- % hObject handle to pushbutton4 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- % --- Executes on button press in pushbutton5.
- function pushbutton5_Callback(hObject, eventdata, handles)
- % hObject handle to pushbutton5 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- % --- Executes on button press in pushbutton6.
- function pushbutton6_Callback(hObject, eventdata, handles)
- % hObject handle to pushbutton6 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- % --- Executes on button press in pushbutton7.
- function pushbutton7_Callback(hObject, eventdata, handles)
- % hObject handle to pushbutton7 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- % --- Executes during object creation, after setting all properties.
- function text21_CreateFcn(hObject, eventdata, handles)
- % hObject handle to text21 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles empty - handles not created until after all CreateFcns called
- % --- Executes during object creation, after setting all properties.
- function axes1_CreateFcn(hObject, eventdata, handles)
- % hObject handle to axes1 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles empty - handles not created until after all CreateFcns called
- % Hint: place code in OpeningFcn to populate axes1
- % --- Executes during object deletion, before destroying properties.
- function axes1_DeleteFcn(hObject, eventdata, handles)
- % hObject handle to axes1 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- % --- Executes on mouse press over axes background.
- function axes1_ButtonDownFcn(hObject, eventdata, handles)
- % hObject handle to axes1 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- % --- Executes on button press in pushbutton8.
- function pushbutton8_Callback(hObject, eventdata, handles)
- % hObject handle to pushbutton8 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- % img = imread('logo-tbl.png');
- % axes(handles.axes4)
- % imshow(img)
- % axis off
- % axis image
- % gsigma1 = 2; %gsigma1_arr(sbj_no,part_no);
- % img_crp = uint8(img_crp);
- % img_gau = imgaussfilt(img_crp,gsigma1);
- % diff_rl = 2;
- % img_diff_bef = filt_diff(img_gau,H,W,diff_rl);
- % [img_rl_bef,ind_rl_bef,avg_rl_bef] = find_srf(img_diff_bef,H,W);
- % med = 20; %med_arr(sbj_no,part_no);
- % diff_idl = 2;
- % img_med = medfilt2(img_gau,[med*2 med*2],'symmetric');
- % img_med = filt_diff(img_med,H,W,diff_idl);
- % [img_idl,ind_idl,~] = find_srf(img_med,H,W);
- % mrg = 10;
- % [img_flt,H,W] = flatten(img_crp,H,W,ind_idl,mrg);
- % gsigma2 = 4; %gsigma2_arr(sbj_no,part_no); %60 gsigma_arr(sbj_no,part_no);
- % img_gau = imgaussfilt(img_flt,gsigma2);
- %
- % diff_rl = 2;
- % img_diff = filt_diff(img_gau,H,W,diff_rl);
- % % figure()
- % % imshow(img_diff,[]);
- % [img_rl,ind_rl,avg_rl] = find_srf(img_diff,H,W); %img_rl
- %
- % axes(handles.axes1)
- % imshow(img_rl,[]);
- % figure()
- % imshow(img_rl,[]);
- % axis off
- % axis image
- %imshow(img)
- % axes(handles.outputImage)
- % %imshow(img)
- % axis off
- % axis image
- % imshow(cat(3,r1,g1,b1),[]);
- % OpenfilePath = 'C:\Users\TBL\Documents\MATLAB\Yujin_Data\20170404_Amore_Replica\Eye-rim\5-Y';
- % img_name = strcat('Image',num2str(img_no-1,'%04d'),'.jpg');
- %
- % img0 = imread([OpenfilePath,'\',file_name]);
- %
- % img = imread(strcat(fld_pth,img_name));
- % max_step = 994;
- % avg_rough = zeros(1,max_step);
- % rms_rough = zeros(1,max_step);
- % max_rough = zeros(1,max_step);
- % total_rough = zeros(1,max_step);
- %
- % % full_path = handles.filename;
- % diff = 2;
- % l_crop = 156;
- % r_crop = 10;
- % t_crop = 45;
- % b_crop = 5;
- %
- % for step = 1:max_step
- % offset = 6;
- % num = sprintf('%d',step+offset);
- % file_name = strcat('bb _',num,'.jpg');
- % img0 = imread([OpenfilePath,'\',file_name]);
- % img = rgb2gray(img0);
- % [H,W] = size(img);
- % img = flip(img, 1);
- % [img_crop,H_crop,W_crop] = crop(img,H,W,l_crop,r_crop,t_crop,b_crop);
- % img_filt = imgaussfilt(img_crop,6);
- % img_diff = filt_diff(img_filt,H_crop,W_crop,diff);
- %
- % %ref_line to ref+line_surf
- % [img_line_surf,ind_line_surf,avg_index,ref_line_surf] = line_surf2(img_diff,H_crop,W_crop,diff);
- % img3d(:,:,step) = img_line_surf;
- %
- % [peak_height_front,valley_depth_front] = peak_valley(ind_line_surf,avg_index,W_crop);
- % [avg_rough_front(step),rms_rough_front(step),max_rough_front(step),total_rough_front(step)] = roughness(peak_height_front,valley_depth_front);
- %
- % fprintf('%d\n', step);
- %
- % end
- %
- % avg_roughness = zeros(1,W_crop);
- % rms_roughness = zeros(1,W_crop);
- % max_roughness = zeros(1,W_crop);
- % total_roughness = zeros(1,W_crop);
- %
- % for ii = 1:W_crop
- % s = img3d(:,ii,:);
- % s = squeeze(s);
- % [Hs,Ws] = size(s);
- % [row,col] = find(s);
- %
- % avg_index_side = round(mean(row));
- % ref_line = zeros(Hs,Ws);
- % ref_line(avg_index_side,:) = 255;
- %
- % abs_roughness = zeros(1,Ws);
- %
- % [peak_height_side,valley_depth_side] = peak_valley(row,avg_index_side,W_crop);
- % [avg_rough_side(ii),rms_rough_side(ii),max_rough_side(ii),total_rough_side(ii)] = roughness(peak_height_side,valley_depth_side);
- %
- % fprintf('%d\n', ii);
- %
- % end
- %
- %
- %
- % %mean_avg_rough_front = mean(avg_rough_front)
- % % mean_rms_rough_front = mean(rms_rough_front)
- % % mean_max_rough_front = mean(max_rough_front)
- % % mean_total_rough_front = mean(total_rough_front)
- % disp('Front view roughness');
- %
- % text_avg_rough_front = sprintf('%.2f', mean(avg_rough_front));
- % text_rms_rough_front = sprintf('%.2f', mean(rms_rough_front));
- % text_max_rough_front = sprintf('%.2f', mean(max_rough_front));
- % text_total_rough_front = sprintf('%.2f', mean(total_rough_front));
- %
- % set(handles.avgValueText, 'String', text_avg_rough_front);
- % set(handles.rmsValueText, 'String', text_rms_rough_front);
- % set(handles.maxValueText, 'String', text_max_rough_front);
- % set(handles.text16, 'String', text_total_rough_front);
- %
- %
- % disp('Side view roughness');
- %
- % text_avg_rough = sprintf('%.2f', mean(avg_rough_side));
- % text_rms_rough = sprintf('%.2f', mean(rms_rough_side));
- % text_max_rough = sprintf('%.2f', mean(max_rough_side));
- % text_total_rough = sprintf('%.2f', mean(total_rough_side));
- %
- % set(handles.sideAvgValueText, 'String', text_avg_rough);
- % set(handles.sideRMSValueText, 'String', text_rms_rough);
- % set(handles.sideMaxValueText, 'String', text_max_rough);
- % set(handles.text30, 'String', text_total_rough);
- %
- %
- %
- %
- % axes(handles.axes1)
- % %imshow(img)
- % axis off
- % axis image
- % imshow(img0);
- %
- %
- % r1 = img_crop;
- % g1 = r1;
- % b1 = r1;
- % r1(img_line_surf > 0) = 255;
- % g1(img_line_surf > 0) = 0; %%
- % b1(ref_line_surf > 0) = 255; %
- %
- % axes(handles.outputImage)
- % %imshow(img)
- % axis off
- % axis image
- % imshow(cat(3,r1,g1,b1),[]);
- function edit2_Callback(hObject, eventdata, handles)
- % hObject handle to edit2 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- % Hints: get(hObject,'String') returns contents of edit2 as text
- % str2double(get(hObject,'String')) returns contents of edit2 as a double
- % --- Executes during object creation, after setting all properties.
- function edit2_CreateFcn(hObject, eventdata, handles)
- % hObject handle to edit2 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles empty - handles not created until after all CreateFcns called
- % Hint: edit controls usually have a white background on Windows.
- % See ISPC and COMPUTER.
- if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
- set(hObject,'BackgroundColor','white');
- end
- function edit3_Callback(hObject, eventdata, handles)
- % hObject handle to edit3 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- % Hints: get(hObject,'String') returns contents of edit3 as text
- % str2double(get(hObject,'String')) returns contents of edit3 as a double
- % --- Executes during object creation, after setting all properties.
- function edit3_CreateFcn(hObject, eventdata, handles)
- % hObject handle to edit3 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles empty - handles not created until after all CreateFcns called
- % Hint: edit controls usually have a white background on Windows.
- % See ISPC and COMPUTER.
- if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
- set(hObject,'BackgroundColor','white');
- end
- function edit4_Callback(hObject, eventdata, handles)
- % hObject handle to edit4 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- % Hints: get(hObject,'String') returns contents of edit4 as text
- % str2double(get(hObject,'String')) returns contents of edit4 as a double
- % --- Executes during object creation, after setting all properties.
- function edit4_CreateFcn(hObject, eventdata, handles)
- % hObject handle to edit4 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles empty - handles not created until after all CreateFcns called
- % Hint: edit controls usually have a white background on Windows.
- % See ISPC and COMPUTER.
- if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
- set(hObject,'BackgroundColor','white');
- end
- function edit5_Callback(hObject, eventdata, handles)
- % hObject handle to edit5 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- % Hints: get(hObject,'String') returns contents of edit5 as text
- % str2double(get(hObject,'String')) returns contents of edit5 as a double
- % --- Executes during object creation, after setting all properties.
- function edit5_CreateFcn(hObject, eventdata, handles)
- % hObject handle to edit5 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles empty - handles not created until after all CreateFcns called
- % Hint: edit controls usually have a white background on Windows.
- % See ISPC and COMPUTER.
- if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
- set(hObject,'BackgroundColor','white');
- end
- % --- Executes during object creation, after setting all properties.
- function axes6_CreateFcn(hObject, eventdata, handles)
- % hObject handle to axes6 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles empty - handles not created until after all CreateFcns called
- % Hint: place code in OpeningFcn to populate axes6
- % --- Executes on button press in btnConfirmMode.
- function btnConfirmMode_Callback(hObject, eventdata, handles)
- % hObject handle to btnConfirmMode (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- modeSelectedObj = get(handles.modeSelection,'SelectedObject')
- modeSelectedLabel = get(modeSelectedObj,'String')
- if (strcmp(modeSelectedLabel,'Single Mode') == 1)
- set(handles.btnChooseSample,'String','Choose File')
- set(handles.modeLabelBig,'String', 'Single Mode')
- set(handles.rghTypeLabel,'String', 'Surface roughness')
- elseif (strcmp(modeSelectedLabel,'Batch Mode') == 1)
- set(handles.btnChooseSample,'String','Choose Folder')
- set(handles.modeLabelBig,'String', 'Batch Mode')
- set(handles.rghTypeLabel,'String', 'Area roughness')
- end
- % --- Executes on button press in batchModeRadio.
- function batchModeRadio_Callback(hObject, eventdata, handles)
- % hObject handle to batchModeRadio (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- % Hint: get(hObject,'Value') returns toggle state of batchModeRadio
- % --- Executes on button press in singleModeRadio.
- function singleModeRadio_Callback(hObject, eventdata, handles)
- % hObject handle to singleModeRadio (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- % Hint: get(hObject,'Value') returns toggle state of singleModeRadio
- % --- Executes on button press in pushbutton10.
- function pushbutton10_Callback(hObject, eventdata, handles)
- % hObject handle to pushbutton10 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- % --- Executes on button press in pushbutton11.
- function pushbutton11_Callback(hObject, eventdata, handles)
- % hObject handle to pushbutton11 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- % --- Executes on button press in pushbutton13.
- function pushbutton13_Callback(hObject, eventdata, handles)
- % hObject handle to pushbutton13 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- % --- Executes on button press in pushbutton14.
- function pushbutton14_Callback(hObject, eventdata, handles)
- % hObject handle to pushbutton14 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- % --- Executes on selection change in popupmenu3.
- function popupmenu3_Callback(hObject, eventdata, handles)
- % hObject handle to popupmenu3 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- % Hints: contents = cellstr(get(hObject,'String')) returns popupmenu3 contents as cell array
- % contents{get(hObject,'Value')} returns selected item from popupmenu3
- % --- Executes during object creation, after setting all properties.
- function popupmenu3_CreateFcn(hObject, eventdata, handles)
- % hObject handle to popupmenu3 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles empty - handles not created until after all CreateFcns called
- % Hint: popupmenu controls usually have a white background on Windows.
- % See ISPC and COMPUTER.
- if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
- set(hObject,'BackgroundColor','white');
- end
- % --- Executes on selection change in popupmenu4.
- function popupmenu4_Callback(hObject, eventdata, handles)
- % hObject handle to popupmenu4 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- % Hints: contents = cellstr(get(hObject,'String')) returns popupmenu4 contents as cell array
- % contents{get(hObject,'Value')} returns selected item from popupmenu4
- % --- Executes during object creation, after setting all properties.
- function popupmenu4_CreateFcn(hObject, eventdata, handles)
- % hObject handle to popupmenu4 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles empty - handles not created until after all CreateFcns called
- % Hint: popupmenu controls usually have a white background on Windows.
- % See ISPC and COMPUTER.
- if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
- set(hObject,'BackgroundColor','white');
- end
- % --- Executes on selection change in popupmenu5.
- function popupmenu5_Callback(hObject, eventdata, handles)
- % hObject handle to popupmenu5 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- % Hints: contents = cellstr(get(hObject,'String')) returns popupmenu5 contents as cell array
- % contents{get(hObject,'Value')} returns selected item from popupmenu5
- % --- Executes during object creation, after setting all properties.
- function popupmenu5_CreateFcn(hObject, eventdata, handles)
- % hObject handle to popupmenu5 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles empty - handles not created until after all CreateFcns called
- % Hint: popupmenu controls usually have a white background on Windows.
- % See ISPC and COMPUTER.
- if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
- set(hObject,'BackgroundColor','white');
- end
- % --- Executes on selection change in popupmenu6.
- function popupmenu6_Callback(hObject, eventdata, handles)
- % hObject handle to popupmenu6 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- % Hints: contents = cellstr(get(hObject,'String')) returns popupmenu6 contents as cell array
- % contents{get(hObject,'Value')} returns selected item from popupmenu6
- % --- Executes during object creation, after setting all properties.
- function popupmenu6_CreateFcn(hObject, eventdata, handles)
- % hObject handle to popupmenu6 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles empty - handles not created until after all CreateFcns called
- % Hint: popupmenu controls usually have a white background on Windows.
- % See ISPC and COMPUTER.
- if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
- set(hObject,'BackgroundColor','white');
- end
- % --- Executes on selection change in listbox1.
- function listbox1_Callback(hObject, eventdata, handles)
- % hObject handle to listbox1 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- % Hints: contents = cellstr(get(hObject,'String')) returns listbox1 contents as cell array
- % contents{get(hObject,'Value')} returns selected item from listbox1
- % --- Executes during object creation, after setting all properties.
- function listbox1_CreateFcn(hObject, eventdata, handles)
- % hObject handle to listbox1 (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles empty - handles not created until after all CreateFcns called
- % Hint: listbox controls usually have a white background on Windows.
- % See ISPC and COMPUTER.
- if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
- set(hObject,'BackgroundColor','white');
- end
Advertisement
Add Comment
Please, Sign In to add comment