Lead field for dipole estimation G = vb_dipole_basis(V, xx, pick, Qpick, Wsensor, V0, mode) --- INPUT V(n,:) : dipole position (3-D coordinate) at n-th vertex xx(n,:) : dipole current direction (unit vector) at n-th vertex pick(k, 1:3) : Sensor coil position : コイル位置, Qpick(k, 1:3) : Sensor coil direction : コイル方向 Wsensor(m,n) = n-th coil weight for m-th sensor channel basis(channel,dipole) = Wsensor * basis(coil,dipole) --- Optional input V0 : Center of spherical model (1 x 3) = [0 0 0] (default) mode = 0: Biot-Savart (default) = 1: Sarvas = 2: Magnetic dipole = 3: EEG --- Output G : Lead Field (Ndipole, Nsensor) 2006-12-16 made by M.Sato 2007-7-9 modified by M.Sato Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function G = vb_dipole_basis(V, xx, pick, Qpick, Wsensor, V0, mode) 0002 % Lead field for dipole estimation 0003 % G = vb_dipole_basis(V, xx, pick, Qpick, Wsensor, V0, mode) 0004 % --- INPUT 0005 % V(n,:) : dipole position (3-D coordinate) at n-th vertex 0006 % xx(n,:) : dipole current direction (unit vector) at n-th vertex 0007 % pick(k, 1:3) : Sensor coil position : コイル位置, 0008 % Qpick(k, 1:3) : Sensor coil direction : コイル方向 0009 % 0010 % Wsensor(m,n) = n-th coil weight for m-th sensor channel 0011 % basis(channel,dipole) = Wsensor * basis(coil,dipole) 0012 % --- Optional input 0013 % V0 : Center of spherical model (1 x 3) = [0 0 0] (default) 0014 % mode = 0: Biot-Savart (default) 0015 % = 1: Sarvas 0016 % = 2: Magnetic dipole 0017 % = 3: EEG 0018 % --- Output 0019 % G : Lead Field (Ndipole, Nsensor) 0020 % 0021 % 2006-12-16 made by M.Sato 0022 % 2007-7-9 modified by M.Sato 0023 % 0024 % Copyright (C) 2011, ATR All Rights Reserved. 0025 % License : New BSD License(see VBMEG_LICENSE.txt) 0026 0027 if ~exist('V0','var') | isempty(V0), V0 = [0 0 0]; end; 0028 if ~exist('mode','var'), mode = 0; end; 0029 0030 % Change center of coordinate 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 switch mode 0035 case 0 0036 % Magnetic field by Biot-Savart 0037 G = vb_dipole_magnetic(V, xx, pick, Qpick ) * Wsensor'; 0038 case 1 0039 % Magnetic field by Sarvas 0040 G = vb_sarvas_basis(V, xx, pick, Qpick) * Wsensor'; 0041 case 2 0042 % Magnetic field by magnetic dipole 0043 G = vb_dipole_field_magdipole(V, xx, pick, Qpick ) * Wsensor'; 0044 case 3 0045 % EEG 3-shell Sphere model 0046 R = [ 0.87 0.92 1.0 ]; 0047 Rmax = max(sqrt(sum(V.^2,2))); 0048 Rpick = mean(sqrt(sum(pick.^2,2))); 0049 R = R * Rpick; 0050 % Conductivity from innermost to outermost 0051 sigma = [ 0.62 0.03 0.62 ]; 0052 0053 % Electric potential 0054 G = vb_eeg_legendre(V, xx, pick, R, sigma); 0055 end 0056 0057