calc_jacobian_bkgnd

PURPOSE ^

CALC_JACOBIAN_BKGND: calculate background image around

SYNOPSIS ^

function img_bkgnd = calc_jacobian_bkgnd( inv_model )

DESCRIPTION ^

 CALC_JACOBIAN_BKGND: calculate background image around
    which initial estimate of jacobian is calculated
 
 img_bkgnd = calc_jacobian_bkgnd( inv_model )
 inv_model   is an EIDORS fwd_model 
 img_bkgnd   is an EIDORS struct

 Usage: 
      The background for calc_jacobian may be specified
      as an estimated value
  inv_model.jacobian_bkgnd.value;  % scalar OR
                                   % vector of Nx1

 Usage:
      The background may be calculated by a function
  inv_model.jacobian_bkgnd.func;

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function img_bkgnd = calc_jacobian_bkgnd( inv_model )
0002 % CALC_JACOBIAN_BKGND: calculate background image around
0003 %    which initial estimate of jacobian is calculated
0004 %
0005 % img_bkgnd = calc_jacobian_bkgnd( inv_model )
0006 % inv_model   is an EIDORS fwd_model
0007 % img_bkgnd   is an EIDORS struct
0008 %
0009 % Usage:
0010 %      The background for calc_jacobian may be specified
0011 %      as an estimated value
0012 %  inv_model.jacobian_bkgnd.value;  % scalar OR
0013 %                                   % vector of Nx1
0014 %
0015 % Usage:
0016 %      The background may be calculated by a function
0017 %  inv_model.jacobian_bkgnd.func;
0018 
0019 % (C) 2005 Andy Adler. License: GPL version 2 or version 3
0020 % $Id: calc_jacobian_bkgnd.html 2819 2011-09-07 16:43:11Z aadler $
0021 
0022 img_bkgnd= eidors_obj('get-cache', inv_model, 'jacobian_bkgnd');
0023 if ~isempty(img_bkgnd)
0024    eidors_msg('calc_jacobian_bkgnd: using cached value', 3);
0025    return
0026 end
0027 
0028 if isfield(inv_model.jacobian_bkgnd,'func')
0029    img_bkgnd= feval( inv_model.jacobian_bkgnd.func, inv_model );
0030 else
0031    % allow bkgnd to be scalar or vector
0032    fwd_model= inv_model.fwd_model;
0033    bkgnd = ones(size(fwd_model.elems,1),1);
0034    bkgnd(:)= inv_model.jacobian_bkgnd.value;
0035 
0036    img_bkgnd= eidors_obj('image', 'homog image', ...
0037                          'elem_data', bkgnd, ...
0038                          'fwd_model', fwd_model );
0039 end
0040 
0041 
0042 eidors_obj('set-cache', inv_model, 'jacobian_bkgnd', img_bkgnd);
0043 eidors_msg('jacobian_bkgnd: setting cached value', 3);

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