eidors_model_params

PURPOSE ^

mdl = eidors_model_params( mdl );

SYNOPSIS ^

function mdl = eidors_model_params( mdl );

DESCRIPTION ^

 mdl = eidors_model_params( mdl );
 Fill in default parameter values in EIDORS types

 (C) 2006 Andy Adler. Licensed under the GPL v2
 $Id: eidors_model_params.html 2819 2011-09-07 16:43:11Z aadler $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function mdl = eidors_model_params( mdl );
0002 % mdl = eidors_model_params( mdl );
0003 % Fill in default parameter values in EIDORS types
0004 %
0005 % (C) 2006 Andy Adler. Licensed under the GPL v2
0006 % $Id: eidors_model_params.html 2819 2011-09-07 16:43:11Z aadler $
0007 
0008 % TODO - to caching
0009 
0010 try
0011    type=mdl.type;
0012 catch
0013    error('eidors_model_params: object is not eidors object (no type)');
0014 end
0015 
0016 switch type;
0017    case 'inv_model';
0018       mdl.fwd_model= eidors_model_params( mdl.fwd_model );
0019       if ~isfield(mdl,'reconst_type');
0020          mdl.reconst_type= 'difference';
0021       end
0022 
0023    case 'fwd_model';
0024       if ~isfield(mdl,'normalize_measurements');
0025          mdl.normalize_measurements= 0;
0026       end
0027       if ~isfield(mdl,'elems');
0028          return;
0029       end
0030       
0031       mdl.elems=    double(mdl.elems);
0032       if isfield(mdl,'boundary')
0033          mdl.boundary= double(mdl.boundary);
0034       else
0035          mdl.boundary= find_boundary(mdl.elems);
0036       end
0037 
0038       % fill in boundary if it doesn't exist
0039       mdl.n_elem = size(mdl.elems,1);
0040       mdl.n_node = size(mdl.nodes,1);
0041       if isfield(mdl,'electrode');
0042          mdl.n_elec = length(mdl.electrode);
0043       else
0044          mdl.n_elec = 0;
0045       end
0046 end

Generated on Tue 09-Aug-2011 11:38:31 by m2html © 2005