Home > vbmeg > functions > leadfield > vb_job_leadfield_eeg_sphere.m

vb_job_leadfield_eeg_sphere

PURPOSE ^

actual worker function for EEG SARVAS

SYNOPSIS ^

function [basis, basis_parm] = vb_job_leadfield_eeg_sphere(proj_root, basis_parm)

DESCRIPTION ^

 actual worker function for EEG SARVAS
 [usage]
   [basis, basis_parm] = vb_job_leadfield_eeg_sphere(proj_root, basis_parm)
 [input]
    proj_root : <required> project root directory
   basis_parm : <required> <<struct>>
              :  data set in which the specification of calculation is defined
 [output]
   none
 [note]
   <<prior conditions>>
     1) proj_root is valid
     2) basis_parm is commonly valid
 [history]
   2007-01-29 (Sako) initial version
   2007-06-15 (M. Sato) added check_eeg_radius

 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:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function [basis, basis_parm] = vb_job_leadfield_eeg_sphere(proj_root, basis_parm)
0002 % actual worker function for EEG SARVAS
0003 % [usage]
0004 %   [basis, basis_parm] = vb_job_leadfield_eeg_sphere(proj_root, basis_parm)
0005 % [input]
0006 %    proj_root : <required> project root directory
0007 %   basis_parm : <required> <<struct>>
0008 %              :  data set in which the specification of calculation is defined
0009 % [output]
0010 %   none
0011 % [note]
0012 %   <<prior conditions>>
0013 %     1) proj_root is valid
0014 %     2) basis_parm is commonly valid
0015 % [history]
0016 %   2007-01-29 (Sako) initial version
0017 %   2007-06-15 (M. Sato) added check_eeg_radius
0018 %
0019 % Copyright (C) 2011, ATR All Rights Reserved.
0020 % License : New BSD License(see VBMEG_LICENSE.txt)
0021 
0022 % --- CHECK ARGUMENTS --- %
0023 [proj_root, basis_parm] = inner_check_arguments(proj_root, basis_parm);
0024 
0025 % --- MAIN PROCEDURE --------------------------------------------------------- %
0026 %
0027 % pre-processing
0028 [Basis_mode, pick, Qpick, Wsensor, V0, V, xx] = ...
0029   vb_lf_preprocess(proj_root, basis_parm);
0030 
0031 pick = [pick(:,1)-V0(1), pick(:,2)-V0(2), pick(:,3)-V0(3)];
0032 V    = [   V(:,1)-V0(1),    V(:,2)-V0(2),    V(:,3)-V0(3)];
0033 
0034 %basis_parm = vb_util_check_head_shell_info(proj_root, basis_parm);
0035 
0036 % Calculate current direction according to 'Basis_mode'
0037 [V,xx] = vb_current_vector(V, xx, Basis_mode);
0038 
0039 % R    : Relative radii of sphere from innermost to outermost
0040 % sigma: Conductivity  from innermost to outermost
0041 BEM.R     = basis_parm.radius;
0042 BEM.sigma = basis_parm.sigma;
0043 
0044 % EEG 3-shell Sphere model
0045 
0046 [pick, R] = vb_calc_consistent_eeg_radius(V, pick, BEM.R);
0047 
0048 fprintf('--- EEG potential (Sphere model) \n');
0049 fprintf('--- Head radius = %f  \n', R);
0050 
0051 % Electric potential
0052 basis = vb_eeg_legendre(V, xx, pick, R, BEM.sigma);
0053 %
0054 % --- END OF MAIN PROCEDURE -------------------------------------------------- %
0055 
0056 
0057 % --- INNER FUNCTIONS -------------------------------------------------------- %
0058 %
0059 function [proj_root, basis_parm] = inner_check_arguments(proj_root, basis_parm)
0060 
0061 % if you have some check points, you can do them here ...
0062 
0063 return;
0064 %
0065 % --- END OF INNER FUNCTIONS ------------------------------------------------- %
0066 %%% END OF FILE %%%

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005