NP_CALC_3D_FIELDS: J= np_calc_3d_fields( fwd_model, img) Calculate measurement fields using preconditioned conjugate gradients v_f = Measurement fields fwd_model = forward model img = image background for jacobian calc
0001 function v_f= np_calc_3d_fields( fwd_model, img) 0002 % NP_CALC_3D_FIELDS: J= np_calc_3d_fields( fwd_model, img) 0003 % Calculate measurement fields using preconditioned conjugate gradients 0004 % v_f = Measurement fields 0005 % fwd_model = forward model 0006 % img = image background for jacobian calc 0007 0008 % (C) 2005 Andy Adler. License: GPL version 2 or version 3 0009 % $Id: np_calc_3d_fields.m 5395 2017-04-12 16:00:13Z aadler $ 0010 0011 % Here we use caching differently. The v_h previous depends only 0012 % on the fwd_model (depending on the image wouldn't help, because 0013 % it changes). It is used as the first guess for m_3d_fields 0014 0015 warning('EIDORS:deprecated','NP_CALC_3D_FIELDS is deprecated as of 06-Jun-2012. '); 0016 0017 if nargin==1 % normal way to call 0018 img = fwd_model; 0019 fwd_model = img.fwd_model; 0020 else 0021 img.fwd_model = fwd_model; %force use of supplied fwd_model 0022 end 0023 0024 p= np_fwd_parameters( fwd_model ); 0025 s_mat= calc_system_mat( img ); 0026 0027 %Set the tolerance for the pcg 0028 tol = 1e-5; 0029 0030 v_f = eidors_obj('get-cache', fwd_model, 'np_2003_3d_fields'); 0031 0032 [v_f] = m_3d_fields(p.vtx, p.n_elec, p.indH, ... 0033 s_mat.E, tol, p.gnd_ind, v_f); 0034 0035 eidors_obj('set-cache', fwd_model, 'np_2003_image_prior', v_f);