0001 function [closest,d]=nt_proximity(coordinates,N)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 nt_greetings();
0030
0031 disp(coordinates)
0032
0033 if nargin<1; error('!'); end
0034 if nargin<2; N=[]; end
0035 if isempty(coordinates); error('!'); end
0036
0037
0038 if ischar(coordinates)
0039 switch coordinates
0040 case {'biosemi256.lay','biosemi160.lay','biosemi128.lay', 'biosemi64.lay', 'biosemi32.lay', 'biosemi16.lay'};
0041 cfg.layout=coordinates;
0042 layout=ft_prepare_layout(cfg);
0043 coordinates=layout.pos;
0044 coordinates=coordinates(1:end-2,:);
0045 otherwise
0046 if exist (coordinates,'file') && numel(coordinates)>4 && all(coordinates(end-3:end)=='.lay')
0047 fid=fopen(coordinates);
0048 a=textscan(fid, '%d %f %f %f %f %s');
0049 fclose(fid);
0050 coordinates=[a{2},a{3}];
0051 elseif exist (coordinates,'file') && numel(coordinates)>4 && all(coordinates(end-3:end)=='.ced')
0052 fid=fopen(coordinates);
0053 a=textscan(fid,'%d%s%f%f%f%f%f%f%f%d', 'headerlines', 1);
0054 fclose(fid);
0055 coordinates=[a{5},a{6},a{7}];
0056 elseif exist (coordinates,'file') && numel(coordinates)>4 && all(coordinates(end-3:end)=='.loc')
0057 fid=fopen(coordinates);
0058 a=textscan(fid, '%d %f %f %s');
0059 fclose(fid);
0060 coordinates=[a{2},a{3}];
0061 elseif exist (coordinates,'file') && numel(coordinates)>4 && all(coordinates(end-3:end)=='.mat')
0062 load (coordinates);
0063 coordinates=lay.pos;
0064 coordinates=coordinates(1:end-2,:);
0065 end
0066 end
0067 end
0068
0069 if isempty(N); N=size(coordinates,1)-1; end
0070
0071 if isnumeric(coordinates)
0072 if size(coordinates,1)==1
0073 if numel(coordinates)==2
0074 nrows=coordinates(1); ncols=coordinates(2);
0075 a=repmat(1:nrows,ncols,1); b=repmat((1:ncols)',1,nrows); c=[a(:),b(:)];
0076 [closest,d]=knnsearch(c,c,'K',N+1);
0077 closest=closest(:,2:end);
0078 d=d(:,2:end);
0079 else
0080 error('cuboids, etc not yet implemented');
0081 end
0082 else
0083 if 0
0084 [nchans, ~]=size(coordinates);
0085 d=zeros(nchans);
0086 closest=zeros(nchans);
0087 for iChan=1:nchans
0088 d(iChan,:)=sqrt( sum( bsxfun(@minus,coordinates, coordinates(iChan,:)).^2, 2) )';
0089 [~,closest(iChan,:)]=sort(d(iChan,:)','ascend');
0090 end
0091 else
0092 [nchans, ~]=size(coordinates);
0093 if ~isempty(N)
0094 d=zeros(nchans,N+1);
0095 closest=zeros(nchans,N+1);
0096 tic;
0097 for iChan=1:nchans
0098 if 0==rem(iChan,1000); disp([iChan, nchans]); toc; end;
0099 dd=sqrt( sum( bsxfun(@minus,coordinates, coordinates(iChan,:)).^2, 2) )';
0100 [~,cc]=sort(dd','ascend');
0101 closest(iChan,:)=cc(1:N+1);
0102 d(iChan,:)=dd(1:N+1);
0103 end
0104 end
0105 end
0106 if ~isempty(closest); closest=closest(:,2:end); end
0107 end
0108 elseif iscell(coordinates) && ischar(coordinates{1});
0109 nchans=numel(coordinates);
0110 elec=elec_1020all_cart;
0111 labels={elec(:).labels};
0112 c=[];
0113 for iChan=1:nchans
0114 idx=find(strcmp(deblank(coordinates{iChan}),deblank(labels)));
0115 if numel(idx) ~= 1; error(['label not recognized: ',coordinates{iChan}]); end
0116 c=[c;[elec(idx).X, elec(idx).Y, elec(idx).Z]];
0117 end
0118 [closest,d]=nt_proximity(c);
0119 else
0120 error('coordinates should be numeric or cell array of strings');
0121 end
0122
0123 if ~isempty(N);
0124 closest=closest(:,1:N);
0125 d=d(:,1:N);
0126 end
0127
0128
0129
0130 function [elec] = elec_1020all_cart
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143
0144
0145
0146
0147
0148
0149
0150
0151
0152
0153
0154
0155
0156
0157
0158
0159
0160
0161
0162
0163
0164
0165
0166
0167
0168
0169
0170
0171
0172
0173
0174
0175
0176
0177
0178
0179
0180 names = {'LPA','RPA','Nz','Fp1','Fpz','Fp2','AF9','AF7','AF5','AF3',...
0181 'AF1','AFz','AF2','AF4','AF6','AF8','AF10','F9','F7','F5','F3','F1',...
0182 'Fz','F2','F4','F6','F8','F10','FT9','FT7','FC5','FC3','FC1','FCz',...
0183 'FC2','FC4','FC6','FT8','FT10','T9','T7','C5','C3','C1','Cz','C2',...
0184 'C4','C6','T8','T10','TP9','TP7','CP5','CP3','CP1','CPz','CP2','CP4',...
0185 'CP6','TP8','TP10','P9','P7','P5','P3','P1','Pz','P2','P4','P6','P8',...
0186 'P10','PO9','PO7','PO5','PO3','PO1','POz','PO2','PO4','PO6','PO8',...
0187 'PO10','O1','Oz','O2','I1','Iz','I2','AFp9h','AFp7h','AFp5h','AFp3h',...
0188 'AFp1h','AFp2h','AFp4h','AFp6h','AFp8h','AFp10h','AFF9h','AFF7h',...
0189 'AFF5h','AFF3h','AFF1h','AFF2h','AFF4h','AFF6h','AFF8h','AFF10h',...
0190 'FFT9h','FFT7h','FFC5h','FFC3h','FFC1h','FFC2h','FFC4h','FFC6h',...
0191 'FFT8h','FFT10h','FTT9h','FTT7h','FCC5h','FCC3h','FCC1h','FCC2h',...
0192 'FCC4h','FCC6h','FTT8h','FTT10h','TTP9h','TTP7h','CCP5h','CCP3h',...
0193 'CCP1h','CCP2h','CCP4h','CCP6h','TTP8h','TTP10h','TPP9h','TPP7h',...
0194 'CPP5h','CPP3h','CPP1h','CPP2h','CPP4h','CPP6h','TPP8h','TPP10h',...
0195 'PPO9h','PPO7h','PPO5h','PPO3h','PPO1h','PPO2h','PPO4h','PPO6h',...
0196 'PPO8h','PPO10h','POO9h','POO7h','POO5h','POO3h','POO1h','POO2h',...
0197 'POO4h','POO6h','POO8h','POO10h','OI1h','OI2h','Fp1h','Fp2h','AF9h',...
0198 'AF7h','AF5h','AF3h','AF1h','AF2h','AF4h','AF6h','AF8h','AF10h',...
0199 'F9h','F7h','F5h','F3h','F1h','F2h','F4h','F6h','F8h','F10h','FT9h',...
0200 'FT7h','FC5h','FC3h','FC1h','FC2h','FC4h','FC6h','FT8h','FT10h',...
0201 'T9h','T7h','C5h','C3h','C1h','C2h','C4h','C6h','T8h','T10h','TP9h',...
0202 'TP7h','CP5h','CP3h','CP1h','CP2h','CP4h','CP6h','TP8h','TP10h',...
0203 'P9h','P7h','P5h','P3h','P1h','P2h','P4h','P6h','P8h','P10h','PO9h',...
0204 'PO7h','PO5h','PO3h','PO1h','PO2h','PO4h','PO6h','PO8h','PO10h','O1h',...
0205 'O2h','I1h','I2h','AFp9','AFp7','AFp5','AFp3','AFp1','AFpz','AFp2',...
0206 'AFp4','AFp6','AFp8','AFp10','AFF9','AFF7','AFF5','AFF3','AFF1',...
0207 'AFFz','AFF2','AFF4','AFF6','AFF8','AFF10','FFT9','FFT7','FFC5',...
0208 'FFC3','FFC1','FFCz','FFC2','FFC4','FFC6','FFT8','FFT10','FTT9',...
0209 'FTT7','FCC5','FCC3','FCC1','FCCz','FCC2','FCC4','FCC6','FTT8',...
0210 'FTT10','TTP9','TTP7','CCP5','CCP3','CCP1','CCPz','CCP2','CCP4',...
0211 'CCP6','TTP8','TTP10','TPP9','TPP7','CPP5','CPP3','CPP1','CPPz',...
0212 'CPP2','CPP4','CPP6','TPP8','TPP10','PPO9','PPO7','PPO5','PPO3',...
0213 'PPO1','PPOz','PPO2','PPO4','PPO6','PPO8','PPO10','POO9','POO7',...
0214 'POO5','POO3','POO1','POOz','POO2','POO4','POO6','POO8','POO10',...
0215 'OI1','OIz','OI2','T3','T5','T4','T6'};
0216
0217 xyz = [ ...
0218 0.0000 0.9237 -0.3826 ;
0219 0.0000 -0.9237 -0.3826 ;
0220 0.9230 0.0000 -0.3824 ;
0221 0.9511 0.3090 0.0001 ;
0222 1.0000 0.0000 0.0001 ;
0223 0.9511 -0.3091 0.0000 ;
0224 0.7467 0.5425 -0.3825 ;
0225 0.8090 0.5878 0.0000 ;
0226 0.8553 0.4926 0.1552 ;
0227 0.8920 0.3554 0.2782 ;
0228 0.9150 0.1857 0.3558 ;
0229 0.9230 0.0000 0.3824 ;
0230 0.9150 -0.1857 0.3558 ;
0231 0.8919 -0.3553 0.2783 ;
0232 0.8553 -0.4926 0.1552 ;
0233 0.8090 -0.5878 0.0000 ;
0234 0.7467 -0.5425 -0.3825 ;
0235 0.5430 0.7472 -0.3826 ;
0236 0.5878 0.8090 0.0000 ;
0237 0.6343 0.7210 0.2764 ;
0238 0.6726 0.5399 0.5043 ;
0239 0.6979 0.2888 0.6542 ;
0240 0.7067 0.0000 0.7067 ;
0241 0.6979 -0.2888 0.6542 ;
0242 0.6726 -0.5399 0.5043 ;
0243 0.6343 -0.7210 0.2764 ;
0244 0.5878 -0.8090 0.0000 ;
0245 0.5429 -0.7472 -0.3826 ;
0246 0.2852 0.8777 -0.3826 ;
0247 0.3090 0.9511 0.0000 ;
0248 0.3373 0.8709 0.3549 ;
0249 0.3612 0.6638 0.6545 ;
0250 0.3770 0.3581 0.8532 ;
0251 0.3826 0.0000 0.9233 ;
0252 0.3770 -0.3581 0.8532 ;
0253 0.3612 -0.6638 0.6545 ;
0254 0.3373 -0.8709 0.3549 ;
0255 0.3090 -0.9511 0.0000 ;
0256 0.2852 -0.8777 -0.3826 ;
0257 -0.0001 0.9237 -0.3826 ;
0258 0.0000 1.0000 0.0000 ;
0259 0.0001 0.9237 0.3826 ;
0260 0.0001 0.7066 0.7066 ;
0261 0.0002 0.3824 0.9231 ;
0262 0.0002 0.0000 1.0000 ;
0263 0.0001 -0.3824 0.9231 ;
0264 0.0001 -0.7066 0.7066 ;
0265 0.0001 -0.9237 0.3826 ;
0266 0.0000 -1.0000 0.0000 ;
0267 0.0000 -0.9237 -0.3826 ;
0268 -0.2852 0.8777 -0.3826 ;
0269 -0.3090 0.9511 -0.0001 ;
0270 -0.3372 0.8712 0.3552 ;
0271 -0.3609 0.6635 0.6543 ;
0272 -0.3767 0.3580 0.8534 ;
0273 -0.3822 0.0000 0.9231 ;
0274 -0.3767 -0.3580 0.8534 ;
0275 -0.3608 -0.6635 0.6543 ;
0276 -0.3372 -0.8712 0.3552 ;
0277 -0.3090 -0.9511 -0.0001 ;
0278 -0.2853 -0.8777 -0.3826 ;
0279 -0.5429 0.7472 -0.3826 ;
0280 -0.5878 0.8090 -0.0001 ;
0281 -0.6342 0.7211 0.2764 ;
0282 -0.6724 0.5401 0.5045 ;
0283 -0.6975 0.2889 0.6545 ;
0284 -0.7063 0.0000 0.7065 ;
0285 -0.6975 -0.2889 0.6545 ;
0286 -0.6724 -0.5401 0.5045 ;
0287 -0.6342 -0.7211 0.2764 ;
0288 -0.5878 -0.8090 -0.0001 ;
0289 -0.5429 -0.7472 -0.3826 ;
0290 -0.7467 0.5425 -0.3825 ;
0291 -0.8090 0.5878 0.0000 ;
0292 -0.8553 0.4929 0.1555 ;
0293 -0.8918 0.3549 0.2776 ;
0294 -0.9151 0.1858 0.3559 ;
0295 -0.9230 0.0000 0.3824 ;
0296 -0.9151 -0.1859 0.3559 ;
0297 -0.8918 -0.3549 0.2776 ;
0298 -0.8553 -0.4929 0.1555 ;
0299 -0.8090 -0.5878 0.0000 ;
0300 -0.7467 -0.5425 -0.3825 ;
0301 -0.9511 0.3090 0.0000 ;
0302 -1.0000 0.0000 0.0000 ;
0303 -0.9511 -0.3090 0.0000 ;
0304 -0.8785 0.2854 -0.3824 ;
0305 -0.9230 0.0000 -0.3823 ;
0306 -0.8785 -0.2854 -0.3824 ;
0307 0.8732 0.4449 -0.1949 ;
0308 0.9105 0.4093 0.0428 ;
0309 0.9438 0.3079 0.1159 ;
0310 0.9669 0.1910 0.1666 ;
0311 0.9785 0.0647 0.1919 ;
0312 0.9785 -0.0647 0.1919 ;
0313 0.9669 -0.1910 0.1666 ;
0314 0.9438 -0.3079 0.1159 ;
0315 0.9105 -0.4093 0.0428 ;
0316 0.8732 -0.4449 -0.1949 ;
0317 0.6929 0.6929 -0.1949 ;
0318 0.7325 0.6697 0.1137 ;
0319 0.7777 0.5417 0.3163 ;
0320 0.8111 0.3520 0.4658 ;
0321 0.8289 0.1220 0.5452 ;
0322 0.8289 -0.1220 0.5452 ;
0323 0.8111 -0.3520 0.4658 ;
0324 0.7777 -0.5417 0.3163 ;
0325 0.7325 -0.6697 0.1138 ;
0326 0.6929 -0.6929 -0.1949 ;
0327 0.4448 0.8730 -0.1950 ;
0328 0.4741 0.8642 0.1647 ;
0329 0.5107 0.7218 0.4651 ;
0330 0.5384 0.4782 0.6925 ;
0331 0.5533 0.1672 0.8148 ;
0332 0.5533 -0.1672 0.8148 ;
0333 0.5384 -0.4782 0.6925 ;
0334 0.5107 -0.7218 0.4651 ;
0335 0.4741 -0.8642 0.1647 ;
0336 0.4448 -0.8730 -0.1950 ;
0337 0.1533 0.9678 -0.1950 ;
0338 0.1640 0.9669 0.1915 ;
0339 0.1779 0.8184 0.5448 ;
0340 0.1887 0.5466 0.8154 ;
0341 0.1944 0.1919 0.9615 ;
0342 0.1944 -0.1919 0.9615 ;
0343 0.1887 -0.5466 0.8154 ;
0344 0.1779 -0.8184 0.5448 ;
0345 0.1640 -0.9669 0.1915 ;
0346 0.1533 -0.9678 -0.1950 ;
0347 -0.1532 0.9678 -0.1950 ;
0348 -0.1639 0.9669 0.1915 ;
0349 -0.1778 0.8185 0.5449 ;
0350 -0.1883 0.5465 0.8153 ;
0351 -0.1940 0.1918 0.9611 ;
0352 -0.1940 -0.1918 0.9611 ;
0353 -0.1884 -0.5465 0.8153 ;
0354 -0.1778 -0.8185 0.5449 ;
0355 -0.1639 -0.9669 0.1915 ;
0356 -0.1533 -0.9678 -0.1950 ;
0357 -0.4448 0.8731 -0.1950 ;
0358 -0.4740 0.8639 0.1646 ;
0359 -0.5106 0.7220 0.4653 ;
0360 -0.5384 0.4786 0.6933 ;
0361 -0.5532 0.1673 0.8155 ;
0362 -0.5532 -0.1673 0.8155 ;
0363 -0.5384 -0.4786 0.6933 ;
0364 -0.5106 -0.7220 0.4653 ;
0365 -0.4740 -0.8638 0.1646 ;
0366 -0.4449 -0.8731 -0.1950 ;
0367 -0.6928 0.6928 -0.1950 ;
0368 -0.7324 0.6700 0.1139 ;
0369 -0.7776 0.5420 0.3167 ;
0370 -0.8108 0.3520 0.4659 ;
0371 -0.8284 0.1220 0.5453 ;
0372 -0.8284 -0.1220 0.5453 ;
0373 -0.8108 -0.3519 0.4659 ;
0374 -0.7775 -0.5421 0.3167 ;
0375 -0.7324 -0.6700 0.1139 ;
0376 -0.6928 -0.6928 -0.1950 ;
0377 -0.8730 0.4448 -0.1950 ;
0378 -0.9106 0.4097 0.0430 ;
0379 -0.9438 0.3080 0.1160 ;
0380 -0.9665 0.1908 0.1657 ;
0381 -0.9783 0.0647 0.1918 ;
0382 -0.9783 -0.0647 0.1918 ;
0383 -0.9665 -0.1908 0.1657 ;
0384 -0.9438 -0.3080 0.1160 ;
0385 -0.9106 -0.4097 0.0430 ;
0386 -0.8730 -0.4448 -0.1950 ;
0387 -0.9679 0.1533 -0.1950 ;
0388 -0.9679 -0.1533 -0.1950 ;
0389 0.9877 0.1564 0.0001 ;
0390 0.9877 -0.1564 0.0001 ;
0391 0.7928 0.5759 -0.1949 ;
0392 0.8332 0.5463 0.0810 ;
0393 0.8750 0.4284 0.2213 ;
0394 0.9053 0.2735 0.3231 ;
0395 0.9211 0.0939 0.3758 ;
0396 0.9210 -0.0939 0.3758 ;
0397 0.9053 -0.2735 0.3231 ;
0398 0.8750 -0.4284 0.2212 ;
0399 0.8332 -0.5463 0.0810 ;
0400 0.7927 -0.5759 -0.1949 ;
0401 0.5761 0.7929 -0.1949 ;
0402 0.6117 0.7772 0.1420 ;
0403 0.6549 0.6412 0.3987 ;
0404 0.6872 0.4214 0.5906 ;
0405 0.7045 0.1468 0.6933 ;
0406 0.7045 -0.1468 0.6933 ;
0407 0.6872 -0.4214 0.5906 ;
0408 0.6549 -0.6412 0.3987 ;
0409 0.6117 -0.7772 0.1420 ;
0410 0.5761 -0.7929 -0.1949 ;
0411 0.3027 0.9317 -0.1950 ;
0412 0.3235 0.9280 0.1813 ;
0413 0.3500 0.7817 0.5146 ;
0414 0.3703 0.5207 0.7687 ;
0415 0.3811 0.1824 0.9054 ;
0416 0.3811 -0.1824 0.9054 ;
0417 0.3703 -0.5207 0.7687 ;
0418 0.3500 -0.7817 0.5146 ;
0419 0.3235 -0.9280 0.1813 ;
0420 0.3028 -0.9317 -0.1950 ;
0421 0.0000 0.9801 -0.1950 ;
0422 0.0000 0.9801 0.1949 ;
0423 0.0001 0.8311 0.5552 ;
0424 0.0002 0.5550 0.8306 ;
0425 0.0001 0.1950 0.9801 ;
0426 0.0002 -0.1950 0.9801 ;
0427 0.0002 -0.5550 0.8306 ;
0428 0.0001 -0.8311 0.5552 ;
0429 0.0000 -0.9801 0.1949 ;
0430 0.0000 -0.9801 -0.1950 ;
0431 -0.3028 0.9319 -0.1949 ;
0432 -0.3234 0.9278 0.1813 ;
0433 -0.3498 0.7818 0.5148 ;
0434 -0.3699 0.5206 0.7688 ;
0435 -0.3808 0.1825 0.9059 ;
0436 -0.3808 -0.1825 0.9059 ;
0437 -0.3699 -0.5206 0.7688 ;
0438 -0.3498 -0.7818 0.5148 ;
0439 -0.3234 -0.9278 0.1813 ;
0440 -0.3028 -0.9319 -0.1949 ;
0441 -0.5761 0.7929 -0.1950 ;
0442 -0.6116 0.7771 0.1420 ;
0443 -0.6546 0.6411 0.3985 ;
0444 -0.6869 0.4217 0.5912 ;
0445 -0.7041 0.1469 0.6934 ;
0446 -0.7041 -0.1469 0.6934 ;
0447 -0.6870 -0.4216 0.5912 ;
0448 -0.6546 -0.6411 0.3985 ;
0449 -0.6116 -0.7771 0.1420 ;
0450 -0.5761 -0.7929 -0.1950 ;
0451 -0.7926 0.5759 -0.1950 ;
0452 -0.8331 0.5459 0.0809 ;
0453 -0.8752 0.4292 0.2219 ;
0454 -0.9054 0.2737 0.3233 ;
0455 -0.9210 0.0939 0.3757 ;
0456 -0.9210 -0.0940 0.3757 ;
0457 -0.9054 -0.2737 0.3233 ;
0458 -0.8752 -0.4292 0.2219 ;
0459 -0.8331 -0.5459 0.0809 ;
0460 -0.7926 -0.5758 -0.1950 ;
0461 -0.9877 0.1564 0.0000 ;
0462 -0.9877 -0.1564 0.0000 ;
0463 -0.9118 0.1444 -0.3824 ;
0464 -0.9118 -0.1444 -0.3824 ;
0465 0.8225 0.4190 -0.3825 ;
0466 0.8910 0.4540 0.0000 ;
0467 0.9282 0.3606 0.0817 ;
0468 0.9565 0.2508 0.1438 ;
0469 0.9743 0.1287 0.1828 ;
0470 0.9799 0.0000 0.1949 ;
0471 0.9743 -0.1287 0.1828 ;
0472 0.9565 -0.2508 0.1437 ;
0473 0.9282 -0.3606 0.0817 ;
0474 0.8910 -0.4540 0.0000 ;
0475 0.8225 -0.4191 -0.3825 ;
0476 0.6527 0.6527 -0.3825 ;
0477 0.7071 0.7071 0.0000 ;
0478 0.7564 0.6149 0.2206 ;
0479 0.7962 0.4535 0.3990 ;
0480 0.8221 0.2404 0.5148 ;
0481 0.8312 0.0000 0.5554 ;
0482 0.8221 -0.2404 0.5148 ;
0483 0.7962 -0.4535 0.3990 ;
0484 0.7564 -0.6149 0.2206 ;
0485 0.7071 -0.7071 0.0000 ;
0486 0.6527 -0.6527 -0.3825 ;
0487 0.4192 0.8226 -0.3826 ;
0488 0.4540 0.8910 0.0000 ;
0489 0.4932 0.8072 0.3215 ;
0490 0.5260 0.6110 0.5905 ;
0491 0.5477 0.3286 0.7685 ;
0492 0.5553 0.0000 0.8310 ;
0493 0.5477 -0.3286 0.7685 ;
0494 0.5260 -0.6110 0.5905 ;
0495 0.4932 -0.8072 0.3216 ;
0496 0.4540 -0.8910 0.0000 ;
0497 0.4192 -0.8226 -0.3826 ;
0498 0.1444 0.9119 -0.3826 ;
0499 0.1565 0.9877 0.0000 ;
0500 0.1713 0.9099 0.3754 ;
0501 0.1838 0.6957 0.6933 ;
0502 0.1922 0.3764 0.9059 ;
0503 0.1951 0.0000 0.9804 ;
0504 0.1922 -0.3764 0.9059 ;
0505 0.1838 -0.6957 0.6933 ;
0506 0.1713 -0.9099 0.3754 ;
0507 0.1564 -0.9877 0.0000 ;
0508 0.1444 -0.9119 -0.3826 ;
0509 -0.1444 0.9117 -0.3826 ;
0510 -0.1564 0.9877 -0.0001 ;
0511 -0.1711 0.9100 0.3754 ;
0512 -0.1836 0.6959 0.6936 ;
0513 -0.1918 0.3763 0.9056 ;
0514 -0.1948 0.0000 0.9800 ;
0515 -0.1919 -0.3763 0.9056 ;
0516 -0.1836 -0.6959 0.6936 ;
0517 -0.1711 -0.9100 0.3754 ;
0518 -0.1564 -0.9877 -0.0001 ;
0519 -0.1444 -0.9117 -0.3826 ;
0520 -0.4191 0.8225 -0.3826 ;
0521 -0.4540 0.8910 -0.0001 ;
0522 -0.4931 0.8073 0.3216 ;
0523 -0.5259 0.6109 0.5904 ;
0524 -0.5476 0.3285 0.7685 ;
0525 -0.5551 0.0000 0.8311 ;
0526 -0.5475 -0.3286 0.7685 ;
0527 -0.5258 -0.6109 0.5904 ;
0528 -0.4931 -0.8073 0.3216 ;
0529 -0.4540 -0.8910 -0.0001 ;
0530 -0.4191 -0.8225 -0.3826 ;
0531 -0.6529 0.6529 -0.3825 ;
0532 -0.7071 0.7071 0.0000 ;
0533 -0.7561 0.6147 0.2205 ;
0534 -0.7960 0.4537 0.3995 ;
0535 -0.8218 0.2405 0.5152 ;
0536 -0.8306 0.0000 0.5551 ;
0537 -0.8218 -0.2405 0.5152 ;
0538 -0.7960 -0.4537 0.3995 ;
0539 -0.7562 -0.6147 0.2205 ;
0540 -0.7071 -0.7071 0.0000 ;
0541 -0.6529 -0.6529 -0.3825 ;
0542 -0.8228 0.4191 -0.3824 ;
0543 -0.8910 0.4540 0.0000 ;
0544 -0.9283 0.3608 0.0818 ;
0545 -0.9567 0.2511 0.1442 ;
0546 -0.9739 0.1285 0.1822 ;
0547 -0.9797 0.0000 0.1949 ;
0548 -0.9739 -0.1286 0.1822 ;
0549 -0.9567 -0.2511 0.1442 ;
0550 -0.9283 -0.3608 0.0818 ;
0551 -0.8910 -0.4540 0.0000 ;
0552 -0.8228 -0.4191 -0.3824 ;
0553 -0.9322 0.3029 -0.1949 ;
0554 -0.9799 0.0000 -0.1949 ;
0555 -0.9322 -0.3029 -0.1949 ;
0556 0.0000 1.0000 0.0000 ;
0557 -0.5878 0.8090 -0.0001 ;
0558 0.0000 -1.0000 0.0000 ;
0559 -0.5878 -0.8090 -0.0001 ]';
0560
0561
0562 elec = struct(...
0563 'labels',names,...
0564 'X',num2cell(xyz(1,:)),...
0565 'Y',num2cell(xyz(2,:)),...
0566 'Z',num2cell(xyz(3,:)));
0567
0568
0569 return
0570
0571
0572
0573
0574
0575
0576
0577
0578
0579
0580
0581
0582
0583
0584
0585
0586
0587
0588
0589
0590
0591
0592
0593
0594
0595
0596
0597
0598
0599
0600
0601
0602
0603
0604
0605
0606
0607
0608
0609
0610
0611
0612
0613
0614
0615
0616
0617
0618
0619
0620
0621
0622
0623
0624
0625
0626
0627
0628
0629
0630
0631
0632
0633
0634
0635
0636
0637
0638
0639
0640
0641
0642
0643
0644
0645
0646
0647
0648
0649
0650
0651
0652
0653
0654
0655
0656
0657
0658
0659
0660
0661
0662
0663
0664
0665
0666
0667
0668
0669
0670
0671
0672
0673
0674
0675
0676
0677
0678
0679
0680
0681
0682
0683
0684
0685
0686
0687
0688
0689
0690
0691
0692
0693
0694
0695
0696
0697
0698
0699
0700
0701
0702
0703
0704
0705
0706
0707
0708
0709
0710
0711
0712
0713
0714
0715
0716
0717
0718
0719
0720
0721
0722
0723
0724
0725
0726
0727
0728
0729
0730
0731
0732
0733
0734
0735
0736
0737
0738
0739
0740
0741
0742
0743
0744
0745
0746
0747
0748
0749
0750
0751
0752
0753
0754
0755
0756
0757
0758
0759
0760
0761
0762
0763
0764
0765
0766
0767
0768
0769
0770
0771
0772
0773
0774
0775
0776
0777
0778
0779
0780
0781
0782
0783
0784
0785
0786
0787
0788
0789
0790
0791
0792
0793
0794
0795
0796
0797
0798
0799
0800
0801
0802
0803
0804
0805
0806
0807
0808
0809
0810
0811
0812
0813
0814
0815
0816
0817
0818
0819
0820
0821
0822
0823
0824
0825
0826
0827
0828
0829
0830
0831
0832
0833
0834
0835
0836
0837
0838
0839
0840
0841
0842
0843
0844
0845
0846
0847
0848
0849
0850
0851
0852
0853
0854
0855
0856
0857
0858
0859
0860
0861
0862
0863
0864
0865
0866
0867
0868
0869
0870
0871
0872
0873
0874
0875
0876
0877
0878
0879
0880
0881
0882
0883
0884
0885
0886
0887
0888
0889
0890
0891
0892
0893
0894
0895
0896
0897
0898
0899
0900
0901
0902
0903
0904
0905
0906
0907
0908
0909
0910
0911
0912