view_roi_results - view the results of an ROI computation through a GUI Usage: handle = view_roi_results('gui_data', ROIs) ROI computations spit out a number of different graphs. In order to easily view these results, along with proper graph labeling, we wrote view_roi_results. To use, you must simply give two parameters: 'gui_data', to tell the program that you are passing extra data to the function, and a ROIs structure with the appropriate elements filled. Note that much of this program is the result of code generated by Matlab's GUIDE tool and may or may not work on versions of Matlab earlier than R13. Within view_roi_results, view the items under the "Help" menu for more information on how to use the program. This function is part of froi, available from http://froi.sourceforge.net, and is goverened by the Artistic License. $Id: view_roi_results.m,v 1.3 2003/10/06 16:01:40 nknouf Exp $
This function calls:
This function is called by:
0001 function varargout = view_roi_results(varargin) 0002 % view_roi_results - view the results of an ROI computation through a GUI 0003 % 0004 % Usage: handle = view_roi_results('gui_data', ROIs) 0005 % 0006 % ROI computations spit out a number of different graphs. In order to 0007 % easily view these results, along with proper graph labeling, we wrote 0008 % view_roi_results. To use, you must simply give two parameters: 'gui_data', 0009 % to tell the program that you are passing extra data to the function, and 0010 % a ROIs structure with the appropriate elements filled. Note that much of 0011 % this program is the result of code generated by Matlab's GUIDE tool and 0012 % may or may not work on versions of Matlab earlier than R13. 0013 % 0014 % Within view_roi_results, view the items under the "Help" menu for more 0015 % information on how to use the program. 0016 % 0017 % This function is part of froi, available from http://froi.sourceforge.net, 0018 % and is goverened by the Artistic License. 0019 % 0020 % $Id: view_roi_results.m,v 1.3 2003/10/06 16:01:40 nknouf Exp $ 0021 0022 % Begin initialization code 0023 gui_Singleton = 1; 0024 gui_State = struct('gui_Name', mfilename, ... 0025 'gui_Singleton', gui_Singleton, ... 0026 'gui_OpeningFcn', @view_roi_results_OpeningFcn, ... 0027 'gui_OutputFcn', @view_roi_results_OutputFcn, ... 0028 'gui_LayoutFcn', @view_roi_results_LayoutFcn, ... 0029 'gui_Callback', [], ... 0030 'gui_data', []); 0031 if nargin & isstr(varargin{1}) 0032 gui_State.gui_Callback = str2func(varargin{1}); 0033 end 0034 0035 if nargout 0036 [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); 0037 else 0038 gui_mainfcn(gui_State, varargin{:}); 0039 end 0040 % End initialization code 0041 0042 0043 % --- Executes just before view_roi_results is made visible. 0044 function view_roi_results_OpeningFcn(hObject, eventdata, handles, varargin) 0045 % This function has no output args, see OutputFcn. 0046 % hObject handle to figure 0047 % eventdata reserved - to be defined in a future version of MATLAB 0048 % handles structure with handles and user data (see GUIDATA) 0049 % varargin command line arguments to view_roi_results (see VARARGIN) 0050 global ROIs; 0051 % Choose default command line output for view_roi_results 0052 handles.output = hObject; 0053 0054 % Update handles structure 0055 guidata(hObject, handles); 0056 0057 % UIWAIT makes view_roi_results wait for user response (see UIRESUME) 0058 % uiwait(handles.main); 0059 0060 if(~isempty(varargin)) 0061 if (strncmp('gui_data', varargin{1}, 8)) 0062 ROIs = varargin{2}; 0063 0064 try 0065 numVoxels = ROIs.numVoxels; 0066 catch 0067 oops(1000); 0068 end 0069 0070 info = parse_results; 0071 set(handles.scan_info_box, 'String', info.scan_string); 0072 set(handles.roi_info_box, 'String', info.roi_string); 0073 set(handles.results_popupmenu, 'String', info.results_string); 0074 end 0075 end 0076 0077 % --- Outputs from this function are returned to the command line. 0078 function varargout = view_roi_results_OutputFcn(hObject, eventdata, handles) 0079 % varargout cell array for returning output args (see VARARGOUT); 0080 % hObject handle to figure 0081 % eventdata reserved - to be defined in a future version of MATLAB 0082 % handles structure with handles and user data (see GUIDATA) 0083 0084 % Get default command line output from handles structure 0085 varargout{1} = handles.output; 0086 0087 0088 % -------------------------------------------------------------------- 0089 function file_menu_Callback(hObject, eventdata, handles) 0090 % hObject handle to file_menu (see GCBO) 0091 % eventdata reserved - to be defined in a future version of MATLAB 0092 % handles structure with handles and user data (see GUIDATA) 0093 0094 0095 % -------------------------------------------------------------------- 0096 function open_menu_Callback(hObject, eventdata, handles) 0097 % hObject handle to open_menu (see GCBO) 0098 % eventdata reserved - to be defined in a future version of MATLAB 0099 % handles structure with handles and user data (see GUIDATA) 0100 global info; 0101 global ROIs; 0102 curdir = pwd; 0103 [info.fname info.pname] = uigetfile('*.mat', 'Open Results'); 0104 %%cd(curdir); 0105 fprintf('filename: %s\npathname: %s', info.fname, info.pname); 0106 if(info.fname ~= 0) 0107 cmd = sprintf('load -mat %s%s', info.pname, info.fname); 0108 eval(cmd); 0109 %% the try...catch block below ensures that we have an actual 0110 %% ROI results structure 0111 try 0112 numVoxels = ROIs.numVoxels; 0113 catch 0114 oops(1000); 0115 end 0116 info = parse_results; 0117 set(handles.scan_info_box, 'String', info.scan_string); 0118 set(handles.roi_info_box, 'String', info.roi_string); 0119 set(handles.results_popupmenu, 'String', info.results_string); 0120 else return; 0121 end 0122 0123 0124 0125 % -------------------------------------------------------------------- 0126 function quit_menu_Callback(hObject, eventdata, handles) 0127 % hObject handle to quit_menu (see GCBO) 0128 % eventdata reserved - to be defined in a future version of MATLAB 0129 % handles structure with handles and user data (see GUIDATA) 0130 close(handles.main); 0131 return; 0132 0133 0134 % --- Executes during object creation, after setting all properties. 0135 function results_popupmenu_CreateFcn(hObject, eventdata, handles) 0136 % hObject handle to results_popupmenu (see GCBO) 0137 % eventdata reserved - to be defined in a future version of MATLAB 0138 % handles empty - handles not created until after all CreateFcns called 0139 0140 % Hint: popupmenu controls usually have a white background on Windows. 0141 % See ISPC and COMPUTER. 0142 if ispc 0143 set(hObject,'BackgroundColor','white'); 0144 else 0145 set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); 0146 end 0147 0148 0149 % --- Executes on selection change in results_popupmenu. 0150 function results_popupmenu_Callback(hObject, eventdata, handles) 0151 % hObject handle to results_popupmenu (see GCBO) 0152 % eventdata reserved - to be defined in a future version of MATLAB 0153 % handles structure with handles and user data (see GUIDATA) 0154 0155 % Hints: contents = get(hObject,'String') returns results_popupmenu contents as cell array 0156 % contents{get(hObject,'Value')} returns selected item from results_popupmenu 0157 global info; 0158 global ROIs; 0159 val = get(hObject,'Value'); 0160 if (findstr(info.designtype, 'event')) 0161 switch val 0162 case 1 0163 return; 0164 case 2 0165 h = figure; 0166 plot(ROIs.ROImean); 0167 title('ROI Mean'); 0168 set_figure(h, 1, ROIs); 0169 case 3 0170 h = figure; 0171 errorbar(ROIs.ROImean, ROIs.ROIstd); 0172 title('ROI Mean with Standard Deviation'); 0173 set_figure(h, 1, ROIs); 0174 case 4 0175 h = figure; 0176 errorbar(ROIs.ROImean, ROIs.ROIstderr); 0177 title('ROI Mean with Standard Error'); 0178 set_figure(h, 1, ROIs); 0179 case 5 0180 h = figure; 0181 plot(ROIs.ROIpct); 0182 title('ROI Percent Signal Change'); 0183 set_figure(h, 2, ROIs); 0184 case 6, 0185 h = figure; 0186 errorbar(ROIs.ROIpct, ROIs.ROIpctstd); 0187 title('ROI Percent Signal Change with Standard Deviation'); 0188 set_figure(h, 2, ROIs); 0189 case 7, 0190 h = figure; 0191 errorbar(ROIs.ROIpct, ROIs.ROIpctstderr); 0192 title('ROI Percent Signal Change with Standard Error'); 0193 set_figure(h, 2, ROIs); 0194 end 0195 elseif (findstr(info.designtype, 'blocked')) 0196 x = [0:ROIs.nconditions]; 0197 switch val 0198 case 1 0199 return; 0200 case 2 0201 view_blocked_results('gui_data', ROIs); 0202 case 3, 0203 h = figure; 0204 plot(x, ROIs.ROIhavg); 0205 title('ROI Mean with Standard Deviation'); 0206 set_figure(h, 1, ROIs); 0207 case 4 0208 h = figure; 0209 errorbar(x, ROIs.ROIhavg, ROIs.ROIhstd); 0210 title('ROI Mean with Standard Deviation'); 0211 set_figure(h, 1, ROIs); 0212 case 5 0213 h = figure; 0214 errorbar(x, ROIs.ROIhavg, ROIs.ROIhstderr); 0215 title('ROI Mean with Standard Error'); 0216 set_figure(h, 1, ROIs); 0217 case 6 0218 h = figure; 0219 plot(x, ROIs.ROIpct); 0220 title('ROI Percent Signal Change'); 0221 set_figure(h, 2, ROIs); 0222 case 7, 0223 h = figure; 0224 errorbar(x, ROIs.ROIpct, ROIs.ROIpctstd); 0225 title('ROI Percent Signal Change with Standard Deviation'); 0226 set_figure(h, 2, ROIs); 0227 case 8, 0228 h = figure; 0229 errorbar(x, ROIs.ROIpct, ROIs.ROIpctstderr); 0230 title('ROI Percent Signal Change with Standard Error'); 0231 set_figure(h, 2, ROIs); 0232 end 0233 end 0234 return; 0235 0236 function set_figure(h, type, ROIs) 0237 %% sets some figure properties standard to all ROI figures 0238 switch type 0239 case 1, 0240 ylabel('ROI Response (scanner units)'); 0241 case 2, 0242 ylabel('ROI Response (percent signal change)'); 0243 end 0244 if (findstr(ROIs.designtype, 'event')) 0245 xlabel('Time (seconds)'); 0246 legend(ROIs.legendCond, 2); 0247 elseif (findstr(ROIs.designtype, 'blocked')) 0248 xlabel('Condition Number (fixation: 0)'); 0249 end 0250 0251 return; 0252 0253 0254 % --- Executes on button press in display_button. 0255 function display_button_Callback(hObject, eventdata, handles) 0256 % hObject handle to display_button (see GCBO) 0257 % eventdata reserved - to be defined in a future version of MATLAB 0258 % handles structure with handles and user data (see GUIDATA) 0259 figure; 0260 return; 0261 0262 0263 % -------------------------------------------------------------------- 0264 function help_menu_Callback(hObject, eventdata, handles) 0265 % hObject handle to help_menu (see GCBO) 0266 % eventdata reserved - to be defined in a future version of MATLAB 0267 % handles structure with handles and user data (see GUIDATA) 0268 0269 0270 % -------------------------------------------------------------------- 0271 function bugs_Callback(hObject, eventdata, handles) 0272 % hObject handle to how_to (see GCBO) 0273 % eventdata reserved - to be defined in a future version of MATLAB 0274 % handles structure with handles and user data (see GUIDATA) 0275 s = sprintf('To report bugs, give comments, or suggest a feature, please\n'); 0276 s = sprintf('%se-mail froi-bugs@sourceforge.net to enter your request\n',s); 0277 s = sprintf('%sinto our database.\n\n', s); 0278 s = sprintf('%sTo join a low-volume mailing list for froi announcements,\n', s); 0279 s = sprintf('%ssend an e-mail to froi-announce-request@sourceforge.net\n', s); 0280 s = sprintf('%swith the word subscribe in the subject.\n\n', s); 0281 s = sprintf('%sTo join a mailing list for discussions with other\n', s); 0282 s = sprintf('%sfroi users, send an e-mail to\n', s); 0283 s = sprintf('%sfroi-users-request@sourceforge.net with the word\n', s); 0284 s = sprintf('%ssubscribe in the subject line.\n', s); 0285 msgbox(s, 'Bugs, Comments, Suggestions'); 0286 return; 0287 0288 % -------------------------------------------------------------------- 0289 function scan_information_Callback(hObject, eventdata, handles) 0290 % hObject handle to how_to (see GCBO) 0291 % eventdata reserved - to be defined in a future version of MATLAB 0292 % handles structure with handles and user data (see GUIDATA) 0293 s = sprintf('The left panel of the main window, entitled\n'); 0294 s = sprintf('%s''Scan Information'', gives a number of\n', s); 0295 s = sprintf('%simportant parameters for the scans in question, including\n', s); 0296 s = sprintf('%stype of design, matrix size, number of slices, gamma-fit\n', s); 0297 s = sprintf('%sparamters (if present), and so on.\n\n', s); 0298 s = sprintf('%sIf something seems wrong with the results of your\n', s); 0299 s = sprintf('%sanalysis, check here first to ensure that you provided\n', s); 0300 s = sprintf('%sthe correct parameters.\n', s); 0301 msgbox(s, 'Scan Information Help'); 0302 return; 0303 0304 % -------------------------------------------------------------------- 0305 function roi_information_Callback(hObject, eventdata, handles) 0306 % hObject handle to how_to (see GCBO) 0307 % eventdata reserved - to be defined in a future version of MATLAB 0308 % handles structure with handles and user data (see GUIDATA) 0309 s = sprintf('In the panel entitled ''ROI Information'', you will find\n'); 0310 s = sprintf('%sinformation about the ROI used to compute these results.\n', s); 0311 s = sprintf('%sIf your results do not seem like they make sense, ensure\n', s); 0312 s = sprintf('%sthat the correct information is shown here, as well as\n', s); 0313 s = sprintf('%sdoing a sanity check on the number of voxels, etc.\n', s); 0314 msgbox(s, 'ROI Information'); 0315 return; 0316 0317 % -------------------------------------------------------------------- 0318 function viewing_results_Callback(hObject, eventdata, handles) 0319 % hObject handle to how_to (see GCBO) 0320 % eventdata reserved - to be defined in a future version of MATLAB 0321 % handles structure with handles and user data (see GUIDATA) 0322 s = sprintf('You can view the results of the ROI computations through the\n'); 0323 s = sprintf('%spulldown menu in the ''ROI Results'' panel on the right\n', s); 0324 s = sprintf('%sside of the window.\n\n', s); 0325 s = sprintf('%sIf you used a blocked design, the first\n', s); 0326 s = sprintf('%smenu item will be ''ROI Mean Time Course Graphs'' which\n', s); 0327 s = sprintf('%swill open a new window to display the mean time-course\n', s); 0328 s = sprintf('%sover your ROI for each run.\n\n', s); 0329 s = sprintf('%sFor all analysis types, there will be six other graphs\n', s); 0330 s = sprintf('%savailable. In order, they are:\n\n', s); 0331 s = sprintf('%sMean response (no errors)\n', s); 0332 s = sprintf('%sMean response (with standard deviation)\n', s); 0333 s = sprintf('%sMean response (with standard error)\n', s); 0334 s = sprintf('%sPercent Signal Change (no errors)\n', s); 0335 s = sprintf('%sPercent Signal Change (with standard deviation)\n', s); 0336 s = sprintf('%sPercent Signal Change (with standard error)\n\n', s); 0337 s = sprintf('%sFor gammafit analyses, there will be one point for each\n', s); 0338 s = sprintf('%scondition, while for FIR analyses, there will be\n', s); 0339 s = sprintf('%sone point per time-point, and all conditions will\n', s); 0340 s = sprintf('%sbe displayed at the same time.\n', s); 0341 msgbox(s, 'Viewing Results'); 0342 return; 0343 0344 % -------------------------------------------------------------------- 0345 function about_menu_Callback(hObject, eventdata, handles) 0346 % hObject handle to about_menu (see GCBO) 0347 % eventdata reserved - to be defined in a future version of MATLAB 0348 % handles structure with handles and user data (see GUIDATA) 0349 about = sprintf('\t\tfroi -- FS-FAST ROI\t\t\n'); 0350 about = sprintf('%s\n',about); 0351 about = sprintf('%sThis visualization tool was written by Nicholas Knouf <nknouf@mit.edu>.\n', about); 0352 about = sprintf('%sfroi is Copyright (c) 2003, Nicholas Knouf & MIT, and is licensed under the Artistic License.\n\n', about); 0353 about = sprintf('%sfroi would not have been possible without the comments,\n', about); 0354 about = sprintf('%ssuggestions, and bug reports of members of the\n', about); 0355 about = sprintf('%sKanwisher Lab: Chris Baker, Jia Liu, Mike Mangini,\n', about); 0356 about = sprintf('%sGalit Yovel, and Nancy Kanwisher. As well,\n', about); 0357 about = sprintf('%sI''d like to thank Doug Greve for allowing me\n', about); 0358 about = sprintf('%sto include code written by him in the froi distribution.\n\n', about); 0359 about = sprintf('%sfroi can be obtained from http://froi.sourceforge.net.', about); 0360 msgbox(about, 'About froi'); 0361 return; 0362 0363 0364 % --- Executes during object creation, after setting all properties. 0365 function main_CreateFcn(hObject, eventdata, handles) 0366 % hObject handle to main (see GCBO) 0367 % eventdata reserved - to be defined in a future version of MATLAB 0368 % handles empty - handles not created until after all CreateFcns called 0369 0370 0371 0372 0373 % --- Creates and returns a handle to the GUI figure. 0374 function h1 = view_roi_results_LayoutFcn(policy) 0375 % policy - create a new figure or use a singleton. 'new' or 'reuse'. 0376 0377 persistent hsingleton; 0378 if strcmpi(policy, 'reuse') & ishandle(hsingleton) 0379 h1 = hsingleton; 0380 return; 0381 end 0382 0383 %%'Position',[103.8 30.8186813186813 106.833333333333 30.6428571428571],... 0384 h1 = figure(... 0385 'Units','characters',... 0386 'Color',[0.614 0.687 0.651],... 0387 'Colormap',[0 0 0.5625;0 0 0.625;0 0 0.6875;0 0 0.75;0 0 0.8125;0 0 0.875;0 0 0.9375;0 0 1;0 0.0625 1;0 0.125 1;0 0.1875 1;0 0.25 1;0 0.3125 1;0 0.375 1;0 0.4375 1;0 0.5 1;0 0.5625 1;0 0.625 1;0 0.6875 1;0 0.75 1;0 0.8125 1;0 0.875 1;0 0.9375 1;0 1 1;0.0625 1 1;0.125 1 0.9375;0.1875 1 0.875;0.25 1 0.8125;0.3125 1 0.75;0.375 1 0.6875;0.4375 1 0.625;0.5 1 0.5625;0.5625 1 0.5;0.625 1 0.4375;0.6875 1 0.375;0.75 1 0.3125;0.8125 1 0.25;0.875 1 0.1875;0.9375 1 0.125;1 1 0.0625;1 1 0;1 0.9375 0;1 0.875 0;1 0.8125 0;1 0.75 0;1 0.6875 0;1 0.625 0;1 0.5625 0;1 0.5 0;1 0.4375 0;1 0.375 0;1 0.3125 0;1 0.25 0;1 0.1875 0;1 0.125 0;1 0.0625 0;1 0 0;0.9375 0 0;0.875 0 0;0.8125 0 0;0.75 0 0;0.6875 0 0;0.625 0 0;0.5625 0 0],... 0388 'IntegerHandle','off',... 0389 'InvertHardcopy',get(0,'defaultfigureInvertHardcopy'),... 0390 'MenuBar','none',... 0391 'Name','Display ROI Results',... 0392 'NumberTitle','off',... 0393 'PaperPosition',get(0,'defaultfigurePaperPosition'),... 0394 'Position',[10 30 106.833333333333 30.6428571428571],... 0395 'Renderer',get(0,'defaultfigureRenderer'),... 0396 'RendererMode','manual',... 0397 'Resize','off',... 0398 'CreateFcn','view_roi_results(''main_CreateFcn'',gcbo,[],guidata(gcbo))',... 0399 'HandleVisibility','callback',... 0400 'Tag','main',... 0401 'UserData',zeros(1,0)); 0402 0403 setappdata(h1, 'GUIDEOptions', struct(... 0404 'active_h', 1.240065e+02, ... 0405 'taginfo', struct(... 0406 'figure', 2, ... 0407 'frame', 10, ... 0408 'text', 10, ... 0409 'popupmenu', 2, ... 0410 'pushbutton', 2), ... 0411 'override', 1, ... 0412 'release', 13, ... 0413 'resize', 'none', ... 0414 'accessibility', 'callback', ... 0415 'mfile', 1, ... 0416 'callbacks', 1, ... 0417 'singleton', 1, ... 0418 'syscolorfig', 0, ... 0419 'lastSavedFile', '/afs/athena.mit.edu/user/n/k/nknouf/gui/view_roi_results.m')); 0420 0421 0422 h2 = uicontrol(... 0423 'Parent',h1,... 0424 'Units','characters',... 0425 'Position',[6.5 2.14285714285714 41.6666666666667 21.5],... 0426 'String',{ '' },... 0427 'Style','frame',... 0428 'Tag','frame1'); 0429 0430 0431 h3 = uicontrol(... 0432 'Parent',h1,... 0433 'Units','characters',... 0434 'BackgroundColor',[0.683 0.702 0.491],... 0435 'Position',[8 22.5 33.6666666666667 2.64285714285714],... 0436 'String',{ '' },... 0437 'Style','frame',... 0438 'Tag','frame2'); 0439 0440 0441 h4 = uicontrol(... 0442 'Parent',h1,... 0443 'Units','characters',... 0444 'FontUnits','inches',... 0445 'BackgroundColor',[0.683090009422724 0.701960784313725 0.491366506055482],... 0446 'FontSize',0.194444444444445,... 0447 'FontWeight','bold',... 0448 'Position',[9.33333333333333 23.0714285714286 31 1.64285714285714],... 0449 'String','Scan Information',... 0450 'Style','text',... 0451 'Tag','scan_info_title'); 0452 0453 0454 h5 = uicontrol(... 0455 'Parent',h1,... 0456 'Units','characters',... 0457 'HorizontalAlignment','left',... 0458 'Position',[8.83333333333333 3 36.1666666666667 19],... 0459 'String','{ none }',... 0460 'Style','text',... 0461 'Tag','scan_info_box'); 0462 0463 0464 h6 = uicontrol(... 0465 'Parent',h1,... 0466 'Units','characters',... 0467 'Position',[54.8333333333333 2.14285714285714 41.6666666666667 8.64285714285714],... 0468 'String',{ '' },... 0469 'Style','frame',... 0470 'Tag','frame3'); 0471 0472 0473 h7 = uicontrol(... 0474 'Parent',h1,... 0475 'Units','characters',... 0476 'BackgroundColor',[0.683 0.702 0.491],... 0477 'Position',[56.5 9.64285714285714 33.6666666666667 2.64285714285714],... 0478 'String',{ '' },... 0479 'Style','frame',... 0480 'Tag','frame4'); 0481 0482 0483 h8 = uicontrol(... 0484 'Parent',h1,... 0485 'Units','characters',... 0486 'FontUnits','inches',... 0487 'BackgroundColor',[0.683090009422724 0.701960784313725 0.491366506055482],... 0488 'FontSize',0.194444444444445,... 0489 'FontWeight','bold',... 0490 'Position',[58.1666666666667 10.1428571428571 31 1.64285714285714],... 0491 'String','ROI Results',... 0492 'Style','text',... 0493 'Tag','available_scans_title'); 0494 0495 0496 h9 = uimenu(... 0497 'Parent',h1,... 0498 'Callback','view_roi_results(''file_menu_Callback'',gcbo,[],guidata(gcbo))',... 0499 'Label','File',... 0500 'Tag','file_menu'); 0501 0502 h10 = uimenu(... 0503 'Parent',h9,... 0504 'Callback','view_roi_results(''open_menu_Callback'',gcbo,[],guidata(gcbo))',... 0505 'Label','Open...',... 0506 'Tag','open_menu'); 0507 0508 h11 = uimenu(... 0509 'Parent',h9,... 0510 'Callback','view_roi_results(''quit_menu_Callback'',gcbo,[],guidata(gcbo))',... 0511 'Label','Quit',... 0512 'Separator','on',... 0513 'Tag','quit_menu'); 0514 0515 h12 = uicontrol(... 0516 'Parent',h1,... 0517 'Units','characters',... 0518 'Callback','view_roi_results(''results_popupmenu_Callback'',gcbo,[],guidata(gcbo))',... 0519 'HorizontalAlignment','left',... 0520 'Position',[59 5.5 32.6666666666667 1.71428571428571],... 0521 'String','{ none }',... 0522 'Style','popupmenu',... 0523 'TooltipString','Select the results to display',... 0524 'Value',1,... 0525 'Clipping','off',... 0526 'CreateFcn','view_roi_results(''results_popupmenu_CreateFcn'',gcbo,[],guidata(gcbo))',... 0527 'Tag','results_popupmenu'); 0528 0529 0530 h13 = uicontrol(... 0531 'Parent',h1,... 0532 'Units','characters',... 0533 'BackgroundColor',[0.683 0.702 0.491],... 0534 'Position',[14.8333333333333 26.4285714285714 73.5 2.35714285714286],... 0535 'String',{ '' },... 0536 'Style','frame',... 0537 'Tag','frame6'); 0538 0539 0540 h14 = uicontrol(... 0541 'Parent',h1,... 0542 'Units','characters',... 0543 'FontUnits','inches',... 0544 'BackgroundColor',[0.683090009422724 0.701960784313725 0.491366506055482],... 0545 'FontSize',0.194444444444445,... 0546 'FontWeight','bold',... 0547 'Position',[28.3333333333333 26.7857142857143 46.8333333333333 1.64285714285714],... 0548 'String','Display ROI Results',... 0549 'Style','text',... 0550 'Tag','display_title'); 0551 0552 0553 h15 = uicontrol(... 0554 'Parent',h1,... 0555 'Units','characters',... 0556 'Position',[54.8333333333333 12.7857142857143 41.5 10.7857142857143],... 0557 'String',{ '' },... 0558 'Style','frame',... 0559 'Tag','frame7'); 0560 0561 0562 h16 = uicontrol(... 0563 'Parent',h1,... 0564 'Units','characters',... 0565 'BackgroundColor',[0.683 0.702 0.491],... 0566 'Position',[56.5 22.5 33.6666666666667 2.64285714285714],... 0567 'String',{ '' },... 0568 'Style','frame',... 0569 'Tag','frame8'); 0570 0571 0572 h17 = uicontrol(... 0573 'Parent',h1,... 0574 'Units','characters',... 0575 'FontUnits','inches',... 0576 'BackgroundColor',[0.683090009422724 0.701960784313725 0.491366506055482],... 0577 'FontSize',0.194444444444445,... 0578 'FontWeight','bold',... 0579 'Position',[57.8333333333333 23 31 1.64285714285714],... 0580 'String','ROI Information',... 0581 'Style','text',... 0582 'Tag','roi_info_title'); 0583 0584 0585 h18 = uicontrol(... 0586 'Parent',h1,... 0587 'Units','characters',... 0588 'HorizontalAlignment','left',... 0589 'Position',[57.3333333333333 13.5714285714286 36 8.42857142857143],... 0590 'String','{ none }',... 0591 'Style','text',... 0592 'Tag','roi_info_box'); 0593 0594 0595 h19 = uimenu(... 0596 'Parent',h1,... 0597 'Callback','view_roi_results(''help_menu_Callback'',gcbo,[],guidata(gcbo))',... 0598 'Label','Help',... 0599 'Tag','help_menu'); 0600 0601 h21 = uimenu(... 0602 'Parent',h19,... 0603 'Callback','view_roi_results(''scan_information_Callback'',gcbo,[],guidata(gcbo))',... 0604 'Label','Scan Information...',... 0605 'Tag','scan_information'); 0606 0607 h22 = uimenu(... 0608 'Parent',h19,... 0609 'Callback','view_roi_results(''roi_information_Callback'',gcbo,[],guidata(gcbo))',... 0610 'Label','ROI Information...',... 0611 'Tag','roi_information'); 0612 0613 h23 = uimenu(... 0614 'Parent',h19,... 0615 'Callback','view_roi_results(''viewing_results_Callback'',gcbo,[],guidata(gcbo))',... 0616 'Label','Viewing Results...',... 0617 'Tag','viewing_results'); 0618 0619 h20 = uimenu(... 0620 'Parent',h19,... 0621 'Callback','view_roi_results(''bugs_Callback'',gcbo,[],guidata(gcbo))',... 0622 'Label','Bugs, Comments, Suggestions...',... 0623 'Tag','bugs'); 0624 0625 h21 = uimenu(... 0626 'Parent',h19,... 0627 'Callback','view_roi_results(''about_menu_Callback'',gcbo,[],guidata(gcbo))',... 0628 'Label','About...',... 0629 'Separator', 'on',... 0630 'Tag','about_menu'); 0631 0632 0633 hsingleton = h1; 0634 0635 0636 % --- Handles default GUIDE GUI creation and callback dispatch 0637 function varargout = gui_mainfcn(gui_State, varargin) 0638 0639 gui_StateFields = {'gui_Name' 0640 'gui_Singleton' 0641 'gui_OpeningFcn' 0642 'gui_OutputFcn' 0643 'gui_LayoutFcn' 0644 'gui_Callback'}; 0645 gui_Mfile = ''; 0646 for i=1:length(gui_StateFields) 0647 if ~isfield(gui_State, gui_StateFields{i}) 0648 error('Could not find field %s in the gui_State struct in GUI M-file %s', gui_StateFields{i}, gui_Mfile); 0649 elseif isequal(gui_StateFields{i}, 'gui_Name') 0650 gui_Mfile = [getfield(gui_State, gui_StateFields{i}), '.m']; 0651 end 0652 end 0653 0654 numargin = length(varargin); 0655 0656 if numargin == 0 0657 % VIEW_ROI_RESULTS 0658 % create the GUI 0659 gui_Create = 1; 0660 elseif numargin > 3 & ischar(varargin{1}) & ishandle(varargin{2}) 0661 % VIEW_ROI_RESULTS('CALLBACK',hObject,eventData,handles,...) 0662 gui_Create = 0; 0663 else 0664 % VIEW_ROI_RESULTS(...) 0665 % create the GUI and hand varargin to the openingfcn 0666 gui_Create = 1; 0667 end 0668 0669 if gui_Create == 0 0670 varargin{1} = gui_State.gui_Callback; 0671 if nargout 0672 [varargout{1:nargout}] = feval(varargin{:}); 0673 else 0674 feval(varargin{:}); 0675 end 0676 else 0677 if gui_State.gui_Singleton 0678 gui_SingletonOpt = 'reuse'; 0679 else 0680 gui_SingletonOpt = 'new'; 0681 end 0682 0683 % Open fig file with stored settings. Note: This executes all component 0684 % specific CreateFunctions with an empty HANDLES structure. 0685 0686 % Do feval on layout code in m-file if it exists 0687 if ~isempty(gui_State.gui_LayoutFcn) 0688 gui_hFigure = feval(gui_State.gui_LayoutFcn, gui_SingletonOpt); 0689 else 0690 gui_hFigure = local_openfig(gui_State.gui_Name, gui_SingletonOpt); 0691 % If the figure has InGUIInitialization it was not completely created 0692 % on the last pass. Delete this handle and try again. 0693 if isappdata(gui_hFigure, 'InGUIInitialization') 0694 delete(gui_hFigure); 0695 gui_hFigure = local_openfig(gui_State.gui_Name, gui_SingletonOpt); 0696 end 0697 end 0698 0699 % Set flag to indicate starting GUI initialization 0700 setappdata(gui_hFigure,'InGUIInitialization',1); 0701 0702 % Fetch GUIDE Application options 0703 gui_Options = getappdata(gui_hFigure,'GUIDEOptions'); 0704 0705 if ~isappdata(gui_hFigure,'GUIOnScreen') 0706 % Adjust background color 0707 if gui_Options.syscolorfig 0708 set(gui_hFigure,'Color', get(0,'DefaultUicontrolBackgroundColor')); 0709 end 0710 0711 % Generate HANDLES structure and store with GUIDATA 0712 guidata(gui_hFigure, guihandles(gui_hFigure)); 0713 end 0714 0715 % If user specified 'Visible','off' in p/v pairs, don't make the figure 0716 % visible. 0717 gui_MakeVisible = 1; 0718 for ind=1:2:length(varargin) 0719 if length(varargin) == ind 0720 break; 0721 end 0722 len1 = min(length('visible'),length(varargin{ind})); 0723 len2 = min(length('off'),length(varargin{ind+1})); 0724 if ischar(varargin{ind}) & ischar(varargin{ind+1}) & ... 0725 strncmpi(varargin{ind},'visible',len1) & len2 > 1 0726 if strncmpi(varargin{ind+1},'off',len2) 0727 gui_MakeVisible = 0; 0728 elseif strncmpi(varargin{ind+1},'on',len2) 0729 gui_MakeVisible = 1; 0730 end 0731 end 0732 end 0733 0734 % Check for figure param value pairs 0735 for index=1:2:length(varargin) 0736 if length(varargin) == index 0737 break; 0738 end 0739 try, set(gui_hFigure, varargin{index}, varargin{index+1}), catch, break, end 0740 end 0741 0742 % If handle visibility is set to 'callback', turn it on until finished 0743 % with OpeningFcn 0744 gui_HandleVisibility = get(gui_hFigure,'HandleVisibility'); 0745 if strcmp(gui_HandleVisibility, 'callback') 0746 set(gui_hFigure,'HandleVisibility', 'on'); 0747 end 0748 0749 feval(gui_State.gui_OpeningFcn, gui_hFigure, [], guidata(gui_hFigure), varargin{:}); 0750 0751 if ishandle(gui_hFigure) 0752 % Update handle visibility 0753 set(gui_hFigure,'HandleVisibility', gui_HandleVisibility); 0754 0755 % Make figure visible 0756 if gui_MakeVisible 0757 set(gui_hFigure, 'Visible', 'on') 0758 if gui_Options.singleton 0759 setappdata(gui_hFigure,'GUIOnScreen', 1); 0760 end 0761 end 0762 0763 % Done with GUI initialization 0764 rmappdata(gui_hFigure,'InGUIInitialization'); 0765 end 0766 0767 % If handle visibility is set to 'callback', turn it on until finished with 0768 % OutputFcn 0769 if ishandle(gui_hFigure) 0770 gui_HandleVisibility = get(gui_hFigure,'HandleVisibility'); 0771 if strcmp(gui_HandleVisibility, 'callback') 0772 set(gui_hFigure,'HandleVisibility', 'on'); 0773 end 0774 gui_Handles = guidata(gui_hFigure); 0775 else 0776 gui_Handles = []; 0777 end 0778 0779 if nargout 0780 [varargout{1:nargout}] = feval(gui_State.gui_OutputFcn, gui_hFigure, [], gui_Handles); 0781 else 0782 feval(gui_State.gui_OutputFcn, gui_hFigure, [], gui_Handles); 0783 end 0784 0785 if ishandle(gui_hFigure) 0786 set(gui_hFigure,'HandleVisibility', gui_HandleVisibility); 0787 end 0788 end 0789 0790 function gui_hFigure = local_openfig(name, singleton) 0791 if nargin('openfig') == 3 0792 gui_hFigure = openfig(name, singleton, 'auto'); 0793 else 0794 % OPENFIG did not accept 3rd input argument until R13, 0795 % toggle default figure visible to prevent the figure 0796 % from showing up too soon. 0797 gui_OldDefaultVisible = get(0,'defaultFigureVisible'); 0798 set(0,'defaultFigureVisible','off'); 0799 gui_hFigure = openfig(name, singleton); 0800 set(0,'defaultFigureVisible',gui_OldDefaultVisible); 0801 end 0802