0001 function Reg= prior_TV( inv_model );
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 elem = inv_model.fwd_model.elems;
0012 node = inv_model.fwd_model.nodes;
0013
0014 dims= size(node,2);
0015
0016 if dims==2
0017 msh.TC = elem';
0018 msh.PC = node';
0019 Reg= TV_operator_2D( msh );
0020 elseif dims==3
0021 msh.elem_c = elem;
0022 msh.vtx_c = node;
0023 Reg= TV_operator_3D( msh );
0024 else
0025 error('problem dimension must be 2 or 3');
0026 end
0027
0028 if isfield(inv_model.fwd_model,'coarse2fine')
0029 Reg = Reg*inv_model.fwd_model.coarse2fine;
0030 end