prior_noser

PURPOSE ^

PRIOR_NOSER calculate image prior

SYNOPSIS ^

function Reg= prior_noser( inv_model );

DESCRIPTION ^

 PRIOR_NOSER calculate image prior
 Reg= prior_noser( inv_model )
 Reg        => output regularization term
 inv_model  => inverse model struct

 Prior is diag( diag(J'*J)^exponent )
 param is normally .5, this value can be changed by
 setting inv_model.prior_noser.exponent= new_value

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function Reg= prior_noser( inv_model );
0002 % PRIOR_NOSER calculate image prior
0003 % Reg= prior_noser( inv_model )
0004 % Reg        => output regularization term
0005 % inv_model  => inverse model struct
0006 %
0007 % Prior is diag( diag(J'*J)^exponent )
0008 % param is normally .5, this value can be changed by
0009 % setting inv_model.prior_noser.exponent= new_value
0010 
0011 % (C) 2005 Andy Adler. License: GPL version 2 or version 3
0012 % $Id: prior_noser.m 5664 2017-12-12 15:14:20Z nolwenn85 $
0013 
0014     img_bkgnd= calc_jacobian_bkgnd( inv_model );
0015     J = calc_jacobian(img_bkgnd);
0016     
0017     % if we deal with movement Jacobian, it will be too big, so we chop it
0018     if isfield(img_bkgnd.fwd_model,'coarse2fine')
0019        n_els = size(img_bkgnd.fwd_model.coarse2fine,2);
0020     else
0021        n_els = size(img_bkgnd.fwd_model.elems,1);
0022     end
0023     J = J(:,1:n_els);
0024        
0025 
0026     exponent= 0.5;
0027     if isfield(inv_model,'prior_noser');
0028        exponent= inv_model.prior_noser.exponent;
0029     end
0030 
0031     l_prior= size(J,2);
0032 
0033     % Reg is spdiags(diag(J'*J),0, l_prior, l_prior);
0034     diag_col= sum(J.^2,1)';
0035     Reg = spdiags( diag_col.^exponent, 0, l_prior, l_prior);
0036     
0037     
0038

Generated on Fri 30-Dec-2022 19:44:54 by m2html © 2005