Home > . > prt_ui_kernel_construction.m

prt_ui_kernel_construction

PURPOSE ^

PRT_UI_KERNEL MATLAB code for prt_ui_kernel.fig

SYNOPSIS ^

function varargout = prt_ui_kernel_construction(varargin)

DESCRIPTION ^

 PRT_UI_KERNEL MATLAB code for prt_ui_kernel.fig
 
 PRT_UI_KERNEL, by itself, creates a new PRT_UI_KERNEL or raises the 
 existing singleton*.

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

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

 PRT_UI_KERNEL('Property','Value',...) creates a new PRT_UI_KERNEL or raises
 the existing singleton*.  Starting from the left, property value pairs are
 applied to the GUI before prt_ui_kernel_OpeningFcn gets called.  An
 unrecognized property name or invalid value makes property application
 stop.  All inputs are passed to prt_ui_kernel_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_kernel_construction(varargin)
0002 % PRT_UI_KERNEL MATLAB code for prt_ui_kernel.fig
0003 %
0004 % PRT_UI_KERNEL, by itself, creates a new PRT_UI_KERNEL or raises the
0005 % existing singleton*.
0006 %
0007 % H = PRT_UI_KERNEL returns the handle to a new PRT_UI_KERNEL or the handle
0008 % to the existing singleton*.
0009 %
0010 % PRT_UI_KERNEL('CALLBACK',hObject,eventData,handles,...) calls the local
0011 % function named CALLBACK in PRT_UI_KERNEL.M with the given input arguments.
0012 %
0013 % PRT_UI_KERNEL('Property','Value',...) creates a new PRT_UI_KERNEL or raises
0014 % the existing singleton*.  Starting from the left, property value pairs are
0015 % applied to the GUI before prt_ui_kernel_OpeningFcn gets called.  An
0016 % unrecognized property name or invalid value makes property application
0017 % stop.  All inputs are passed to prt_ui_kernel_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_kernel_construction.m 200 2011-10-25 14:16:51Z cphillip $
0028 
0029 % Edit the above text to modify the response to help prt_ui_kernel
0030 
0031 % Last Modified by GUIDE v2.5 26-Sep-2011 14:21:28
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_kernel_OpeningFcn, ...
0038                    'gui_OutputFcn',  @prt_ui_kernel_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_kernel is made visible.
0054 function prt_ui_kernel_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_kernel (see VARARGIN)
0060 
0061 % Choose default command line output for prt_ui_kernel
0062 handles.output = hObject;
0063 
0064 % Update handles structure
0065 guidata(hObject, handles);
0066 
0067 % UIWAIT makes prt_ui_kernel wait for user response (see UIRESUME)
0068 % uiwait(handles.figure1);
0069 
0070 
0071 % --- Outputs from this function are returned to the command line.
0072 function varargout = prt_ui_kernel_OutputFcn(hObject, eventdata, handles) 
0073 % varargout  cell array for returning output args (see VARARGOUT);
0074 % hObject    handle to figure
0075 % eventdata  reserved - to be defined in a future version of MATLAB
0076 % handles    structure with handles and user data (see GUIDATA)
0077 
0078 % Get default command line output from handles structure
0079 varargout{1} = handles.output;
0080 
0081 
0082 
0083 function edit_prt_Callback(hObject, eventdata, handles)
0084 % hObject    handle to edit_prt (see GCBO)
0085 % eventdata  reserved - to be defined in a future version of MATLAB
0086 % handles    structure with handles and user data (see GUIDATA)
0087 
0088 % Hints: get(hObject,'String') returns contents of edit_prt as text
0089 %        str2double(get(hObject,'String')) returns contents of edit_prt as a double
0090 fname=get(handles.edit_prt,'String');
0091 try
0092     load(fname)
0093     handles.dat=PRT;
0094 catch
0095     beep
0096     disp('Could not load file')
0097     return
0098 end
0099 %get names of modalities
0100 list={handles.dat.masks(:).mod_name};
0101 set(handles.pop_mod,'String',list);
0102 handles.modmask=cell(1,length(get(handles.pop_mod,'String')));
0103 % Update handles structure
0104 guidata(hObject, handles);
0105 
0106 % --- Executes during object creation, after setting all properties.
0107 function edit_prt_CreateFcn(hObject, eventdata, handles)
0108 % hObject    handle to edit_prt (see GCBO)
0109 % eventdata  reserved - to be defined in a future version of MATLAB
0110 % handles    empty - handles not created until after all CreateFcns called
0111 
0112 % Hint: edit controls usually have a white background on Windows.
0113 %       See ISPC and COMPUTER.
0114 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0115     set(hObject,'BackgroundColor','white');
0116 end
0117 
0118 
0119 % --- Executes on button press in br_prt.
0120 function br_prt_Callback(hObject, eventdata, handles)
0121 % hObject    handle to br_prt (see GCBO)
0122 % eventdata  reserved - to be defined in a future version of MATLAB
0123 % handles    structure with handles and user data (see GUIDATA)
0124 fname=spm_select(1,'.mat','Select PRT.mat',[],pwd,'PRT.mat');
0125 try
0126     load(fname)
0127     handles.dat=PRT;
0128     set(handles.edit_prt,'String',fname);
0129 catch
0130     beep
0131     disp('Could not load file')
0132     return
0133 end
0134 %get names of modalities
0135 list={handles.dat.masks(:).mod_name};
0136 set(handles.pop_mod,'String',list);
0137 handles.modmask=cell(1,length(get(handles.pop_mod,'String')));
0138 % Update handles structure
0139 guidata(hObject, handles);
0140 
0141 
0142 function edit_kname_Callback(hObject, eventdata, handles)
0143 % hObject    handle to edit_kname (see GCBO)
0144 % eventdata  reserved - to be defined in a future version of MATLAB
0145 % handles    structure with handles and user data (see GUIDATA)
0146 
0147 % Hints: get(hObject,'String') returns contents of edit_kname as text
0148 %        str2double(get(hObject,'String')) returns contents of edit_kname as a double
0149 
0150 
0151 % --- Executes during object creation, after setting all properties.
0152 function edit_kname_CreateFcn(hObject, eventdata, handles)
0153 % hObject    handle to edit_kname (see GCBO)
0154 % eventdata  reserved - to be defined in a future version of MATLAB
0155 % handles    empty - handles not created until after all CreateFcns called
0156 
0157 % Hint: edit controls usually have a white background on Windows.
0158 %       See ISPC and COMPUTER.
0159 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0160     set(hObject,'BackgroundColor','white');
0161 end
0162 
0163 
0164 % --- Executes on selection change in pop_build.
0165 function pop_build_Callback(hObject, eventdata, handles)
0166 % hObject    handle to pop_build (see GCBO)
0167 % eventdata  reserved - to be defined in a future version of MATLAB
0168 % handles    structure with handles and user data (see GUIDATA)
0169 
0170 % Hints: contents = get(hObject,'String') returns pop_build contents as cell array
0171 %        contents{get(hObject,'Value')} returns selected item from pop_build
0172 
0173 
0174 % --- Executes during object creation, after setting all properties.
0175 function pop_build_CreateFcn(hObject, eventdata, handles)
0176 % hObject    handle to pop_build (see GCBO)
0177 % eventdata  reserved - to be defined in a future version of MATLAB
0178 % handles    empty - handles not created until after all CreateFcns called
0179 
0180 % Hint: popupmenu controls usually have a white background on Windows.
0181 %       See ISPC and COMPUTER.
0182 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0183     set(hObject,'BackgroundColor','white');
0184 end
0185 
0186 % --- Executes on selection change in pop_mod.
0187 function pop_mod_Callback(hObject, eventdata, handles)
0188 % hObject    handle to pop_mod (see GCBO)
0189 % eventdata  reserved - to be defined in a future version of MATLAB
0190 % handles    structure with handles and user data (see GUIDATA)
0191 
0192 % Hints: contents = cellstr(get(hObject,'String')) returns pop_mod contents as cell array
0193 %        contents{get(hObject,'Value')} returns selected item from pop_mod
0194 
0195 
0196 % --- Executes during object creation, after setting all properties.
0197 function pop_mod_CreateFcn(hObject, eventdata, handles)
0198 % hObject    handle to pop_mod (see GCBO)
0199 % eventdata  reserved - to be defined in a future version of MATLAB
0200 % handles    empty - handles not created until after all CreateFcns called
0201 
0202 % Hint: popupmenu controls usually have a white background on Windows.
0203 %       See ISPC and COMPUTER.
0204 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0205     set(hObject,'BackgroundColor','white');
0206 end
0207 
0208 
0209 % --- Executes on selection change in pop_cond.
0210 function pop_cond_Callback(hObject, eventdata, handles)
0211 % hObject    handle to pop_cond (see GCBO)
0212 % eventdata  reserved - to be defined in a future version of MATLAB
0213 % handles    structure with handles and user data (see GUIDATA)
0214 
0215 % Hints: contents = cellstr(get(hObject,'String')) returns pop_cond contents as cell array
0216 %        contents{get(hObject,'Value')} returns selected item from pop_cond
0217 
0218 
0219 % --- Executes during object creation, after setting all properties.
0220 function pop_cond_CreateFcn(hObject, eventdata, handles)
0221 % hObject    handle to pop_cond (see GCBO)
0222 % eventdata  reserved - to be defined in a future version of MATLAB
0223 % handles    empty - handles not created until after all CreateFcns called
0224 
0225 % Hint: popupmenu controls usually have a white background on Windows.
0226 %       See ISPC and COMPUTER.
0227 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0228     set(hObject,'BackgroundColor','white');
0229 end
0230 
0231 
0232 % --- Executes on button press in normbutt.
0233 function normbutt_Callback(hObject, eventdata, handles)
0234 % hObject    handle to normbutt (see GCBO)
0235 % eventdata  reserved - to be defined in a future version of MATLAB
0236 % handles    structure with handles and user data (see GUIDATA)
0237 
0238 % Hint: get(hObject,'Value') returns toggle state of normbutt
0239 
0240 
0241 % --- Executes on button press in kdetrend.
0242 function kdetrend_Callback(hObject, eventdata, handles)
0243 % hObject    handle to kdetrend (see GCBO)
0244 % eventdata  reserved - to be defined in a future version of MATLAB
0245 % handles    structure with handles and user data (see GUIDATA)
0246 
0247 % Hint: get(hObject,'Value') returns toggle state of kdetrend
0248 
0249 function edit_mask_Callback(hObject, eventdata, handles)
0250 % hObject    handle to edit_mask (see GCBO)
0251 % eventdata  reserved - to be defined in a future version of MATLAB
0252 % handles    structure with handles and user data (see GUIDATA)
0253 
0254 % Hints: get(hObject,'String') returns contents of edit_mask as text
0255 %        str2double(get(hObject,'String')) returns contents of edit_mask as a double
0256 fname=get(handles.mask_mod,'String');
0257 val=get(handles.pop_mod,'Value');
0258 handles.modmask{val}=fname;
0259 % Update handles structure
0260 guidata(hObject, handles);
0261 
0262 % --- Executes during object creation, after setting all properties.
0263 function edit_mask_CreateFcn(hObject, eventdata, handles)
0264 % hObject    handle to edit_mask (see GCBO)
0265 % eventdata  reserved - to be defined in a future version of MATLAB
0266 % handles    empty - handles not created until after all CreateFcns called
0267 
0268 % Hint: edit controls usually have a white background on Windows.
0269 %       See ISPC and COMPUTER.
0270 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0271     set(hObject,'BackgroundColor','white');
0272 end
0273 
0274 
0275 % --- Executes on button press in br_mask.
0276 function br_mask_Callback(hObject, eventdata, handles)
0277 % hObject    handle to br_mask (see GCBO)
0278 % eventdata  reserved - to be defined in a future version of MATLAB
0279 % handles    structure with handles and user data (see GUIDATA)
0280 val=get(handles.pop_mod,'Value');
0281 list=get(handles.pop_mod,'String');
0282 fname=spm_select(1,'image',['Select mask for modality ',list(val)]);
0283 handles.modmask{val}=fname;
0284 % Update handles structure
0285 guidata(hObject, handles);
0286 
0287 % --- Executes on button press in buildbutt.
0288 function buildbutt_Callback(hObject, eventdata, handles)
0289 % hObject    handle to buildbutt (see GCBO)
0290 % eventdata  reserved - to be defined in a future version of MATLAB
0291 % handles    structure with handles and user data (see GUIDATA)
0292

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