calc_JiRtRJt

PURPOSE ^

[JiRtRJt,iRtRJt] = calc_JiRtRJt( inv_model, varargin )

SYNOPSIS ^

function [JiRtRJt,iRtRJt] = calc_JiRtRJt( inv_model, varargin )

DESCRIPTION ^

 [JiRtRJt,iRtRJt] = calc_JiRtRJt( inv_model, varargin )
 CALC_iRtR_PRIOR: calculate regularization matrix J*inv(R'*R)*J'
   This is a model of the covariance of image elements
   The image prior is matrix n_elem x n_elem 
 
 calc_JiRtRJt can be called as
    JiRtRJt= calc_JiRtRJt( inv_model, ... )

 and will call the function inv_model.JiRtRJt
 parameters to JiRtRJt should be passed in the field
 inv_model.JiRtRJt_function_name.parameters

 JiRtRJt         calculated regularization prior R
 inv_model       is an inv_model structure
 inv_model.JiRtRJt_func function to make calculation

 TODO: think about how to implement this!!

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [JiRtRJt,iRtRJt] = calc_JiRtRJt( inv_model, varargin )
0002 % [JiRtRJt,iRtRJt] = calc_JiRtRJt( inv_model, varargin )
0003 % CALC_iRtR_PRIOR: calculate regularization matrix J*inv(R'*R)*J'
0004 %   This is a model of the covariance of image elements
0005 %   The image prior is matrix n_elem x n_elem
0006 %
0007 % calc_JiRtRJt can be called as
0008 %    JiRtRJt= calc_JiRtRJt( inv_model, ... )
0009 %
0010 % and will call the function inv_model.JiRtRJt
0011 % parameters to JiRtRJt should be passed in the field
0012 % inv_model.JiRtRJt_function_name.parameters
0013 %
0014 % JiRtRJt         calculated regularization prior R
0015 % inv_model       is an inv_model structure
0016 % inv_model.JiRtRJt_func function to make calculation
0017 %
0018 % TODO: think about how to implement this!!
0019 
0020 % (C) 2006 Andy Adler. License: GPL version 2 or version 3
0021 % $Id: calc_JiRtRJt.html 2819 2011-09-07 16:43:11Z aadler $
0022 
0023 JiRtRJt = eidors_obj('get-cache', inv_model, 'JiRtRJt');
0024 if ~isempty(JiRtRJt)
0025    eidors_msg('calc_JiRtRJt: using cached value', 3);
0026    return
0027 end
0028 
0029 if isfield(inv_model,'JiRtRJt')
0030    JiRtRJt= feval( inv_model.JiRtRJt, inv_model );
0031 else
0032    eidors_msg( ...
0033       'calc_JiRtRJt: trying to calculate JiRtRJt from RtR_prior',2);
0034    RtR_prior = feval( inv_model.RtR_prior, inv_model );
0035    % regularize slightly so inverse exists
0036    % This is very slow, but I can't think of a better idea
0037    RtR_p_reg = spdiags( spdiags(RtR_prior,0)*1.00001, 0, RtR_prior);
0038 
0039    img_bkgnd= calc_jacobian_bkgnd( inv_model );
0040    J = calc_jacobian( fwd_model, img_bkgnd);
0041 
0042    JiRtRJt= J*(RtR_p_reg\J');
0043 end
0044 
0045 eidors_obj('set-cache', inv_model, 'JiRtRJt', JiRtRJt);
0046 eidors_msg('calc_JiRtRJt: setting cached value', 3);

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