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

📄 roi_session_ui.m

📁 国外的一个PLStoolbox,主要用于处理图象,也可以用来回归,欢迎使用
💻 M
📖 第 1 页 / 共 3 页
字号:
function roi_session_ui(varargin)

   if nargin == 0
      if exist('plslog.m','file')
         plslog('Open ROI Session');
         plslog(pwd);
      end

      init;
      return;
   end;

   %  clear the message line,
   %
   h = findobj(gcf,'Tag','MessageLine');
   set(h,'String','');

   action = varargin{1};

   switch action
   case 'flooded_file_radio'
      flooded_file_radio;
   case 'template_image_radio'
      template_image_radio;
   case 'flooded_file_edit'
      msg = 'Click the "Load" button to load Flooded Image File';
      set(findobj(gcf,'Tag','MessageLine'),'String',msg);
   case 'template_image_edit'
      msg = 'Click the "Load" button to load Template Image File';
      set(findobj(gcf,'Tag','MessageLine'),'String',msg);
   case 'template_location_edit'
      msg = 'Click the "Load" button to load ROI Seed Location File';
      set(findobj(gcf,'Tag','MessageLine'),'String',msg);
   case 'edit_compare_edit'
      msg = 'Click the "Load" button for bootstrap compare file';
      set(findobj(gcf,'Tag','MessageLine'),'String',msg);
   case 'select_roi_edit'
      msg = 'Click the "Select ROI" button to select ROI';
      set(findobj(gcf,'Tag','MessageLine'),'String',msg);
   case 'close'
      close(gcf);
   case 'flooded_file_browse'
      flooded_file_browse;
   case 'template_image_browse'
      template_image_browse;
   case 'template_location_browse'
      template_location_browse;
   case 'create_roi_flooded_file'
      create_roi_flooded_file;
   case 'edit_compare'
      edit_compare;
   case 'select_roi'
      select_roi;
   case 'max_value_edit'
      max_value_edit
   case 'min_value_edit'
      min_value_edit
   case 'lv_index_edit'
      lv_index_edit
   case 'threshold_edit'
      threshold_edit
   case 'saveas_fig'
      saveas_fig;
   case 'open_fig'
      open_fig;
   case 'reset1'
      reset1;
   case 'roi_plot'
      roi_plot;
   end;

   return;						% roi_session_ui


%----------------------------------------------------------------------------
function init

   w = 0.6;
   h = 0.7;
   x = (1-w)/2;
   y = (1-h)/2;

   pos = [x y w h];

   h0 = figure('Color',[0.8 0.8 0.8], ...
   	'Units','normal', ...
        'Name','Information to plot ROI', ...
        'NumberTitle','off', ...
        'Menubar', 'none', ...
   	'Position', pos, ...
	'buttondown','roi_session_ui(''fig'');', ...
	'Tag','EditSessionInformation', ...
   	'ToolBar','none');

   % numbers of inputing line excluding 'MessageLine'

   num_inputline = 10;
   factor_inputline = 1/(num_inputline+1);
   fnt = 12;

   x = 0.05;
   y = (num_inputline-4) * factor_inputline;
   w = 0.9;
   h = 4.5 * factor_inputline;

   pos = [x y w h];

   c = uicontrol('Parent',h0, ...		% radio frame
   	'Style','frame', ...
   	'Units','normal', ...
   	'BackgroundColor',[0.7 0.7 0.7], ...
   	'Position',pos, ...
   	'Tag','radio_frame');

   x = 0.1;
   y = (num_inputline-0.5) * factor_inputline;
   w = 0.05;
   h = 0.6 * factor_inputline;

   pos = [x y w h];

   c = uicontrol('Parent',h0, ...		% flooded file radio
   	'Style','radio', ...
   	'Units','normal', ...
   	'BackgroundColor',[0.7 0.7 0.7], ...
   	'FontSize',fnt, ...
   	'Position',pos, ...
	'value',1, ...
	'callback','roi_session_ui(''flooded_file_radio'');', ...
   	'Tag','flooded_file_radio');

   x = x+w;
   y = y-0.01;
   w = 0.3;

   pos = [x y w h];

   c = uicontrol('Parent',h0, ...		% flooded file label
   	'Style','text', ...
   	'Units','normal', ...
   	'BackgroundColor',[0.7 0.7 0.7], ...
   	'FontSize',fnt, ...
   	'HorizontalAlignment','left', ...
   	'Position',pos, ...
   	'String','Flooded Image File:', ...
	'enable', 'on', ...
   	'Tag','flooded_file_label');

   x = x+w;
   y = y+0.01;
   w = 0.3;

   pos = [x y w h];

   c = uicontrol('Parent',h0, ...		% flooded file edit
   	'Style','edit', ...
   	'Units','normal', ...
   	'BackgroundColor',[0.9 0.9 0.9], ...
   	'FontSize',fnt, ...
   	'HorizontalAlignment','left', ...
   	'Position',pos, ...
   	'String','', ...
   	'ButtonDownFcn','roi_session_ui(''flooded_file_edit'');', ...
	'enable', 'inactive', ...
   	'Tag','flooded_file_edit');

   x = x+w+0.01;
   w = 0.12;

   pos = [x y w h];

   c = uicontrol('Parent',h0, ...		% flooded file browse
   	'Units','normal', ...
	'string', 'Load', ...
   	'FontSize',fnt, ...
   	'Position',pos, ...
	'callback','roi_session_ui(''flooded_file_browse'');', ...
	'enable', 'on', ...
   	'Tag','flooded_file_browse');

   x = 0.15;
   y = (num_inputline-1.5) * factor_inputline -0.01;
   w = 0.3;

   pos = [x y w h];

   c = uicontrol('Parent',h0, ...		% template location label
   	'Style','text', ...
   	'Units','normal', ...
   	'BackgroundColor',[0.7 0.7 0.7], ...
   	'FontSize',fnt, ...
   	'HorizontalAlignment','left', ...
   	'Position',pos, ...
   	'String','ROI Seed Location File:', ...
	'enable', 'on', ...
   	'Tag','template_location_label');

   x = x+w;
   y = y+0.01;
   w = 0.3;

   pos = [x y w h];

   c = uicontrol('Parent',h0, ...		% template location edit
   	'Style','edit', ...
   	'Units','normal', ...
   	'BackgroundColor',[0.9 0.9 0.9], ...
   	'FontSize',fnt, ...
   	'HorizontalAlignment','left', ...
   	'Position',pos, ...
   	'String','', ...
   	'ButtonDownFcn','roi_session_ui(''template_location_edit'');', ...
	'enable', 'inactive', ...
   	'Tag','template_location_edit');

   x = x+w+0.01;
   w = 0.12;

   pos = [x y w h];

   c = uicontrol('Parent',h0, ...		% template location browse
   	'Units','normal', ...
	'string', 'Load', ...
   	'FontSize',fnt, ...
   	'Position',pos, ...
	'callback','roi_session_ui(''template_location_browse'');', ...
	'enable', 'on', ...
   	'Tag','template_location_browse');

   x = 0.1;
   y = (num_inputline-2.5) * factor_inputline;
   w = 0.05;
   h = 0.6 * factor_inputline;

   pos = [x y w h];

   c = uicontrol('Parent',h0, ...		% template image radio
   	'Style','radio', ...
   	'Units','normal', ...
   	'BackgroundColor',[0.7 0.7 0.7], ...
   	'FontSize',fnt, ...
   	'Position',pos, ...
	'callback','roi_session_ui(''template_image_radio'');', ...
   	'Tag','template_image_radio');

   x = x+w;
   y = y-0.01;
   w = 0.3;

   pos = [x y w h];

   c = uicontrol('Parent',h0, ...		% template image label
   	'Style','text', ...
   	'Units','normal', ...
   	'BackgroundColor',[0.7 0.7 0.7], ...
   	'FontSize',fnt, ...
   	'HorizontalAlignment','left', ...
   	'Position',pos, ...
   	'String','Template Image File:', ...
	'enable', 'off', ...
   	'Tag','template_image_label');

   x = x+w;
   y = y+0.01;
   w = 0.3;

   pos = [x y w h];

   c = uicontrol('Parent',h0, ...		% template image edit
   	'Style','edit', ...
   	'Units','normal', ...
   	'BackgroundColor',[0.9 0.9 0.9], ...
   	'FontSize',fnt, ...
   	'HorizontalAlignment','left', ...
   	'Position',pos, ...
   	'String','', ...
   	'ButtonDownFcn','roi_session_ui(''template_image_edit'');', ...
	'enable', 'off', ...
   	'Tag','template_image_edit');

   x = x+w+0.01;
   w = 0.12;

   pos = [x y w h];

   c = uicontrol('Parent',h0, ...		% template image browse
   	'Units','normal', ...
	'string', 'Load', ...
   	'FontSize',fnt, ...
   	'Position',pos, ...
	'callback','roi_session_ui(''template_image_browse'');', ...
	'enable', 'off', ...
   	'Tag','template_image_browse');

   x = 0.3;
   y = (num_inputline-3.5) * factor_inputline -0.01;
   w = 0.35;

   pos = [x y w h];

   c = uicontrol('Parent',h0, ...		% create roi flooded file
   	'Units','normal', ...
	'string', 'Create Flooded Image File', ...
   	'FontSize',fnt, ...
   	'Position',pos, ...
	'callback','roi_session_ui(''create_roi_flooded_file'');', ...
	'enable', 'off', ...
   	'Tag','create_roi_flooded_file');

   x = 0.15;
   y = (num_inputline-5) * factor_inputline;
   w = 0.3;

   pos = [x y w h];

   c = uicontrol('Parent',h0, ...		% edit compare label
   	'Style','text', ...
   	'Units','normal', ...
   	'BackgroundColor',[0.8 0.8 0.8], ...
   	'FontSize',fnt, ...
   	'HorizontalAlignment','left', ...
   	'Position',pos, ...
   	'String','Bootstrap Compare File:', ...
	'enable', 'on', ...
   	'Tag','edit_compare_label');

   x = x+w;
   y = y+0.01;
   w = 0.3;

   pos = [x y w h];

   c = uicontrol('Parent',h0, ...		% edit compare edit
   	'Style','edit', ...
   	'Units','normal', ...
   	'BackgroundColor',[0.9 0.9 0.9], ...
   	'FontSize',fnt, ...
   	'HorizontalAlignment','left', ...
   	'Position',pos, ...
   	'String','', ...
   	'ButtonDownFcn','roi_session_ui(''edit_compare_edit'');', ...
	'enable', 'inactive', ...
   	'Tag','edit_compare_edit');

   x = x+w+0.01;
   w = 0.12;

   pos = [x y w h];

   c = uicontrol('Parent',h0, ...		% edit compare
   	'Units','normal', ...
	'string', 'Load', ...
   	'FontSize',fnt, ...
   	'Position',pos, ...
	'callback','roi_session_ui(''edit_compare'');', ...
	'enable', 'off', ...
   	'Tag','edit_compare');

   x = 0.15;
   y = (num_inputline-6) * factor_inputline;
   w = 0.3;

   pos = [x y w h];

   c = uicontrol('Parent',h0, ...		% select roi label
   	'Style','text', ...
   	'Units','normal', ...
   	'BackgroundColor',[0.8 0.8 0.8], ...
   	'FontSize',fnt, ...
   	'HorizontalAlignment','left', ...
   	'Position',pos, ...
   	'String','Number of Selected ROI:', ...
	'enable', 'on', ...
   	'Tag','select_roi_label');

   x = x+w;
   y = y+0.01;
   w = 0.1;

   pos = [x y w h];

   c = uicontrol('Parent',h0, ...		% select roi edit
   	'Style','edit', ...
   	'Units','normal', ...
   	'BackgroundColor',[0.9 0.9 0.9], ...
   	'FontSize',fnt, ...
   	'HorizontalAlignment','left', ...
   	'Position',pos, ...
   	'String','0', ...
   	'ButtonDownFcn','roi_session_ui(''select_roi_edit'');', ...
	'enable', 'inactive', ...
   	'Tag','select_roi_edit');

   x = x+w+0.01;
   w = 0.3;

   pos = [x y w h];

   c = uicontrol('Parent',h0, ...		% select roi
   	'Units','normal', ...
	'string', 'Select ROIs', ...
   	'FontSize',fnt, ...
   	'Position',pos, ...
	'callback','roi_session_ui(''select_roi'');', ...
	'enable', 'off', ...

⌨️ 快捷键说明

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