set_fwd_model

PURPOSE ^

SET_FWD_MODEL: create EIDORS v3 fwd_model from v2 parameters

SYNOPSIS ^

function [fwd_mdl]=set_fwd_model(vtx,simp,srf,elec,zc,gnd_ind,Ib,indH,df,perm_sym);

DESCRIPTION ^

 SET_FWD_MODEL: create EIDORS v3 fwd_model from v2 parameters
 [fwd_mdl]=set_fwd_model(vtx,simp,srf,elec,zc,gnd_ind,Ib,indH,df,perm_sym);

 Optional parameters
   srf = specify [] to automatically generate
   perm_sym = default is '{y}'

 Unknown parameters
   specify '[]' to be used later

 (C) 2005 Stephen Murphy. Licenced under GPL
 $Id: set_fwd_model.m 3060 2012-06-06 16:37:38Z aadler $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [fwd_mdl]=set_fwd_model(vtx,simp,srf,elec,zc,gnd_ind,Ib,indH,df,perm_sym);
0002 % SET_FWD_MODEL: create EIDORS v3 fwd_model from v2 parameters
0003 % [fwd_mdl]=set_fwd_model(vtx,simp,srf,elec,zc,gnd_ind,Ib,indH,df,perm_sym);
0004 %
0005 % Optional parameters
0006 %   srf = specify [] to automatically generate
0007 %   perm_sym = default is '{y}'
0008 %
0009 % Unknown parameters
0010 %   specify '[]' to be used later
0011 %
0012 % (C) 2005 Stephen Murphy. Licenced under GPL
0013 % $Id: set_fwd_model.m 3060 2012-06-06 16:37:38Z aadler $
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';

Generated on Fri 30-Dec-2022 19:44:54 by m2html © 2005