📄 thresholds.m
字号:
function varargout = thresholds(varargin)
% -------------------------------------------------------------------------
% this code is part of the 'Reduction Testbench' suite
% developed by A. Manganaro, R. Todeschini, A. Ballabio, D. Mauri
% 2006 - Milano Chemometrics and QSAR Research Group
% -------------------------------------------------------------------------
%
%
% THRESHOLDS M-file for thresholds.fig
% THRESHOLDS, by itself, creates a new THRESHOLDS or raises the existing
% singleton*.
%
% H = THRESHOLDS returns the handle to a new THRESHOLDS or the handle to
% the existing singleton*.
%
% THRESHOLDS('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in THRESHOLDS.M with the given input arguments.
%
% THRESHOLDS('Property','Value',...) creates a new THRESHOLDS or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before thresholds_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to thresholds_OpeningFcn via varargin.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% INIT code
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @thresholds_OpeningFcn, ...
'gui_OutputFcn', @thresholds_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin & isstr(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
% --------------------------------------------------------------------
function thresholds_OpeningFcn(hObject, eventdata, handles, varargin)
% --- Executes just before thresholds is made visible.
% 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 thresholds (see VARARGIN)
% Choose default command line output for thresholds
handles.output = hObject;
movegui(handles.thresholds,'center');
[SimpleCorr_T, R2_T, KIF_T] = init_read;
set(handles.CorrEdit,'String',num2str(SimpleCorr_T));
set(handles.R2Edit,'String',num2str(R2_T));
set(handles.KIFEdit,'String',num2str(KIF_T));
% Update handles structure
guidata(hObject, handles);
% --------------------------------------------------------------------
function varargout = thresholds_OutputFcn(hObject, eventdata, handles)
% --- Outputs from this function are returned to the command line.
% 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;
% --------------------------------------------------------------------
function CorrEdit_CreateFcn(hObject, eventdata, handles)
% --- Executes during object creation, after setting all properties.
% hObject handle to CorrEdit (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
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --------------------------------------------------------------------
function R2Edit_CreateFcn(hObject, eventdata, handles)
% --- Executes during object creation, after setting all properties.
% hObject handle to R2Edit (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
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --------------------------------------------------------------------
function KIFedit_CreateFcn(hObject, eventdata, handles)
% --- Executes during object creation, after setting all properties.
% hObject handle to KIFedit (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
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% GUI objects HANDLERS
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function CancelButton_Callback(hObject, eventdata, handles)
% --- Executes on button press in CancelButton.
% hObject handle to CancelButton (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)
close (handles.thresholds);
% --------------------------------------------------------------------
function OkButton_Callback(hObject, eventdata, handles)
% --- Executes on button press in OkButton.
% hObject handle to OkButton (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)
SimpleCorr_T = str2num(get(handles.CorrEdit,'String'));
R2_T = str2num(get(handles.R2Edit,'String'));
KIF_T = str2num(get(handles.KIFEdit,'String'));
if ( (isempty(SimpleCorr_T)) | (isempty(R2_T)) | (isempty(KIF_T)) )
warning_box('Invalid threshold value');
return;
elseif ( ((SimpleCorr_T<0)|(SimpleCorr_T>1)) | (R2_T<0) | ((KIF_T<0)|(KIF_T>1)))
warning_box('Invalid threshold value');
return;
end
init_write(SimpleCorr_T, R2_T, KIF_T);
close (handles.thresholds);
% --------------------------------------------------------------------
function CorrEdit_Callback(hObject, eventdata, handles)
% hObject handle to CorrEdit (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 CorrEdit as text% str2double(get(hObject,'String')) returns contents of CorrEdit as a double
% --------------------------------------------------------------------
function R2Edit_Callback(hObject, eventdata, handles)
% hObject handle to R2Edit (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 R2Edit as text% str2double(get(hObject,'String')) returns contents of R2Edit as a double
% --------------------------------------------------------------------
function KIFedit_Callback(hObject, eventdata, handles)
% hObject handle to KIFedit (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 KIFedit as text
% str2double(get(hObject,'String')) returns contents of KIFedit as a double
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Other code
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function warning_box(cur_msg)
% Calls the msgbox function to show a warning
% cur_msg message string
msgbox({cur_msg});% --- Executes during object creation, after setting all properties.function KIFEdit_CreateFcn(hObject, eventdata, handles)% hObject handle to KIFEdit (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 set(hObject,'BackgroundColor','white');else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction KIFEdit_Callback(hObject, eventdata, handles)% hObject handle to KIFEdit (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 KIFEdit as text% str2double(get(hObject,'String')) returns contents of KIFEdit as a double
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -