Skip to main content

fit_ppm_complex_noise

Function fit_ppm_complex_noise 

Source
pub fn fit_ppm_complex_noise(magnitude: &[f64], n_echoes: usize) -> Vec<f64>
Expand description

Noise standard deviation of the field fit, as Fit_ppm_complex.m in the MEDI toolbox returns it (dp1, MEDI’s N_std): the a priori error of the frequency in a magnitude-weighted linear fit of phase to echo index, sqrt(a11 / (a11·a22 − a12²)) with a_jk = Σ_e |S_e|² e^(j+k−2) over echo indices e = 0, 1, …. It depends only on the echo magnitudes, so this is fit_ppm_complex’s noise without the phase. A single echo is treated as Fit_ppm_complex.m does, as two echoes of the same magnitude. Voxels where the fit is undefined get 0, as there (MEDI’s data weight then ignores them).

magnitude holds n_echoes volumes of n voxels each, echo slowest.