Skip to main content

sti_freqs

Function sti_freqs 

Source
fn sti_freqs(n: usize, vs: f64) -> Vec<f64>
Expand description

STI’s k-space coordinates (cycles/mm) on the unshifted layout of an even axis of n voxels: the signed index divided by n·vs, as STI computes (-n/2:n/2-1)/(n*vs).

[crate::fft::fftfreq] multiplies by 1/(n·vs) instead (numpy’s arithmetic), which rounds differently. That decides the dipole kernel at the lattice points on the magic angle (k_x² + k_y² = 2k_z² for H = z, e.g. (1, 1, 1)): there D is 0 or ±5.6e-17 by rounding alone, and FastQSM takes sign(D) of it. On QSMART’s call (48³ grid, 64 of 266 such points differing in sign) the multiplied coordinates put iLSQR’s χ 0.15 % / 0.094 % NRMSE from STI’s, while STI’s own division reproduces it (astewartau/QSM.rs#396). Neither sign pattern is better reasoned than the other (both are rounding), so this follows STI.