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: prt_ui_main.m 523 2012-05-09 11:43:36Z jrichiar $
0028 
0029 % Edit the above text to modify the response to help prt_ui_main
0030 
0031 % Last Modified by GUIDE v2.5 04-Nov-2011 19:08:48
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     if ispc
0128         set(aa(i),'FontSize',ceil(FS*xf),'FontName',PF,...
0129             'FontUnits','normalized','Units','normalized')
0130     else
0131         set(aa(i),'FontSize',ceil(FS*xf),'FontName',PF,...
0132             'Units','normalized')
0133     end
0134 end
0135 
0136 end 
0137 % cc=get(handles.figure1,'Color');
0138 % [A] = imread('PRoNTo_logo.png','BackgroundColor',cc);
0139 % image(A)
0140 % axis off
0141 % Choose default command line output for prt_ui_main
0142 handles.output = hObject;
0143 
0144 % Update handles structure
0145 guidata(hObject, handles);
0146 
0147 % UIWAIT makes prt_ui_main wait for user response (see UIRESUME)
0148 % uiwait(handles.figure1)
0149 
0150 
0151 % --- Outputs from this function are returned to the command line.
0152 function varargout = prt_ui_main_OutputFcn(hObject, eventdata, handles) 
0153 % varargout  cell array for returning output args (see VARARGOUT);
0154 % hObject    handle to figure
0155 % eventdata  reserved - to be defined in a future version of MATLAB
0156 % handles    structure with handles and user data (see GUIDATA)
0157 
0158 % Get default command line output from handles structure
0159 varargout{1} = handles.output;
0160 
0161 % --- Closing the figure
0162 function figure1_DeleteFcn(hObject,eventdata,handles)
0163 % hObject    handle to datastruct (see GCBO)
0164 % eventdata  reserved - to be defined in a future version of MATLAB
0165 % handles    structure with handles and user data (see GUIDATA)
0166 delete(handles.figure1);
0167 
0168 % --- Executes on button press in datastruct.
0169 function datastruct_Callback(hObject, eventdata, handles)
0170 % hObject    handle to datastruct (see GCBO)
0171 % eventdata  reserved - to be defined in a future version of MATLAB
0172 % handles    structure with handles and user data (see GUIDATA)
0173 prt_ui_design;
0174 
0175 % --- Executes on button press in fs.
0176 function fs_Callback(hObject, eventdata, handles)
0177 % hObject    handle to fs (see GCBO)
0178 % eventdata  reserved - to be defined in a future version of MATLAB
0179 % handles    structure with handles and user data (see GUIDATA)
0180 prt_ui_prepare_data
0181 
0182 
0183 % --- Executes on button press in crval.
0184 function crval_Callback(hObject, eventdata, handles)
0185 % hObject    handle to crval (see GCBO)
0186 % eventdata  reserved - to be defined in a future version of MATLAB
0187 % handles    structure with handles and user data (see GUIDATA)
0188 prt_ui_model
0189 
0190 % --- Executes on button press in model.
0191 function model_Callback(hObject, eventdata, handles)
0192 % hObject    handle to model (see GCBO)
0193 % eventdata  reserved - to be defined in a future version of MATLAB
0194 % handles    structure with handles and user data (see GUIDATA)
0195 prt_ui_cv_model
0196 
0197 % --- Executes on button press in compweights.
0198 function compweights_Callback(hObject, eventdata, handles)
0199 % hObject    handle to compweights (see GCBO)
0200 % eventdata  reserved - to be defined in a future version of MATLAB
0201 % handles    structure with handles and user data (see GUIDATA)
0202 prt_ui_compute_weights
0203 
0204 % --- Executes on button press in datarev.
0205 function datarev_Callback(hObject, eventdata, handles)
0206 % hObject    handle to datarev (see GCBO)
0207 % eventdata  reserved - to be defined in a future version of MATLAB
0208 % handles    structure with handles and user data (see GUIDATA)
0209 fname=spm_select(1,'mat','Select PRT.mat',[],pwd,'PRT.mat');
0210 prtdir=fileparts(fname);
0211 try
0212     load(fname)
0213     prt_data_review('UserData',{PRT,prtdir});
0214 catch
0215     beep
0216     disp('Could not load file')
0217     return
0218 end
0219 
0220 % --- Executes on button press in kerncvrev.
0221 function kerncvrev_Callback(hObject, eventdata, handles)
0222 % hObject    handle to kerncvrev (see GCBO)
0223 % eventdata  reserved - to be defined in a future version of MATLAB
0224 % handles    structure with handles and user data (see GUIDATA)
0225 fname=spm_select(1,'mat','Select PRT.mat',[],pwd,'PRT.mat');
0226 prtdir=fileparts(fname);
0227 try
0228     load(fname)
0229     prt_ui_reviewmodel('UserData',{PRT,prtdir});
0230 catch
0231     beep
0232     disp('Could not load file')
0233     return
0234 end
0235 
0236 % --- Executes on button press in resrev.
0237 function resrev_Callback(hObject, eventdata, handles)
0238 % hObject    handle to resrev (see GCBO)
0239 % eventdata  reserved - to be defined in a future version of MATLAB
0240 % handles    structure with handles and user data (see GUIDATA)
0241 prt_ui_results
0242 
0243 % --- Executes on button press in batchbutt.
0244 function batchbutt_Callback(hObject, eventdata, handles)
0245 % hObject    handle to batchbutt (see GCBO)
0246 % eventdata  reserved - to be defined in a future version of MATLAB
0247 % handles    structure with handles and user data (see GUIDATA)
0248 prt_batch
0249 % [afm] stopped this from closing the main window
0250 %delete(handles.figure1)
0251 
0252 % --- Executes on button press in credits.
0253 function credits_Callback(hObject, eventdata, handles)
0254 % hObject    handle to credits (see GCBO)
0255 % eventdata  reserved - to be defined in a future version of MATLAB
0256 % handles    structure with handles and user data (see GUIDATA)
0257 
0258 help('Contents.m');
0259 % str = help('Contents.m'));
0260 % fig = figure;
0261 % set(fig,'Position',[73   145   498   1003])
0262 % set(fig,'NumberTitle','off')
0263 % set(fig,'Name','License & Copyright')
0264 % h = axes('Position',[0 0 1 1],'Visible','off');
0265 %
0266 % text(.025,.5,str,'FontSize',8,'FontName','Courier')

Generated on Sun 20-May-2012 13:24:48 by m2html © 2005