Skip to main content

symdiv_rows_f32

Function symdiv_rows_f32 

Source
fn symdiv_rows_f32(
    divx: &mut [f32],
    divy: &mut [f32],
    divz: &mut [f32],
    sxx: &[f32],
    sxy: &[f32],
    sxz: &[f32],
    syy: &[f32],
    syz: &[f32],
    szz: &[f32],
    grid: &Grid,
)
Expand description

The divergence of the symmetric tensor q in the w update, as the reference computes it (update_w_kernel!, src/tgv_helper.jl:88-105, 6c0886a; the same in the original Python tgv_deconv_update_w, qsm_tgv_cython_helper.pyx): row d of the tensor ((qxx, qxy, qxz) for w_x, …) takes its backward differences along x, y and z all scaled by 1/res_d, the row’s own resolution, not by the resolution of the axis each difference is along. On isotropic voxels that is the ordinary divergence; on anisotropic voxels it is not the adjoint of the symmetric gradient used in the q update. Used only with TgvParams::reference_divergence; the default is the adjoint ([crate::utils::gradient::symdiv_inplace_f32]). See the module docs.