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.html 2819 2011-09-07 16:43:11Z 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 p= np_fwd_parameters( fwd_model ); 0016 s_mat= calc_system_mat( fwd_model, img ); 0017 0018 %Set the tolerance for the pcg 0019 tol = 1e-5; 0020 0021 v_f = eidors_obj('get-cache', fwd_model, 'np_2003_3d_fields'); 0022 0023 [v_f] = m_3d_fields(p.vtx, p.n_elec, p.indH, ... 0024 s_mat.E, tol, p.gnd_ind, v_f); 0025 0026 eidors_obj('set-cache', fwd_model, 'np_2003_image_prior', v_f);