Home > . > prt_ui_main.m

prt_ui_main

PURPOSE ^

PRT_UI_MAIN M-file for prt_ui_main.fig

SYNOPSIS ^

function varargout = prt_ui_main(varargin)

DESCRIPTION ^

 PRT_UI_MAIN M-file for prt_ui_main.fig
 
 PRT_UI_MAIN, by itself, creates a new PRT_UI_MAIN or raises the existing
 singleton*.

 H = PRT_UI_MAIN returns the handle to a new PRT_UI_MAIN or the handle to
 the existing singleton*.

 PRT_UI_MAIN('CALLBACK',hObject,eventData,handles,...) calls the local
 function named CALLBACK in PRT_UI_MAIN.M with the given input arguments.

 PRT_UI_MAIN('Property','Value',...) creates a new PRT_UI_MAIN or raises 
 the existing singleton*.  Starting from the left, property value pairs are
 applied to the GUI before prt_ui_main_OpeningFcn gets called.  An
 unrecognized property name or invalid value makes property application
 stop.  All inputs are passed to prt_ui_main_OpeningFcn via varargin.

 *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
  instance to run (singleton)".

 See also: GUIDE, GUIDATA, GUIHANDLES
__________________________________________________________________________
 Copyright (C) 2011 Machine Learning & Neuroimaging Laboratory

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function varargout = prt_ui_main(varargin)
0002 % PRT_UI_MAIN M-file for prt_ui_main.fig
0003 %
0004 % PRT_UI_MAIN, by itself, creates a new PRT_UI_MAIN or raises the existing
0005 % singleton*.
0006 %
0007 % H = PRT_UI_MAIN returns the handle to a new PRT_UI_MAIN or the handle to
0008 % the existing singleton*.
0009 %
0010 % PRT_UI_MAIN('CALLBACK',hObject,eventData,handles,...) calls the local
0011 % function named CALLBACK in PRT_UI_MAIN.M with the given input arguments.
0012 %
0013 % PRT_UI_MAIN('Property','Value',...) creates a new PRT_UI_MAIN or raises
0014 % the existing singleton*.  Starting from the left, property value pairs are
0015 % applied to the GUI before prt_ui_main_OpeningFcn gets called.  An
0016 % unrecognized property name or invalid value makes property application
0017 % stop.  All inputs are passed to prt_ui_main_OpeningFcn via varargin.
0018 %
0019 % *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
0020 %  instance to run (singleton)".
0021 %
0022 % See also: GUIDE, GUIDATA, GUIHANDLES
0023 %__________________________________________________________________________
0024 % Copyright (C) 2011 Machine Learning & Neuroimaging Laboratory
0025 
0026 % Written by J. Schrouff
0027 % $Id$
0028 
0029 % Edit the above text to modify the response to help prt_ui_main
0030 
0031 % Last Modified by GUIDE v2.5 04-Apr-2014 04:25:32
0032 
0033 % Begin initialization code - DO NOT EDIT
0034 gui_Singleton = 1;
0035 gui_State = struct('gui_Name',       mfilename, ...
0036     'gui_Singleton',  gui_Singleton, ...
0037     'gui_OpeningFcn', @prt_ui_main_OpeningFcn, ...
0038     'gui_OutputFcn',  @prt_ui_main_OutputFcn, ...
0039     'gui_LayoutFcn',  [] , ...
0040     'gui_Callback',   []);
0041 if nargin && ischar(varargin{1})
0042     gui_State.gui_Callback = str2func(varargin{1});
0043 end
0044 
0045 if nargout
0046     [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
0047 else
0048     gui_mainfcn(gui_State, varargin{:});
0049 end
0050 % End initialization code - DO NOT EDIT
0051 
0052 
0053 % --- Executes just before prt_ui_main is made visible.
0054 function prt_ui_main_OpeningFcn(hObject, eventdata, handles, varargin)
0055 % This function has no output args, see OutputFcn.
0056 % hObject    handle to figure
0057 % eventdata  reserved - to be defined in a future version of MATLAB
0058 % handles    structure with handles and user data (see GUIDATA)
0059 % varargin   command line arguments to prt_ui_main (see VARARGIN)
0060 
0061 Tag='prtmain';
0062 F = findall(allchild(0),'Flat','Tag',Tag);
0063 if length(F) > 1
0064     % Multiple Graphics windows - close all but most recent
0065     close(F(2:end))
0066     F = F(1);
0067     uistack(F,'top')
0068 elseif length(F)==1
0069     uistack(F,'top')
0070 else
0071     set(handles.figure1,'Tag',Tag)
0072     set(handles.figure1,'Name','PRoNTo ::')
0073     
0074     %set size of the window, taking screen resolution and platform into account
0075     S0= spm('WinSize','0',1);   %-Screen size (of the current monitor)
0076     if ispc
0077         PF='MS Sans Serif';
0078     else
0079         PF= spm_platform('fonts');     %-Font names (for this platform)
0080         PF=PF.helvetica;
0081     end
0082     tmp  = [S0(3)/1280 (S0(4))/800];
0083     ratio=min(tmp)*[1 1 1 1];
0084     FS = 1 + 0.85*(min(ratio)-1);  %factor to scale the fonts
0085     x=get(handles.figure1,'Position');
0086     set(handles.figure1,'DefaultTextFontSize',FS*8,...
0087         'DefaultUicontrolFontSize',FS*8,...
0088         'DefaultTextFontName',PF,...
0089         'DefaultAxesFontName',PF,...
0090         'DefaultUicontrolFontName',PF)
0091     set(handles.figure1,'Position',ratio.*x)
0092     % set(handles.figure1,'Units','normalized')
0093     set(handles.figure1,'Resize','on')
0094     
0095     % Choose the color of the different backgrounds and figure parameters
0096     color=prt_get_defaults('color');
0097     set(handles.figure1,'Color',color.bg1)
0098     aa=get(handles.figure1,'children');
0099     for i=1:length(aa)
0100         if strcmpi(get(aa(i),'type'),'uipanel')
0101             set(aa(i),'BackgroundColor',color.bg2)
0102             bb=get(aa(i),'children');
0103             if ~isempty(bb)
0104                 for j=1:length(bb)
0105                     if ~isempty(find(strcmpi(get(bb(j),'Style'),{'text',...
0106                             'radiobutton','checkbox'})))
0107                         set(bb(j),'BackgroundColor',color.bg2)
0108                     elseif ~isempty(find(strcmpi(get(bb(j),'Style'),'pushbutton')))
0109                         set(bb(j),'BackgroundColor',color.fr)
0110                     end
0111                     set(bb(j),'FontUnits','pixel')
0112                     xf=get(bb(j),'FontSize');
0113                     set(bb(j),'FontSize',ceil(FS*xf),'FontName',PF,...
0114                         'FontUnits','normalized','Units','normalized')
0115                 end
0116             end
0117         else
0118             if ~isempty(find(strcmpi(get(aa(i),'Style'),{'text',...
0119                     'radiobutton','checkbox','listbox'})))
0120                 set(aa(i),'BackgroundColor',color.bg1)
0121             elseif ~isempty(find(strcmpi(get(aa(i),'Style'),'pushbutton')))
0122                 set(aa(i),'BackgroundColor',color.fr)
0123             end
0124         end
0125         set(aa(i),'FontUnits','pixel')
0126         xf=get(aa(i),'FontSize');
0127         set(aa(i),'FontSize',ceil(FS*xf),'FontName',PF,...
0128             'Units','normalized')
0129     end
0130 
0131 end 
0132 % cc=get(handles.figure1,'Color');
0133 % [A] = imread('PRoNTo_logo.png','BackgroundColor',cc);
0134 % image(A)
0135 % axis off
0136 % Choose default command line output for prt_ui_main
0137 handles.output = hObject;
0138 
0139 % Update handles structure
0140 guidata(hObject, handles);
0141 
0142 % UIWAIT makes prt_ui_main wait for user response (see UIRESUME)
0143 % uiwait(handles.figure1)
0144 
0145 
0146 % --- Outputs from this function are returned to the command line.
0147 function varargout = prt_ui_main_OutputFcn(hObject, eventdata, handles) 
0148 % varargout  cell array for returning output args (see VARARGOUT);
0149 % hObject    handle to figure
0150 % eventdata  reserved - to be defined in a future version of MATLAB
0151 % handles    structure with handles and user data (see GUIDATA)
0152 
0153 % Get default command line output from handles structure
0154 varargout{1} = handles.output;
0155 
0156 % --- Closing the figure
0157 function figure1_DeleteFcn(hObject,eventdata,handles)
0158 % hObject    handle to datastruct (see GCBO)
0159 % eventdata  reserved - to be defined in a future version of MATLAB
0160 % handles    structure with handles and user data (see GUIDATA)
0161 delete(handles.figure1);
0162 
0163 % --- Executes on button press in datastruct.
0164 function datastruct_Callback(hObject, eventdata, handles)
0165 % hObject    handle to datastruct (see GCBO)
0166 % eventdata  reserved - to be defined in a future version of MATLAB
0167 % handles    structure with handles and user data (see GUIDATA)
0168 prt_ui_design;
0169 
0170 % --- Executes on button press in fs.
0171 function fs_Callback(hObject, eventdata, handles)
0172 % hObject    handle to fs (see GCBO)
0173 % eventdata  reserved - to be defined in a future version of MATLAB
0174 % handles    structure with handles and user data (see GUIDATA)
0175 prt_ui_prepare_data
0176 
0177 
0178 % --- Executes on button press in crval.
0179 function crval_Callback(hObject, eventdata, handles)
0180 % hObject    handle to crval (see GCBO)
0181 % eventdata  reserved - to be defined in a future version of MATLAB
0182 % handles    structure with handles and user data (see GUIDATA)
0183 prt_ui_model
0184 
0185 % --- Executes on button press in model.
0186 function model_Callback(hObject, eventdata, handles)
0187 % hObject    handle to model (see GCBO)
0188 % eventdata  reserved - to be defined in a future version of MATLAB
0189 % handles    structure with handles and user data (see GUIDATA)
0190 prt_ui_cv_model
0191 
0192 % --- Executes on button press in compweights.
0193 function compweights_Callback(hObject, eventdata, handles)
0194 % hObject    handle to compweights (see GCBO)
0195 % eventdata  reserved - to be defined in a future version of MATLAB
0196 % handles    structure with handles and user data (see GUIDATA)
0197 prt_ui_compute_weights
0198 
0199 % --- Executes on button press in datarev.
0200 function datarev_Callback(hObject, eventdata, handles)
0201 % hObject    handle to datarev (see GCBO)
0202 % eventdata  reserved - to be defined in a future version of MATLAB
0203 % handles    structure with handles and user data (see GUIDATA)
0204 fname=spm_select(1,'mat','Select PRT.mat',[],pwd,'PRT.mat');
0205 prtdir=fileparts(fname);
0206 try
0207     load(fname)
0208     prt_data_review('UserData',{PRT,prtdir});
0209 catch
0210     beep
0211     disp('Could not load file')
0212     return
0213 end
0214 
0215 % --- Executes on button press in kerncvrev.
0216 function kerncvrev_Callback(hObject, eventdata, handles)
0217 % hObject    handle to kerncvrev (see GCBO)
0218 % eventdata  reserved - to be defined in a future version of MATLAB
0219 % handles    structure with handles and user data (see GUIDATA)
0220 fname=spm_select(1,'mat','Select PRT.mat',[],pwd,'PRT.mat');
0221 prtdir=fileparts(fname);
0222 try
0223     load(fname)
0224 catch
0225     beep
0226     disp('Could not load file')
0227     return
0228 end
0229 prt_ui_reviewmodel('UserData',{PRT,prtdir});
0230 
0231 % --- Executes on button press in resrev.
0232 function resrev_Callback(hObject, eventdata, handles)
0233 % hObject    handle to resrev (see GCBO)
0234 % eventdata  reserved - to be defined in a future version of MATLAB
0235 % handles    structure with handles and user data (see GUIDATA)
0236 prt_ui_results_stats
0237 
0238 % --- Executes on button press in dispweights.
0239 function dispweights_Callback(hObject, eventdata, handles)
0240 % hObject    handle to dispweights (see GCBO)
0241 % eventdata  reserved - to be defined in a future version of MATLAB
0242 % handles    structure with handles and user data (see GUIDATA)
0243 prt_ui_disp_weights
0244 
0245 % --- Executes on button press in batchbutt.
0246 function batchbutt_Callback(hObject, eventdata, handles)
0247 % hObject    handle to batchbutt (see GCBO)
0248 % eventdata  reserved - to be defined in a future version of MATLAB
0249 % handles    structure with handles and user data (see GUIDATA)
0250 prt_batch
0251 % [afm] stopped this from closing the main window
0252 %delete(handles.figure1)
0253 
0254 % --- Executes on button press in credits.
0255 function credits_Callback(hObject, eventdata, handles)
0256 % hObject    handle to credits (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 
0260 help('prt_contents.m');
0261 % str = help('Contents.m'));
0262 % fig = figure;
0263 % set(fig,'Position',[73   145   498   1003])
0264 % set(fig,'NumberTitle','off')
0265 % set(fig,'Name','License & Copyright')
0266 % h = axes('Position',[0 0 1 1],'Visible','off');
0267 %
0268 % text(.025,.5,str,'FontSize',8,'FontName','Courier')

Generated on Tue 10-Feb-2015 18:16:33 by m2html © 2005