0001 function vb_job_leadfield_old(proj_root,basis_parm)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 global vbmeg_inst;
0016 const = vbmeg_inst.const;
0017
0018
0019 if ~exist('proj_root','var')
0020
0021 error( 'argument : ''proj_root'' is required');
0022 end
0023
0024 if ~exist('basis_parm','var')
0025
0026 error( 'argument : ''basis_parm'' is required');
0027 end
0028
0029
0030 basis_file = [proj_root filesep basis_parm.basis_file];
0031
0032 basis_parm.proj_root = proj_root;
0033
0034
0035
0036
0037 [V, xx, pick, Qpick, Wsensor, BEM, Vhead, Fhead, Omega, Sout, SPHinfo] = ...
0038 vb_prepare_lead_field(basis_parm);
0039
0040
0041
0042
0043 basis = vb_calc_lead_field(V, xx, pick, Qpick, Wsensor, ...
0044 basis_parm.bem_mode, BEM, Vhead, Fhead, Omega, Sout, SPHinfo);
0045
0046
0047 bem_name = { ...
0048 'MEG spherical model (Sarvas)'; ...
0049 'MEG BEM 1 shell model'; ...
0050 'MEG spherical harmonics expansion'; ...
0051 'EEG spherical 3 shell model'; ...
0052 'EEG BEM 3 shell model'; ...
0053 };
0054
0055 fprintf('Leadfield calculation : %s\n',bem_name{basis_parm.bem_mode+1})
0056 fprintf('Current direction = %d\n',basis_parm.Basis_mode)
0057
0058 if isfield(basis_parm, 'normal_mode') ...
0059 & basis_parm.normal_mode == const.NORMAL_NEIGHBOR_MEAN,
0060 fprintf('Normal vector is averaged over neighborhood\n')
0061 end
0062
0063 fprintf('Save basis file [%s]\n',basis_file)
0064
0065 vb_save(basis_file,'basis','basis_parm');
0066
0067
0068 proj_file = get_project_filename;
0069 if isempty(proj_file)
0070 return;
0071 end
0072
0073 project_file_mgr('load', proj_file);
0074 project_file_mgr('add', 'basis_parm', basis_parm);
0075