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

📄 pet_result_ui.m

📁 绝对经典,老外制作的功能强大的matlab实现PLS_TOOBOX
💻 M
📖 第 1 页 / 共 5 页
字号:
           'Callback','pet_result_ui(''crosshair'')', ...
   	   'Tag','XhairToggleMenu');
   h2 = uimenu('Parent',h_xhair, ...
   	   'Label','Color ...', ...
	   'Userdata', [1 0 0], ...
           'Callback','pet_result_ui(''set_xhair_color'')', ...
   	   'Tag','XhairColorMenu');

   % Zoom submenu
   %
   h2 = uimenu('Parent',h0, ...
   	   'Label','&Zoom on', ...
	   'Userdata', 1, ...
           'Callback','pet_result_ui(''Zooming'')', ...
   	   'Tag','ZoomToggleMenu');

   % Rotate submenu
   %
   h_rot = uimenu('Parent',h0, ...
   	   'Label','&Image Rotation', ...
   	   'Tag','RotationMenu');
   h2 = uimenu('Parent',h_rot, ...
   	   'Label','&none', ...			% rotate 90 by default
   	   'Checked','on', ...
           'Callback','pet_result_ui(''Rotation'',1)', ...
   	   'Tag','Rotate0Menu');
   h2 = uimenu('Parent',h_rot, ...
   	   'Label','&90 degree', ...		% another 90 degree
   	   'Checked','off', ...
           'Callback','pet_result_ui(''Rotation'',2)', ...
   	   'Tag','Rotate90Menu');
   h2 = uimenu('Parent',h_rot, ...
   	   'Label','&180 degree', ...		% now become 270 degree
   	   'Checked','off', ...
           'Callback','pet_result_ui(''Rotation'',3)', ...
   	   'Tag','Rotate180Menu');
   h2 = uimenu('Parent',h_rot, ...
   	   'Label','&270 degree', ...		% now completed 360 degree
   	   'Checked','off', ...
           'Callback','pet_result_ui(''Rotation'',0)', ...
   	   'Tag','Rotate270Menu');
   h2 = uimenu('Parent',h_rot, ...
   	   'Label','Convert Orientation', ...
	   'separator', 'on', ...
           'Callback','pet_result_ui(''orient'',0)', ...
		'visible', 'off', ...
   	   'Tag','orient');

   %  View submenu
   %
   h_view = uimenu('Parent',h0, ...
   	   'Label','&View', ...
   	   'Tag','ViewMenu', ...
   	   'Visible','on');
   h2 = uimenu('Parent',h_view, ...
   	   'Label','&View Brain LV', ...
	   'Userdata', 1, ...
           'Callback','pet_result_ui(''Toggle_View'')', ...
   	   'Tag','ViewToggleMenu');

   %  Window submenu
   %
   h_pls = uimenu('Parent',h0, ...
   	   'Label','&Windows', ...
   	   'Tag','WindowsMenu', ...
   	   'Visible','on');
   h2 = uimenu(h_pls, ...
           'Label','&Singular Values Plot', ...
     	   'Tag','OpenEigenPlot', ...
           'Callback','pet_result_ui(''OpenEigenPlot'')');
   h2 = uimenu(h_pls, ...
           'Label','&Behavior LV and Behavior Scores Plot', ...
	   'Visible','off', ...
     	   'Tag','OpenBehavPlot', ...
           'Callback','pet_result_ui(''OpenScoresPlot'',0)');
   h2 = uimenu(h_pls, ...
           'Label','&Design LV and Design Scores Plot', ...
	   'Visible','off', ...
     	   'Tag','OpenDesignPlot', ...
           'Callback','pet_result_ui(''OpenScoresPlot'',1)');
   h2 = uimenu(h_pls, ...
           'Label','B&rain Scores vs. Behavior Data Plot', ...
     	   'Tag','OpenBrainPlot', ...
           'Callback','pet_result_ui(''OpenBrainPlot'')'); 
   h2 = uimenu(h_pls, ...
           'Label','&Voxel Intensity Response', ...
     	   'Tag','OpenRFPlot', ...
           'Callback','pet_result_ui(''OpenResponseFnPlot'')'); 
   h2 = uimenu(h_pls, ...
           'Label','&Datamat Correlations Response', ...
     	   'Tag','OpenRF1Plot', ...
           'Callback','pet_result_ui(''OpenCorrelationPlot'')'); 
   h2 = uimenu(h_pls, ...
           'Label','&Datamat Correlations Plot', ...
     	   'Tag','OpenDatamatcorrsPlot', ...
           'Callback','pet_result_ui(''OpenDatamatcorrsPlot'')'); 
   h2 = uimenu(h_pls, ...
           'Label','&Multiple Voxels Extraction', ...
     	   'Tag','MultipleVoxel', ...
           'Callback','pet_result_ui(''MultipleVoxel'')');
   h2 = uimenu(h_pls, ...
           'Label','&Contrasts Information', ...
     	   'Tag','OpenContrastWindow', ...
           'Callback','pet_result_ui(''OpenContrastWindow'')'); 
   h2 = uimenu(h_pls, ...
           'Label','Create Brain LV &Figure', ...
	   'separator', 'on', ...
   	   'Tag','PlotNewFigure', ...
           'Callback','pet_result_ui(''PlotOnNewFigure'')');
   h2 = uimenu('Parent',h_pls, ...
           'Label','Sagittal View Plot', ...
	   'separator', 'on', ...
   	   'Tag','PlotSagittalView', ...
           'Callback','pet_result_ui(''PlotSagittalView'')'); 
   h2 = uimenu('Parent',h_pls, ...
           'Label','Coronal View Plot', ...
   	   'Tag','PlotCoronalView', ...
           'Callback','pet_result_ui(''PlotCoronalView'')'); 
   h2 = uimenu('Parent',h_pls, ...
           'Label','3 Cardinal Plane View', ...
   	   'Tag','Plot3View', ...
           'Callback','pet_result_ui(''Plot3View'')'); 

   %  Report submenu
   %
   h_pls = uimenu('Parent',h0, ...
   	   'Label','&Report', ...
   	   'Tag','WindowsMenu', ...
   	   'Visible','on');
   h2 = uimenu(h_pls, ...
           'Label','&Set Cluster Report Options', ...
     	   'Tag','SetClusterReportOptions', ...
           'Callback','pet_result_ui(''SetClusterReportOptions'')');
   h2 = uimenu(h_pls, ...
           'Label','&Load Cluster Report', ...
     	   'Tag','LoadClsuterReport', ...
           'Callback','pet_result_ui(''LoadClusterReport'')');
   h2 = uimenu(h_pls, ...
           'Label','&Create Cluster Report', ...
     	   'Tag','OpenClusterReport', ...
           'Callback','pet_result_ui(''OpenClusterReport'')');
   h2 = uimenu(h_pls, ...
           'Label','Cluster Mask', ...
	   'separator', 'on', ...
           'check', 'off', ...
	   'Userdata', 1, ...
   	   'Tag','ClusterMask', ...
           'Callback','pet_result_ui(''ClusterMask'')'); 

   %  Help submenu
   %
   Hm_topHelp = uimenu('Parent',h0, ...
           'Label', '&Help', ...
           'Tag', 'Help');

%           'Callback','rri_helpfile_ui(''pet_result_hlp.txt'',''How to use PLS RESULT'');', ...
   Hm_how = uimenu('Parent',Hm_topHelp, ...
           'Label', '&How to use this window?', ...
           'Callback','web([''file:///'', which(''UserGuide.htm''), ''#_Toc128820725'']);', ...
	   'visible', 'on', ...
           'Tag', 'How');

   Hm_new = uimenu('Parent',Hm_topHelp, ...
           'Label', '&What''s new', ...
	   'Callback','rri_helpfile_ui(''whatsnew.txt'',''What''''s new'');', ...
           'Tag', 'New');
   Hm_about = uimenu('Parent',Hm_topHelp, ...
           'Label', '&About this program', ...
           'Tag', 'About', ...
           'CallBack', 'plsgui_version');

   set(gcf,'Name',sprintf('PET PLS Result: %s',PLSResultFile));
%   set(colorbar_h,'units','pixels');

   setappdata(gcf,'Colorbar',colorbar_h);		% newcolor: was commented
   setappdata(gcf,'BlvAxes',axes_h);

   setappdata(gcf,'ClusterMaskSize',4);
   setappdata(gcf,'ClusterMinSize',5);
   setappdata(gcf,'ClusterMinDist',10);
   setappdata(gcf,'template_file', []);
   setappdata(gcf,'img_xhair',[]);

   if isempty(setting) | ~isfield(setting,'rescale')
      set(findobj(gcf,'Tag','RESCALECheckbox'),'value',1);
   else
      set(findobj(gcf,'Tag','RESCALECheckbox'),'value',setting.rescale);
   end;

   setappdata(gcf,'setting',setting);
   setappdata(gcf,'old_setting',setting);
   setappdata(gcf,'actualHRF',1);

   return;						% init


%---------------------------------------------------------------------------
%
function ResizeFigure(fig_w,fig_h)

   fig_pos = get(gcbf,'Position');

   fig_width = fig_pos(3);
   fig_height = fig_pos(4);

   if (fig_width < fig_w),
      fig_pos(3) = fig_w;
      set(gcbf,'Position',fig_pos);
   end;

   if (fig_height < fig_h),
      fig_pos(2) = fig_pos(2)+fig_pos(4) - fig_h;	% temp solution for linux
      fig_pos(4) = fig_h;
      set(gcbf,'Position',fig_pos);
   end;

   h = getappdata(gcbf,'BlvAxes');
   set(h,'Units','pixels');
   axes_pos = get(h,'Position');
%   x_margin = 90; y_margin = 25;
   x_margin = 40; y_margin = 25;

   if fig_w == 440, x_margin = 25; end;

   axes_pos(3) = fig_pos(3) - axes_pos(1) - x_margin;
   axes_pos(4) = fig_pos(4) - axes_pos(2) - y_margin;
   set(h,'Position',axes_pos);
   set(h,'Units','pixels');

   if fig_w == 440, return; end;

%   h = getappdata(gcbf,'Colorbar');
%   set(h,'Units','pixels');
%   colorbar_pos = get(h,'Position');
%   x_margin = 80; y_margin = 25;
%   colorbar_pos(1) = fig_pos(3) - x_margin;
%   colorbar_pos(4) = fig_pos(4) - colorbar_pos(2) - y_margin;
%   set(h,'Position',colorbar_pos);
%   set(h,'Units','pixels');

   %  set all other objects' locations
   %
   if ~isequal(get(gcbf,'Userdata'),'Clone')
      SetObjPosition;
   end;

   return;						% ResizeFigure


%---------------------------------------------------------------------------
%
function DeleteLinkedFigure()

   brain_plot = getappdata(gcf,'brain_plot');
   if ~isempty(brain_plot) & ishandle(brain_plot)
     delete(brain_plot);
   end;

   rf_plot = getappdata(gcbf,'RFPlotHdl');
   if ~isempty(rf_plot) & ishandle(rf_plot)
     delete(rf_plot);
   end;

   rf1_plot = getappdata(gcbf,'RF1PlotHdl');
   if ~isempty(rf1_plot) & ishandle(rf1_plot)
     delete(rf1_plot);
   end;

   bscores_fig = getappdata(gcbf,'BSPlotHdl');
   if ~isempty(bscores_fig) & ishandle(bscores_fig)
     delete(bscores_fig);
   end;

   eigen_fig = getappdata(gcbf,'EigenPlotHdl');
   if ~isempty(eigen_fig) & ishandle(eigen_fig)
     delete(eigen_fig);
   end;

   score_fig = getappdata(gcbf,'ScorePlotHdl');
   if ~isempty(score_fig) & ishandle(score_fig)
     delete(score_fig);
   end;

   datamatcorrs_fig = getappdata(gcbf,'DatamatcorrsPlotHdl');
   if ~isempty(datamatcorrs_fig) & ishandle(datamatcorrs_fig)
     delete(datamatcorrs_fig);
   end;

   brain_fig = getappdata(gcbf,'brain_plot');
   if ~isempty(brain_fig) & ishandle(brain_fig)
     delete(brain_fig);
   end;

   contrast_fig = getappdata(gcbf,'ContrastFigHdl');
   if ~isempty(contrast_fig) & ishandle(contrast_fig)
     delete(contrast_fig);
   end;

   cluster_hdl = getappdata(gcbf,'cluster_hdl');
   if ~isempty(cluster_hdl) & ishandle(cluster_hdl)
     delete(cluster_hdl);
   end;
   
   return;						% DeleteLinkedFigure


%---------------------------------------------------------------------------
%
function SetObjPosition(ObjName)

   f_pos = get(gcf,'Position');
   obj = getappdata(gcf,'ObjPosition');

   % set the positions for all objects
   %
   if ~exist('ObjName','var') | isempty(ObjName)
      for i=1:length(obj),
         obj_pos = obj(i).pos;
         obj_pos(2) = f_pos(4) - obj_pos(2);
	 set(findobj(gcf,'Tag',obj(i).name),'Position',obj_pos);
      end;
      return;
   end;

   % set the position for a specfic object
   %
   i = 1;
   while i < length(obj),
      if strcmp(ObjName,obj(i).name)
	 obj_pos = obj(i).pos;
         obj_pos(2) = f_pos(4) - obj_pos(2);
	 set(findobj(gcf,'Tag',obj(i).name),'Position',obj_pos);
         return;
      end;
      i = i + 1;
   end;

   return;						% SetObjPosition


%---------------------------------------------------------------------------
%
function CreateObjPosRecord()
%
%   set object location, notice that the y value is counted from the top
%   of the figure, instead of bottom as default
%

   obj(1).name   = 'ResultFileLabel';    obj(1).pos =  [19  40  70  16];
   obj(2).name   = 'ResultFile';         obj(2).pos =  [90  40  144 16];
   obj(3).name   = 'LVIndexLabel';       obj(3).pos =  [19  75  55  19];
   obj(4).name   = 'LVIndexEdit';        obj(4).pos =  [77  75  38  23];
   obj(5).name   = 'LVNumberLabel';      obj(5).pos =  [125 75  20  19];
   obj(6).name   = 'LVNumberEdit';       obj(6).pos =  [145 75  38  19];

   obj(7).name   = 'SliceFrame';         obj(7).pos =  [19  184 172 95];
   obj(8).name   = 'FirstSliceLabel';    obj(8).pos =  [40  133 67  19];
   obj(9).name   = 'FirstSlice';         obj(9).pos =  [115 133 57  22];

   obj(10).name  = 'LastSliceLabel';     obj(10).pos = [38  163 67  19];
   obj(11).name  = 'LastSlice';          obj(11).pos = [115 163 57  22];

   obj(12).name  = 'ThresholdFrame';     obj(12).pos = [19  325-111 172 125];
   obj(13).name  = 'BLVTitle';     	 obj(13).pos = [75  213-111 58  19];
   obj(14).name  = 'BLVValueLabel';      obj(14).pos = [28  240-111 76  19];
   obj(15).name  = 'BLVValue';           obj(15).pos = [110 240-111 67  19];
   obj(16).name  = 'ThresholdLabel';     obj(16).pos = [28  265-111 76  19];
   obj(17).name  = 'Threshold';          obj(17).pos = [110 265-111 67  22];
   obj(18).name  = 'MinValueLabel';      obj(18).pos = [28  290-111 76  19];
   obj(19).name  = 'MinValue';           obj(19).pos = [110 290-111 67  22];
   obj(20).name  = 'MaxValueLabel';      obj(20).pos = [28  315-111 76  19];
   obj(21).name  = 'MaxValue';           obj(21).pos = [110 315-111 67  22];

   obj(22).name  = 'BSRatioTitle';     	 obj(22).pos = [60  213-111 90  19];
   obj(23).name  = 'PValueLabel';        obj(23).pos = [30  240-111 105  19];
   obj(24).name  = 'PValue';             obj(24).pos = [132 240-111 56  19];
   obj(25).name  = 'BSThresholdLabel';   obj(25).pos = [28  260-111 76  19];
   obj(26).name  = 'BSThreshold';        obj(26).pos = [110 260-111 67  22];
   obj(27).name  = 'MinRatioLabel';      obj(27).pos = [28  290-111 76  19];
   obj(28).name  = 'MinRatio';           obj(28).pos = [110 290-111 67  22];
   obj(29).name  = 'MaxRatioLabel';      obj(29).pos = [28  315-111 76  19];
   obj(30).name  = 'MaxRatio';           obj(30).pos = [110 315-111 67  22];

   obj(31).name  = 'LocationFrame';      obj(31).pos = [19  420-111 172 85];
   obj(32).name  = 'XYZVoxelLabel';      obj(32).pos = [35  365-111  50 19];
   obj(33).name  = 'XYZVoxel';           obj(33).pos = [75  365-111 105 19];
   obj(34).name  = 'XYZmmLabel';         obj(34).pos = [35  390-111  70 19];
   obj(35).name  = 'XYZmm';              obj(35).pos = [35  408-111 145 19];

   obj(36).name  = 'RESCALECheckbox';    obj(36).pos = [19 347 172 28];
%   obj(37).name  = 'PLOTButton';         obj(37).pos = [50 410 110 40];
   obj(37).name  = 'CLOSEButton';        obj(37).pos = [19 460 172 40];
%   obj(38).name  = 'CLOSEButton';        obj(38).pos = [50 460 110 40];
%   obj(38).name  = 'CLOSEButton';        obj(38).pos = [115 460 67  28];

   setappdata(gcf,'ObjPosition',obj);

   return;						% CreateObjPosRecord



%---------------------------------------------------------------------------
%
function rot_amount = load_pls_result()

   cond_selection = [];

   %  wait message
   old_pointer = get(gcf,'Pointer');
   set(gcf,'Pointer','watch');

   msg = 'Loading PLS result ... please wait';
   set(findobj(gcf,'Tag','MessageLine'),'String',msg);

   h = findobj(gcf,'Tag','ResultFile');
   PLSresultFile = get(h,'UserData');

   load(PLSresultFile);
   rri_changepath('petresult');

   setting = getappdata(gcf,'setting');



   bsr = [];
   if exist('boot_result','var') & ~isempty(boot_result)
      bsr = boot_result.compare;
   end

   if ~isempty(setting) & isfield(setting,'orient')
      dims = setting.orient.dims;
      origin_pattern = setting.orient.pattern;

      old_coord = newcoords;
      new_coord = setting.orient.coords;

      if exist('datamatcorrs_lst','var') & ~isempty(datamatcorrs_lst)
         for i=1:length(datamatcorrs_lst)
            blv = [datamatcorrs_lst{i}]';
            blv = rri_xy_orient_data(blv,old_coord,new_coord,dims,origin_pattern);

⌨️ 快捷键说明

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