📄 erp_bs_option_ui.m
字号:
%ERP_BS_OPTION_UI Option window for BootStrap Display
%
% USAGE: bs_option_fig = erp_bs_option_ui
%
% See also: ERP_PLOT_OPTION_UI
% Called by ERP_PLOT_UI
%
% O (bs_option_fig) - handle of bootstrap option figure
%
% Modified on 15-Jan-2003 by Jimmy Shen
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function h01 = erp_bs_option_ui(varargin)
if nargin == 0 | ~ischar(varargin{1})
h01 = init(varargin{1});
return;
end
% clear the message line,
%
h = findobj(gcf,'Tag','MessageLine');
set(h,'String','');
action = varargin{1};
if strcmp(action,'select_all')
select_all;
elseif strcmp(action,'select_lv')
select_lv;
elseif strcmp(action,'edit_thresh')
edit_thresh;
elseif strcmp(action,'edit_min_ratio')
edit_min_ratio;
elseif strcmp(action,'edit_max_ratio')
edit_max_ratio;
elseif strcmp(action,'reset_bs_fields')
reset_bs_fields;
elseif strcmp(action,'set_bs_fields')
h01 = set_bs_fields(varargin{2});
elseif strcmp(action,'click_ok')
click_ok;
elseif strcmp(action,'click_cancel')
close(gcf);
elseif strcmp(action,'delete_fig')
delete_fig;
end
return; % erp_bs_option_ui
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% initialize GUI
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function h01 = init(h0)
%------------------- control panel figure ----------------------
save_setting_status = 'on';
erp_bs_option_pos = [];
try
load('pls_profile');
catch
end
if ~isempty(erp_bs_option_pos) & strcmp(save_setting_status,'on')
pos = erp_bs_option_pos;
else
w = 0.6;
h = 0.58;
x = (1-w)/2;
y = (1-h)/2;
pos = [x y w h];
end
h01 = figure('units','normal', ...
'numberTitle','off', ...
'menubar', 'none', ...
'toolBar','none', ...
'name','BootStrap Options', ...
'deletefcn','erp_bs_option_ui(''delete_fig'');', ...
'tag','bs_option_fig', ...
'position', pos);
% numbers of lines excluding 'MessageLine'
top_margin = 0.05;
left_margin = 0.05;
num_line = 14;
factor_line = (1-top_margin)/(num_line+1);
%----------------------- LV selection ---------------------------
x = left_margin;
y = (num_line-0) * factor_line;
w = 0.5 - 2*left_margin;
h = 1 * factor_line;
pos = [x y w h];
h1 = uicontrol('parent',h01, ... % bs_edit label
'units','normal', ...
'style','text', ...
'fontunit','normal', ...
'fontsize',0.55, ...
'back',[0.8 0.8 0.8], ...
'string','Select an LV to Edit', ...
'position',pos);
x = left_margin + 0.5;
pos = [x y w h];
h1 = uicontrol('parent',h01, ... % bs_disp label
'units','normal', ...
'style','text', ...
'fontunit','normal', ...
'fontsize',0.55, ...
'back',[0.8 0.8 0.8], ...
'string','Select LV(s) to Display', ...
'position',pos);
x = left_margin;
y = (num_line-4)*factor_line;
w = 0.5 - 2*left_margin;
h = 4 * factor_line;
pos = [x y w h];
h_bs_edit = uicontrol('parent',h01, ... % bs_edit listbox
'unit','normal', ...
'style','listbox', ...
'fontunit','normal', ...
'fontsize',0.144, ...
'max',1, ...
'callback','erp_bs_option_ui(''select_lv'');', ...
'position',pos);
x = left_margin + 0.5;
pos = [x y w h];
h_bs_disp = uicontrol('parent',h01, ... % bs_disp listbox
'unit','normal', ...
'style','listbox', ...
'fontunit','normal', ...
'fontsize',0.144, ...
'max',2, ...
'position',pos);
x = left_margin + 0.55;
y = (num_line-6)*factor_line;
w = 0.35;
h = 1 * factor_line;
pos = [x y w h];
h1 = uicontrol('parent',h01, ... % bs selection selectall
'unit','normal', ...
'style','push', ...
'fontunit','normal', ...
'fontsize',0.55, ...
'string','Select All LVs', ...
'callback', 'erp_bs_option_ui(''select_all'');', ...
'position',pos);
%-------------------- BootStrap field selection ----------------------
y = (num_line-8)*factor_line;
pos = [x y w h];
h1 = uicontrol('parent',h01, ... % field selection reset
'unit','normal', ...
'style','push', ...
'fontunit','normal', ...
'fontsize',0.55, ...
'string','Reset to default value', ...
'callback', 'erp_bs_option_ui(''reset_bs_fields'');', ...
'position',pos);
x = left_margin;
y = (num_line-6) * factor_line;
w = 0.3;
h = 1 * factor_line;
pos = [x y w h];
h1 = uicontrol('parent',h01, ... % PValue label
'units','normal', ...
'style','text', ...
'fontunits','normal', ...
'fontsize',0.55, ...
'horizon','left', ...
'back', [0.8 0.8 0.8], ...
'string', 'Approximate P Value:', ...
'visible','off', ...
'position',pos);
x = x + w;
y = (num_line-6) * factor_line;
w = 0.15;
pos = [x y w h];
h_p_value = uicontrol('parent',h01, ... % PValue edit
'units','normal', ...
'style','text', ...
'fontunits','normal', ...
'fontsize',0.55, ...
'horizon','right', ...
'back',[0.8 0.8 0.8], ...
'string','', ...
'visible','off', ...
'position',pos);
x = left_margin;
y = (num_line-8) * factor_line;
w = 0.3;
pos = [x y w h];
h1 = uicontrol('parent',h01, ... % Threshold label
'units','normal', ...
'style','text', ...
'fontunits','normal', ...
'fontsize',0.55, ...
'horizon','left', ...
'back', [0.8 0.8 0.8], ...
'string', 'Threshold:', ...
'position',pos);
x = x + w;
y = (num_line-8) * factor_line;
w = 0.15;
pos = [x y w h];
h_thresh = uicontrol('parent',h01, ... % Threshold edit
'units','normal', ...
'style','edit', ...
'fontunits','normal', ...
'fontsize',0.55, ...
'horizon','right', ...
'back',[1 1 1], ...
'string','', ...
'callback','erp_bs_option_ui(''edit_thresh'');', ...
'position',pos);
x = left_margin;
y = (num_line-10) * factor_line;
w = 0.3;
pos = [x y w h];
h1 = uicontrol('parent',h01, ... % Min. Ratio label
'units','normal', ...
'style','text', ...
'fontunit','normal', ...
'fontsize', 0.55, ...
'horizon','left', ...
'back',[0.8 0.8 0.8], ...
'string','Minimum Ratio:', ...
'position',pos);
x = x + w;
y = (num_line-10) * factor_line;
w = 0.15;
pos = [x y w h];
h_min_ratio = uicontrol('parent',h01, ... % Min. Ratio edit
'units','normal', ...
'style','edit', ...
'fontunits','normal', ...
'fontsize',0.55, ...
'horizon','right', ...
'back',[1 1 1], ...
'string', '', ...
'callback','erp_bs_option_ui(''edit_min_ratio'');', ...
'position',pos);
x = left_margin;
y = (num_line-12) * factor_line;
w = 0.3;
pos = [x y w h];
h1 = uicontrol('parent',h01, ... % Max. Ratio label
'units','normal', ...
'style','text', ...
'fontunit','normal', ...
'fontsize', 0.55, ...
'horizon','left', ...
'back',[0.8 0.8 0.8], ...
'string','Maximum Ratio:', ...
'position',pos);
x = x + w;
y = (num_line-12) * factor_line;
w = 0.15;
pos = [x y w h];
h_max_ratio = uicontrol('parent',h01, ... % Max. Ratio edit
'units','normal', ...
'style','edit', ...
'fontunits','normal', ...
'fontsize',0.55, ...
'horizon','right', ...
'back',[1 1 1], ...
'string', '', ...
'callback','erp_bs_option_ui(''edit_max_ratio'');', ...
'position',pos);
%-------------------- selection button -------------------
x = x + w + 0.1;
y = (num_line-12) * factor_line;
w = 0.15;
h = 1 * factor_line;
pos = [x y w h];
h1 = uicontrol('parent',h01, ... % OK button
'unit','normal', ...
'fontunit','normal', ...
'fontsize',0.55, ...
'horizon','center', ...
'string', 'OK', ...
'callback', 'erp_bs_option_ui(''click_ok'');', ...
'position',pos);
x = x + w + 0.05;
pos = [x y w h];
h1 = uicontrol('parent',h01, ... % Cancel button
'unit','normal', ...
'fontunit','normal', ...
'fontsize',0.55, ...
'hor','center', ...
'string', 'Cancel', ...
'callback', 'erp_bs_option_ui(''click_cancel'');', ...
'position',pos);
x = 0.01;
y = 0;
w = 1;
pos = [x y w h];
h1 = uicontrol('parent',h01, ... % Message Line
'style','text', ...
'units','normal', ...
'horizon','left', ...
'fontunit','normal', ...
'fontsize',0.55, ...
'back',[0.8 0.8 0.8], ...
'fore',[0.8 0.0 0.0], ...
'String','', ...
'tag', 'MessageLine', ...
'position',pos);
bs_name = getappdata(h0,'bs_name'); % bs_name string
bs_selection = getappdata(h0,'bs_selection') + 1;
bs_ratio = getappdata(h0,'bs_ratio');
bs_field = getappdata(h0,'bs_field');
set(h_bs_edit, 'value', 1, 'string', char(bs_name));
set(h_bs_disp, 'value', bs_selection, ...
'string', char([{'(none)'} bs_name]));
set(h_p_value, 'string', sprintf('%8.5f', bs_field{1}.p_value));
set(h_thresh, 'string', sprintf('%8.5f', bs_field{1}.thresh));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -