CREATE EIDORS v3 fwd_model from the v2 variables fmdl = fwd_model_from_v2( elec, vtx, simp, zc, gnd_ind) Input paramers elec: [N_elec x 3*Srf] for each electrode vtx: [N_nodes x 3] Vertices bdy: [N_bdy x 2] Boundary elements (specify [] if not available) simp: [N_elems x 4] Tetrahedral elements zc; [N_elec x 1] Electrode contact impedances gnd_ind: [1x1] ground Vertex name: fwd_model name (optional) (C) 2008 Andy Adler. License: GPL version 2 or version 3 $Id: fwd_model_from_v2.m 3233 2012-06-30 09:41:01Z bgrychtol $
0001 function fmdl = fwd_model_from_v2( elec, vtx, bdy, simp, zc, gnd_ind, name) 0002 % CREATE EIDORS v3 fwd_model from the v2 variables 0003 % fmdl = fwd_model_from_v2( elec, vtx, simp, zc, gnd_ind) 0004 % Input paramers 0005 % elec: [N_elec x 3*Srf] for each electrode 0006 % vtx: [N_nodes x 3] Vertices 0007 % bdy: [N_bdy x 2] Boundary elements (specify [] if not available) 0008 % simp: [N_elems x 4] Tetrahedral elements 0009 % zc; [N_elec x 1] Electrode contact impedances 0010 % gnd_ind: [1x1] ground Vertex 0011 % name: fwd_model name (optional) 0012 % (C) 2008 Andy Adler. License: GPL version 2 or version 3 0013 % $Id: fwd_model_from_v2.m 3233 2012-06-30 09:41:01Z bgrychtol $ 0014 0015 if isempty(bdy); 0016 bdy= find_boundary( simp ); 0017 end 0018 0019 fmdl.type = 'fwd_model'; 0020 fmdl.name = 'fwd_model_from_v2'; 0021 fmdl.nodes= vtx; 0022 fmdl.elems= simp; 0023 fmdl.boundary= bdy; 0024 fmdl.electrode= get_model_elecs(elec,zc); 0025 fmdl.solve= 'eidors_default'; 0026 fmdl.jacobian= 'eidors_default'; 0027 fmdl.system_mat='eidors_default'; 0028 fmdl.gnd_node= gnd_ind; 0029 0030 0031 function [electrodes] = get_model_elecs(elec,zc); 0032 %elec : The electrodes matrix. 0033 %np_pl : Number of electrode planes (in planar arrangements) 0034 %zc : Contact impedances of the electrodes 0035 0036 for i=1:length(zc) 0037 electrodes(i).z_contact= zc(i); 0038 electrodes(i).nodes= unique( elec(i,:) ); 0039 end 0040 0041 perm_sym='{n}';