Efficient implementation of Salomir's method from 2003: we use a multi-resolution trick to deal with aliasing.
* more than 6x faster (version of october 2014)
* allows to do simulations in a 2x higher resolution, without memory problems.
Explanation and references:
The presented algorithm is an efficient implementation of the Fourier-based procedure to calculate the susceptibility-induced field-shift if an object with known susceptibility distribution is placed within a strong homogeneous magnetic field (B0).
This method is based on the publication of: Salomir et al, "A fast calculation method for magnetic field inhomogeneity due to an arbitrary distribution of bulk susceptibility" Concepts in Magnetic Resonance Part B: Magnetic Resonance Engineering, Volume 19B, Issue 1, pages 26–34, 2003.
A drawback of this method, is that it depends on (inefficient) zero-padding, to prevent the aliasing artefact (periodic wrap-around). See also: Cheng YCN, Neelavalli J, Haacke EM. "Limitations of calculating field distributions and magnetic susceptibilities in MRI using a Fourier based method". Phys Med Biol 2009;54:1169–1189.
In the here presented algorithm, aliasing is removed by calculating this artifact using an additional convolution in a lower resolution, which is does not lead to accuracy loss, due to the smooth decay of the dipole function. For further details the reader is referred to the article: Job G. Bouwman, Chris J.G. Bakker. "Alias subtraction more efficient than conventional zero-padding in the Fourier-based calculation of the susceptibility induced perturbation of the magnetic field in MR" 2012, Magnetic Resonance in Medicine 68:621630 (2012). Please refer to this article when using this script.