0001 function [fwd_mdl]=set_fwd_model(vtx,simp,srf,elec,zc,gnd_ind,Ib,indH,df,perm_sym);
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 warning('EIDORS:deprecated','SET_FWD_MODEL is deprecated as of 06-Jun-2012. ');
0016
0017 if nargin<10
0018 perm_sym= '{y}';
0019 end
0020 if isempty( srf)
0021 srf= find_boundary( simp );
0022 end
0023
0024 fwd_mdl= eidors_obj('fwd_model','FWD_MDL created by set_fwd_model');
0025 fwd_mdl.nodes=vtx;
0026 fwd_mdl.elems=simp;
0027 fwd_mdl.boundary=srf;
0028 fwd_mdl.gnd_node=gnd_ind;
0029
0030 elec_mdl=[];
0031 for loop1=1:size(elec,1);
0032 elec_mdl(loop1,1).z_contact=zc(loop1);
0033 elec_mdl(loop1,1).nodes=elec(loop1,:);
0034 end
0035
0036 fwd_mdl.electrode=elec_mdl;
0037
0038 stim_mdl=[];
0039 for loop1=1:size(df,1)
0040 stim_mdl(loop1,1).stimulation=abs(max(Ib(:,loop1)));
0041 stim_mdl(loop1,1).stim_pattern=Ib(:,loop1);
0042 meas=zeros(df(loop1),size(elec,1));
0043 loop3=1;
0044 for loop2=sum(df(1:loop1))-df(loop1)+1:sum(df(1:loop1))
0045 meas(loop3,indH(loop2,1))=1;
0046 meas(loop3,indH(loop2,2))=-1;
0047 loop3=loop3+1;
0048 end
0049 stim_mdl(loop1,1).meas_pattern=meas;
0050 end
0051
0052 fwd_mdl.stimulation=stim_mdl;
0053 fwd_mdl.misc.perm_sym=perm_sym;
0054 fwd_mdl.solve='np_fwd_solve';
0055 fwd_mdl.jacobian='np_calc_jacobian';
0056 fwd_mdl.system_mat='np_calc_system_mat';