Skip to main content

tv_admm

Function tv_admm 

Source
pub fn tv_admm(
    local_field: &[f64],
    mask: &[u8],
    grid: &Grid,
    bdir: (f64, f64, f64),
    params: &TvParams,
    progress: impl FnMut(usize, usize),
) -> Vec<f64>
Expand description

TV-ADMM dipole inversion

Optimized implementation with:

  • Pre-allocated buffers (zero allocations per iteration)
  • In-place gradient/divergence operations
  • Buffer swapping instead of cloning
  • Fused z-subproblem and u-update

§Arguments

  • local_field - Local field values (nx * ny * nz)
  • mask - Binary mask (nx * ny * nz), 1 = inside ROI
  • grid - Volume grid (dimensions and voxel sizes)
  • bdir - B0 field direction
  • params - TV-ADMM parameters
  • progress - Progress callback (iteration, max_iter)

§Returns

Susceptibility map