Home > functions > job > replaced > vb_job_leadfield_old.m

vb_job_leadfield_old

PURPOSE ^

Make leadfield

SYNOPSIS ^

function vb_job_leadfield_old(proj_root,basis_parm)

DESCRIPTION ^

 Make leadfield
  vb_job_leadfield_old(proj_root,basis_parm)

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function vb_job_leadfield_old(proj_root,basis_parm)
0002 % Make leadfield
0003 %  vb_job_leadfield_old(proj_root,basis_parm)
0004 %
0005 % Copyright (C) 2011, ATR All Rights Reserved.
0006 % License : New BSD License(see VBMEG_LICENSE.txt)
0007 
0008 %
0009 % Do not modify following lines
0010 %
0011 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0012 %
0013 % make leadfield
0014 
0015 global vbmeg_inst;
0016 const = vbmeg_inst.const;
0017 
0018 %%% necessary to confirm specification %%%
0019 if ~exist('proj_root','var')
0020   % error
0021   error( 'argument : ''proj_root'' is required');
0022 end
0023 
0024 if ~exist('basis_parm','var')
0025   % error
0026   error( 'argument : ''basis_parm'' is required');
0027 end
0028 
0029 % Output file path
0030 basis_file = [proj_root filesep basis_parm.basis_file];
0031 
0032 basis_parm.proj_root = proj_root;
0033 
0034 %
0035 % Prepare leadfield calculation
0036 %
0037 [V, xx, pick, Qpick, Wsensor, BEM, Vhead, Fhead, Omega, Sout, SPHinfo] = ...
0038          vb_prepare_lead_field(basis_parm);
0039 
0040 %
0041 % Leadfield calculation
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 % Print information
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 % project_file save
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

Generated on Tue 27-Aug-2013 11:46:04 by m2html © 2005