Skip to main content

hdqsm_magnitude

Function hdqsm_magnitude 

Source
pub fn hdqsm_magnitude(echoes: &[f64], echo_times: &[f64]) -> Vec<f64>
Expand description

HD-QSM’s magnitude, the paper’s Eq. 2 echo combination (Lambert et al. 2022), as the QSM-CI original computes it: mag_use = sum(TE.*mag.^2, 4) ./ sum(TE.*mag, 4), with non-finite values (no signal in any echo) set to 0.

echoes holds every echo’s magnitude stacked with the echo slowest (echo_times.len() volumes); the result is one volume.

§Panics

If echoes.len() is not a multiple of echo_times.len(), or there are no echo times.