check EEG sensor radius [pick, R] = vb_calc_consistent_eeg_radius(V.pick,Rrate) Check (EEG radius)*Rrate(1) > (dipole radius) if not satisfied, R & pick are adjusted to satisfy this constraint pick : EEG sensor position V : dipole position Rrate : Relative radius of sphere from innermost to outermost R : Radius of sphere from innermost to outermost 2007/6/15 Masa-aki Sato 2007-12-6 M. Sato Rmargin is changed Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function [pick, R] = vb_calc_consistent_eeg_radius(V,pick,Rrate) 0002 % check EEG sensor radius 0003 % [pick, R] = vb_calc_consistent_eeg_radius(V.pick,Rrate) 0004 % 0005 % Check (EEG radius)*Rrate(1) > (dipole radius) 0006 % if not satisfied, R & pick are adjusted to satisfy this constraint 0007 % 0008 % pick : EEG sensor position 0009 % V : dipole position 0010 % Rrate : Relative radius of sphere from innermost to outermost 0011 % R : Radius of sphere from innermost to outermost 0012 % 0013 % 2007/6/15 Masa-aki Sato 0014 % 2007-12-6 M. Sato 0015 % Rmargin is changed 0016 % 0017 % Copyright (C) 2011, ATR All Rights Reserved. 0018 % License : New BSD License(see VBMEG_LICENSE.txt) 0019 0020 % Rrate = [ 0.87 0.92 1.0 ] 0021 0022 Rmargin = 1.05; 0023 0024 % Check Rrate is increasing order 0025 Rdif = diff(Rrate); 0026 0027 if any(Rdif < 0), 0028 error('Relative radius is not increasing order') 0029 end 0030 0031 Rrate = Rrate/Rrate(end); 0032 0033 % Max of dipole radius 0034 Rmax = sqrt(max(sum(V.^2,2))); 0035 0036 % Rmax calculated from dipole radius 0037 Rmax = Rmax*Rmargin/Rrate(1); 0038 0039 % Mean of EEG sensor radius 0040 Rpick = sqrt(mean(sum(pick.^2,2))); 0041 0042 % Check (EEG radius) >= Rmax 0043 if Rpick < Rmax, Rpick = Rmax; end; 0044 0045 R = Rrate * Rpick; 0046 0047 % Radius of pick is set to Rpick 0048 Reeg = sqrt(sum(pick.^2, 2)); 0049 pick = Rpick * pick./Reeg(:,ones(1,3)); % EEG sensor ( M x 3 ) 0050