Home > bioelectromagnetism > eeg_interp_sph_spline_scd.m

eeg_interp_sph_spline_scd

PURPOSE ^

eeg_interp_sph_spline_scd - Spherical Spline Scalp Current Density

SYNOPSIS ^

function [FV,C] = eeg_interp_sph_spline_scd(Zi,Ei)

DESCRIPTION ^

 eeg_interp_sph_spline_scd - Spherical Spline Scalp Current Density

 Useage: [FV,C] = eeg_interp_sph_spline_scd(Zi,Ei)

 This function calls eeg_interp_sph_spline,
 and replaces the relevant sections from Perrin et al. (1990)
 to calculate the scalp current density (SCD).

 FV => interpolated spherical surface

 FV.faces    => triangulation of FV.vertices 
 FV.vertices => cartesian coordinates (Nx3)
 FV.Cdata    => spherical spline SCD at FV.vertices
 
 C => interpolation coefficients of Ei (includes co = C(1))
 
 Notes:    This function calculates the spherical spline SCD of 
           Perrin et al (1989).  Electroenceph. & Clin. 
             Neurophysiology, 72: 184-187. Corrigenda (1990),
             Electroenceph. & Clin. Neurophysiology, 76: 565.
             (see comments in the .m file for details).

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [FV,C] = eeg_interp_sph_spline_scd(Zi,Ei)
0002 
0003 % eeg_interp_sph_spline_scd - Spherical Spline Scalp Current Density
0004 %
0005 % Useage: [FV,C] = eeg_interp_sph_spline_scd(Zi,Ei)
0006 %
0007 % This function calls eeg_interp_sph_spline,
0008 % and replaces the relevant sections from Perrin et al. (1990)
0009 % to calculate the scalp current density (SCD).
0010 %
0011 % FV => interpolated spherical surface
0012 %
0013 % FV.faces    => triangulation of FV.vertices
0014 % FV.vertices => cartesian coordinates (Nx3)
0015 % FV.Cdata    => spherical spline SCD at FV.vertices
0016 %
0017 % C => interpolation coefficients of Ei (includes co = C(1))
0018 %
0019 % Notes:    This function calculates the spherical spline SCD of
0020 %           Perrin et al (1989).  Electroenceph. & Clin.
0021 %             Neurophysiology, 72: 184-187. Corrigenda (1990),
0022 %             Electroenceph. & Clin. Neurophysiology, 76: 565.
0023 %             (see comments in the .m file for details).
0024 
0025 % $Revision: 1.1 $ $Date: 2004/11/12 01:32:33 $
0026 
0027 % Licence:  GNU GPL, no implied or express warranties
0028 % History:  10/2003 Darren.Weber_at_radiology.ucsf.edu, with
0029 %                   adapted from eeg_interp_sph_spline
0030 %
0031 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0032 
0033 [C,r] = eeg_interp_sph_spline_c(Zi,Ei);
0034 
0035 Co = C(1);
0036 Ci = C(2:end);
0037 
0038 eegversion = '$Revision: 1.1 $';
0039 fprintf('EEG_INTERP_SPH_SPLINE_SCD [v %s]\n',eegversion(11:15)); tic
0040 
0041 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0042 % Now that C is solved, we can obtain interpolated scalp current density
0043 % at Ej (Eq. 5)
0044 
0045 % create spherical interpolation positions
0046 fprintf('...generating spherical interpolation points\n');
0047 FV = sphere_tri('ico',4,r);
0048 
0049 % cosines between measurement electrodes and interpolation points
0050 Cos = elec_cosines(Ei,FV.vertices);
0051 
0052 % Calculate h(x)
0053 Hx = eeg_interp_sph_spline_h(Cos,r);  % nElectrodes x NinterpolationPoints
0054 
0055 % Solve Eq 5.
0056 FV.Cdata = (Ci' * Hx)';
0057 
0058 t=toc; fprintf('...done (%6.2f sec)\n',t);
0059 
0060 return

Generated on Mon 15-Aug-2005 15:36:19 by m2html © 2003