Test job_leadfield.m, a sample program of VBMEG [syntax] G = test_job_leadfield(proj_root,test_parm) [input] proj_root: <<string>> VBMEG project root directory. test_parm: <<struct>> Test condition variables. --- fields of test_parm cortex: <<string>> 'bv' for BrainVoyager, 'fs' for FreeSurfer. data : <<string>> 'meg' for MEG data, 'eeg' for EEG data. method: <<string>> 'sarvas' for Sarvas, 'bem' for BEM. --- [output] G: <<matrix>> Leadfield matrix. Leadfield file (.basis.mat) is created. [history] 2010-06-30 Taku Yoshioka Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function G = test_job_leadfield(proj_root,test_parm) 0002 % Test job_leadfield.m, a sample program of VBMEG 0003 % 0004 % [syntax] 0005 % G = test_job_leadfield(proj_root,test_parm) 0006 % 0007 % [input] 0008 % proj_root: <<string>> VBMEG project root directory. 0009 % test_parm: <<struct>> Test condition variables. 0010 % --- fields of test_parm 0011 % cortex: <<string>> 'bv' for BrainVoyager, 'fs' for FreeSurfer. 0012 % data : <<string>> 'meg' for MEG data, 'eeg' for EEG data. 0013 % method: <<string>> 'sarvas' for Sarvas, 'bem' for BEM. 0014 % --- 0015 % 0016 % [output] 0017 % G: <<matrix>> Leadfield matrix. 0018 % Leadfield file (.basis.mat) is created. 0019 % 0020 % [history] 0021 % 2010-06-30 Taku Yoshioka 0022 % 0023 % Copyright (C) 2011, ATR All Rights Reserved. 0024 % License : New BSD License(see VBMEG_LICENSE.txt) 0025 0026 vb_disp('--- Start: test_job_leadfield'); 0027 resultdir = './vbmeg_result/'; 0028 0029 % 0030 % VBMEG constants 0031 % 0032 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0033 global vbmeg_inst; 0034 const = vbmeg_inst.const; 0035 0036 % 0037 % Standard parameters 0038 % 0039 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0040 switch test_parm.cortex 0041 case 'bv', 0042 basis_parm.brain_file = [resultdir 'sbj_test_bv.brain.mat']; 0043 basis_parm.area_file = [resultdir 'sbj_test_bv.area.mat']; 0044 0045 case 'fs', 0046 basis_parm.brain_file = [resultdir 'sbj_test_fs.brain.mat']; 0047 basis_parm.area_file = [resultdir 'sbj_test_fs.area.mat']; 0048 end 0049 0050 switch test_parm.method, 0051 case 'sarvas', % MEG-Sphere 0052 basis_parm.bem_mode = const.BASIS_MEG_SPHERE; 0053 basis_parm.meg_file = [resultdir 'sbj_test_UR.meg.mat']; 0054 end 0055 0056 % Specify output directory 0057 basis_parm.basis_file = [resultdir 'sbj_test_UR_' test_parm.cortex '_' ... 0058 test_parm.data '_' test_parm.method '.basis.mat']; 0059 0060 % 0061 % Optional parameters 0062 % 0063 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0064 basis_parm.Recalc = OFF; 0065 basis_parm.normal_mode = const.NORMAL_ADJACENT_MEAN; 0066 basis_parm.area_key = []; 0067 basis_parm.Vcenter = []; 0068 0069 % 0070 % Advanced parameters 0071 % 0072 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0073 basis_parm.Basis_mode = const.CURRENT_NORMAL; 0074 basis_parm.func_order = 35; 0075 basis_parm.sigma = [ 1.0 0.0125 1.0 ]; 0076 basis_parm.radius = [ 0.87 0.92 1.0 ]; 0077 0078 % 0079 % Execute vb_job_leadfield 0080 % 0081 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0082 vb_job_leadfield(proj_root,basis_parm); 0083 G = vb_load_basis(basis_parm.basis_file); 0084 vb_disp('--- End : test_job_leadfield');