⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 erp_plot_option_ui.m

📁 绝对经典,老外制作的功能强大的matlab实现PLS_TOOBOX
💻 M
📖 第 1 页 / 共 3 页
字号:
%ERP_PLOT_OPTION_UI Option window for plotting ERP waveforms
%
%  USAGE: option_fig = erp_plot_option_ui
%
%   ERP_PLOT_UI will display option window
%

%   Called by ERP_PLOT_UI
%
%   O (h01) - handle of option figure
%
%   Created on 26-NOV-2002 by Jimmy Shen
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function h01 = erp_plot_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_subj_in_cond')
      select_subj_in_cond;
   elseif strcmp(action,'select_cond_in_subj')
      select_cond_in_subj;
   elseif strcmp(action,'select_subj_in_cond_grp_corr')
      select_subj_in_cond_grp_corr;
   elseif strcmp(action,'select_subj_in_cond_grp')
      select_subj_in_cond_grp;
   elseif strcmp(action,'select_cond_in_subj_grp_corr')
      select_cond_in_subj_grp_corr;
   elseif strcmp(action,'select_cond_in_subj_grp')
      select_cond_in_subj_grp;
   elseif strcmp(action,'select_subj_in_cond_grp_corr_hdl')
      select_subj_in_cond_grp_corr_hdl;
   elseif strcmp(action,'select_subj_in_cond_grp_hdl')
      select_subj_in_cond_grp_hdl;
   elseif strcmp(action,'select_cond_in_subj_grp_corr_hdl')
      select_cond_in_subj_grp_corr_hdl;
   elseif strcmp(action,'select_cond_in_subj_grp_hdl')
      select_cond_in_subj_grp_hdl;
   elseif strcmp(action,'select_x_tick_interval')
      select_x_tick_interval;
   elseif strcmp(action,'select_y_tick_interval')
      select_y_tick_interval;
   elseif strcmp(action,'select_rescale')
      select_rescale;
   elseif strcmp(action,'click_ok')
      click_ok;
   elseif strcmp(action,'click_cancel')
      close(gcf);
   elseif strcmp(action,'delete_fig')
      delete_fig(varargin{2});
   end

   return;					% erp_plot_option_ui


%
%  initialize GUI
%
%-------------------------------------------------------------

function h01 = init(h0)

   view_option = getappdata(h0,'view_option');

   save_setting_status = 'on';
   erp_plot_option_pos = [];
   erp_plot_option1_pos = [];

   try
      load('pls_profile');
   catch
   end

   if view_option == 1
      if ~isempty(erp_plot_option1_pos) & strcmp(save_setting_status,'on')
         pos = erp_plot_option1_pos;
      else
         w = 0.6;
         h = 0.81;
         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','Display Options', ...
         'deletefcn','erp_plot_option_ui(''delete_fig'',1);', ...
         'tag','option_fig', ...
         'position', pos);
   else
      if ~isempty(erp_plot_option_pos) & strcmp(save_setting_status,'on')
         pos = erp_plot_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','Display Options', ...
         'deletefcn','erp_plot_option_ui(''delete_fig'',0);', ...
         'tag','option_fig', ...
         'position', pos);
   end

   % numbers of lines excluding 'MessageLine'

   top_margin = 0.05;
   left_margin = 0.05;
   num_line = 14;
   factor_line = (1-top_margin)/(num_line+1);

   if view_option == 1

      num_line = 20;
      factor_line = (1-top_margin)/(num_line+1);

      %----------------------- avg wave selection -----------------------

      x = 0;
      y = (num_line-0) * factor_line;
      w = 1;
      h = 1 * factor_line;

      pos = [x y w h];

      h1 = uicontrol('parent',h01, ...             % avg selection label
        'units','normal', ...
        'style','text', ...
        'fontunit','normal', ...
        'fontsize',0.55, ...
        'back',[0.8 0.8 0.8], ...
        'string','Select Grand Average to Display', ...
        'position',pos);

      x = left_margin;
      y = (num_line-4)*factor_line;
      w = 1 - 2*left_margin;
      h = 4 * factor_line;

      pos = [x y w h];

      avg_lst_hdl = uicontrol('parent',h01, ... % avg selection listbox
        'unit','normal', ...
        'style','listbox', ...
        'fontunit','normal', ...
        'fontsize',0.144, ...
        'max',2, ...
        'position',pos);

      num_line = 14;

   else
      avg_lst_hdl = [];
   end

   %----------------------- wave selection ---------------------------

   x = 0;
   y = (num_line-0) * factor_line;
   w = 1;
   h = 1 * factor_line;

   pos = [x y w h];

   h1 = uicontrol('parent',h01, ...		% wave selection label
        'units','normal', ...
        'style','text', ...
	'fontunit','normal', ...
	'fontsize',0.55, ...
	'back',[0.8 0.8 0.8], ...
        'string','Select Wave to Display', ...
        'position',pos);

   x = left_margin;
   y = (num_line-4)*factor_line;
   w = 1 - 2*left_margin;
   h = 4 * factor_line;

   pos = [x y w h];

   wave_lst_hdl = uicontrol('parent',h01, ...	% wave selection 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];

   select_all_hdl = uicontrol('parent',h01, ...	% wave selection selectall
	'unit','normal', ...
	'style','push', ...
	'fontunit','normal', ...
	'fontsize',0.55, ...
	'string','Select All Waves', ...
	'callback', 'erp_plot_option_ui(''select_all'');', ...
	'position',pos);

   x = left_margin + 0.55;
   y = (num_line-8)*factor_line;
   w = 0.35;
   h = 1 * factor_line;

   pos = [x y w h];

   rescale_hdl = uicontrol('Parent',h01, ...		% rescale button
   	'units','normal', ...
	'style','check', ...
	'fontunit','normal', ...
   	'fontsize',0.55, ...
        'horizon','left', ...
        'back', [.8 .8 .8], ...
   	'string','Scale by Singular Value', ...
        'value', 1, ...
	'callback', 'erp_plot_option_ui(''select_rescale'');', ...
	'visible', 'off', ...
        'position',pos);

   x = left_margin + 0.55;
   y = (num_line-8)*factor_line;
   w = 0.12;
   h = 1 * factor_line;

   pos = [x y w h];

   subj_in_cond_grp_corr = uicontrol('parent',h01, ...
        'units','normal', ...
        'style','popupmenu', ...
        'fontunits','normal', ...
        'fontsize',0.55, ...
        'horizon','left', ...
        'back', [1 1 1], ...
	'string',[' '], ...
        'value', 1, ...
	'callback', 'erp_plot_option_ui(''select_subj_in_cond_grp_corr'');', ...
	'visible', 'off', ...
        'position',pos);

   subj_in_cond_grp = uicontrol('parent',h01, ...
        'units','normal', ...
        'style','popupmenu', ...
        'fontunits','normal', ...
        'fontsize',0.55, ...
        'horizon','left', ...
        'back', [1 1 1], ...
	'string',[' '], ...
        'value', 1, ...
	'callback', 'erp_plot_option_ui(''select_subj_in_cond_grp'');', ...
	'visible', 'off', ...
        'position',pos);

   subj_in_cond_lbl = uicontrol('parent',h01, ...% select all subj in cond1
	'unit','normal', ...
	'style','text', ...
	'fontunit','normal', ...
	'fontsize',0.55, ...
        'back',[0.8 0.8 0.8], ...
	'horizon','left', ...
	'string','All Subj in:', ...
	'visible', 'off', ...
	'position',pos);

   x = x + w;
   w = 0.23;

   pos = [x y w h];

   subj_in_cond_hdl = uicontrol('parent',h01, ...
        'units','normal', ...
        'style','popupmenu', ...
        'fontunits','normal', ...
        'fontsize',0.55, ...
        'horizon','left', ...
        'back', [1 1 1], ...
	'string',[' '], ...
        'value', 1, ...
	'callback', 'erp_plot_option_ui(''select_subj_in_cond'');', ...
	'visible', 'off', ...
        'position',pos);

   subj_in_cond_grp_corr_hdl = uicontrol('parent',h01, ...
        'units','normal', ...
        'style','popupmenu', ...
        'fontunits','normal', ...
        'fontsize',0.55, ...
        'horizon','left', ...
        'back', [1 1 1], ...
	'string',[' '], ...
        'value', 1, ...
	'callback', 'erp_plot_option_ui(''select_subj_in_cond_grp_corr_hdl'');', ...
	'visible', 'off', ...
        'position',pos);

   subj_in_cond_grp_hdl = uicontrol('parent',h01, ...
        'units','normal', ...
        'style','popupmenu', ...
        'fontunits','normal', ...
        'fontsize',0.55, ...
        'horizon','left', ...
        'back', [1 1 1], ...
	'string',[' '], ...
        'value', 1, ...
	'callback', 'erp_plot_option_ui(''select_subj_in_cond_grp_hdl'');', ...
	'visible', 'off', ...
        'position',pos);

   x = left_margin + 0.55;
   y = (num_line-10)*factor_line;
   w = 0.12;
   h = 1 * factor_line;

   pos = [x y w h];

   cond_in_subj_grp_corr = uicontrol('parent',h01, ...
        'units','normal', ...
        'style','popupmenu', ...
        'fontunits','normal', ...
        'fontsize',0.55, ...
        'horizon','left', ...
        'back', [1 1 1], ...
	'string',[' '], ...
        'value', 1, ...
	'callback', 'erp_plot_option_ui(''select_cond_in_subj_grp_corr'');', ...
	'visible', 'off', ...
        'position',pos);

   cond_in_subj_grp = uicontrol('parent',h01, ...
        'units','normal', ...
        'style','popupmenu', ...
        'fontunits','normal', ...
        'fontsize',0.55, ...
        'horizon','left', ...
        'back', [1 1 1], ...
	'string',[' '], ...
        'value', 1, ...
	'callback', 'erp_plot_option_ui(''select_cond_in_subj_grp'');', ...
	'visible', 'off', ...
        'position',pos);

   cond_in_subj_lbl = uicontrol('parent',h01, ...% select all cond in subj1
	'unit','normal', ...
	'style','text', ...
	'fontunit','normal', ...
	'fontsize',0.55, ...
        'back',[0.8 0.8 0.8], ...
	'horizon','left', ...
	'string','All Cond in:', ...
	'visible', 'off', ...
	'position',pos);

   x = x + w;
   w = 0.23;

   pos = [x y w h];

   cond_in_subj_hdl = uicontrol('parent',h01, ...
        'units','normal', ...
        'style','popupmenu', ...
        'fontunits','normal', ...
        'fontsize',0.55, ...
        'horizon','left', ...
        'back', [1 1 1], ...
	'string',[' '], ...
        'value', 1, ...
	'callback', 'erp_plot_option_ui(''select_cond_in_subj'');', ...
	'visible', 'off', ...
        'position',pos);

   cond_in_subj_grp_corr_hdl = uicontrol('parent',h01, ...
        'units','normal', ...
        'style','popupmenu', ...
        'fontunits','normal', ...
        'fontsize',0.55, ...
        'horizon','left', ...
        'back', [1 1 1], ...
	'string',[' '], ...
        'value', 1, ...
	'callback', 'erp_plot_option_ui(''select_cond_in_subj_grp_corr_hdl'');', ...
	'visible', 'off', ...
        'position',pos);

   cond_in_subj_grp_hdl = uicontrol('parent',h01, ...
        'units','normal', ...
        'style','popupmenu', ...
        'fontunits','normal', ...
        'fontsize',0.55, ...
        'horizon','left', ...
        'back', [1 1 1], ...
	'string',[' '], ...
        'value', 1, ...
	'callback', 'erp_plot_option_ui(''select_cond_in_subj_grp_hdl'');', ...
	'visible', 'off', ...
        'position',pos);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -