pub fn rts(
local_field: &[f64],
mask: &[u8],
grid: &Grid,
bdir: (f64, f64, f64),
params: &RtsParams,
progress: impl FnMut(usize, usize),
) -> Vec<f64>Expand description
RTS 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 ROIgrid- Volume grid (dimensions and voxel sizes)bdir- B0 field directionparams- RTS parametersprogress- Progress callback(iteration, max_iter)
§Returns
Susceptibility map