Skip to main content

grad_masked

Function grad_masked 

Source
fn grad_masked(
    val: &(dyn Fn(usize) -> Complex64 + Sync),
    inside: &[usize],
    gw: &[Vec<f64>],
    n: [usize; 3],
    r: &mut [Complex64],
)
Expand description

Weighted circular forward differences (no voxel-size scaling), as STI’s iLSQR uses, at the mask voxels only: r[a·nm + i] = gw[a][i] · (val(l + e_a) − val(l)) with l = inside[i], nm = inside.len(), gw the weights compacted to the mask.