Skip to main content

r2star_arlo

Function r2star_arlo 

Source
pub fn r2star_arlo(
    magnitude: &[f64],
    mask: &[u8],
    echo_times: &[f64],
    grid: &Grid,
) -> (Vec<f64>, Vec<f64>)
Expand description

R2* mapping using ARLO for equi-spaced echo times (≥3 echoes).

For each masked voxel, uses the integral-based ARLO estimator (Pei et al. 2015) — a least-squares fit exploiting s_n - s_{n+2} = R2*·∫S dt with a Simpson-rule integral — to estimate the mono-exponential decay rate. Falls back to log-linear fitting where the estimate is unreliable.

§Arguments

  • magnitude - Multi-echo magnitude data, flattened as [voxel0_echo0, voxel0_echo1, ..., voxel1_echo0, ...] i.e. shape (n_voxels, n_echoes) in row-major order, where n_voxels = nx*ny*nz
  • mask - Binary brain mask [nx*ny*nz] (1 = process, 0 = skip)
  • echo_times - Echo times in seconds [n_echoes] (must be equi-spaced)
  • grid - Volume grid (dimensions and voxel sizes)

§Returns

(r2star_map, s0_map) - R2* in Hz and S0 (proton density), both [nx*ny*nz]

§Panics

Panics if echo_times.len() < 3 or echo times are not equi-spaced.