Home > vbmeg > demo > test_scripts > vb_set_sphere_model.m

vb_set_sphere_model

PURPOSE ^

Copyright (C) 2011, ATR All Rights Reserved.

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 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:

SOURCE CODE ^

0001 %
0002 % Copyright (C) 2011, ATR All Rights Reserved.
0003 % License : New BSD License(see VBMEG_LICENSE.txt)
0004 
0005 %
0006 % Set head and dipole model for EEG forward calculation test
0007 %
0008 
0009 %
0010 % 3層モデル
0011 %
0012 
0013 sigma = [ 1.0  0.0125  1.0  0.0];
0014 Rhead = 1;
0015 R     = [ 0.87  0.92   1.0 ] * Rhead;
0016 
0017 [F, Xhead] = vb_make_fullsphere(Npoint);
0018 [F, Xhead] = vb_out_normal(F,Xhead);
0019 
0020 NV    = size(Xhead,1);
0021 NF    = size(F,1);
0022 
0023 Vhead    = [];
0024 Fhead    = [];
0025 XXhead  = [];
0026 Nvertex = [];
0027 Npatch    = [];
0028 
0029 for n=1:Nsurf
0030     Vhead    = [Vhead  ; Xhead * R(n) ];
0031     Fhead    = [Fhead  ; F + NV*(n-1)];
0032     XXhead    = [XXhead ; Xhead];
0033     Nvertex = [Nvertex; NV*(n-1)+1, NV*n];
0034     Npatch    = [Npatch ; NF*(n-1)+1, NF*n];
0035 end
0036 
0037 R            = R(1:Nsurf);
0038 BEM.R        = R;
0039 BEM.sigma    = sigma;
0040 BEM.Nvertex = Nvertex;
0041 BEM.Npatch  = Npatch;
0042 
0043 fprintf('# of surface  = %d\n',Nsurf);
0044 fprintf('# of vertices = %d\n',size(Vhead,1));
0045 
0046 % EEG sensor
0047 Nstep    = max(round(NV/Nsensor), 1);
0048 IDsensor = 1:Nstep:NV;
0049 IDsensor = IDsensor + NV*(Nsurf - 1) ;
0050 Xeeg     = Vhead(IDsensor,:);
0051 
0052 % 電流双極子数
0053 Nhalf     = fix(Ndipole/2);
0054 Ndipole  = Nhalf*2;
0055 
0056 V         = zeros(Ndipole,3);
0057 xx1      = zeros(Nhalf,3);
0058 xx2      = zeros(Nhalf,3);
0059 
0060 rlist     = (1:Nhalf)'*(R(1)*0.9/Nhalf);
0061 V(:,3)     = [ rlist; rlist ];
0062 xx1(:,3) = 1;
0063 xx2(:,1) = 1;
0064 xx       = [ xx1; xx2];
0065

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