NP_INV_SOLVE inverse solver for Nick Polydorides EIDORS3D code img= np_inv_solve( inv_model, data1, data2) img => output image inv_model => inverse model struct data1 => differential data at earlier time data2 => differential data at later time inv_model.parameters.max_iterations (default 1); inv_model.parameters.term_tolerance (default 1e-3);
0001 function img= mcmc_solve( inv_model, data1, data2) 0002 % NP_INV_SOLVE inverse solver for Nick Polydorides EIDORS3D code 0003 % img= np_inv_solve( inv_model, data1, data2) 0004 % img => output image 0005 % inv_model => inverse model struct 0006 % data1 => differential data at earlier time 0007 % data2 => differential data at later time 0008 % inv_model.parameters.max_iterations (default 1); 0009 % inv_model.parameters.term_tolerance (default 1e-3); 0010 0011 % (C) 2007 Nick Polydorides. License: GPL version 2 or version 3 0012 % $Id: mcmc_solve.html 2819 2011-09-07 16:43:11Z aadler $ 0013 0014 dv = calc_difference_data( data1, data2, inv_model.fwd_model); 0015 0016 RtR = calc_RtR_prior( inv_model ); 0017 hp= calc_hyperparameter( inv_model ); 0018 0019 img_bkgnd= calc_jacobian_bkgnd( inv_model ); 0020 J = calc_jacobian( inv_model.fwd_model, img_bkgnd); 0021 0022 sol= (J'*J + hp^2*RtR)\(J' * dv ); 0023 0024 %Set maximum number of iterations 0025 try 0026 max_iter= inv_model.parameters.max_iterations; 0027 catch 0028 max_iter= 10; 0029 end 0030 0031 likelihood= feval(inv_model.likelyhood_fcn, inv_model, sol, dv, J ) 0032 0033 0034 0035 img.name= 'solved by mcmc_solve'; 0036 img.elem_data = sol; 0037 img.fwd_model= inv_model.fwd_model; 0038