Open-source Python package for spiral off-resonance correction
Marina Manso Jimeno1,2, Sairam Geethanath1,2, and John Thomas Vaughan Jr.1,2
1Columbia University, New York, NY, United States, 2Columbia Magnetic Resonance Research Center (CMRRC), New York, NY, United States


Off-resonance blurring is one of the challenges with long read-out trajectories such as spirals. Existent techniques deblur the images by demodulating k-space data with the conjugate term of the phase accumulated from off-resonant spins. Continuous and frequency-segmented CPR and Multi-Frequency Interpolation are some examples. This work is aimed at sharing an open-source package for off-resonance correction, demonstrating on spiral datasets. The methods have been tested on simulations, in vitro and in vivo and show promising preliminary results. We believe that the availability of this package will benefit the spiral imaging community.


Off-resonance is a type of artifact that deteriorates the quality of MR images by introducing blurring and/or distortion.1 The main causes of this effect are B0 field inhomogeneities, tissue susceptibilities and chemical shift.2 Phase from spins precessing at a frequency different than Larmor accumulates across the read-out direction. Consequently, k-space trajectories with long read-out times such as spirals especially suffer from it.3 Several techniques have been reported for correction or reduction of this artifact4, most of them based on Conjugate Phase Reconstruction (CPR).5 This approach aims at counteracting the accumulated phase by demodulating k-space data with its conjugate. From its continuous version, segmented implementations in the time1 and frequency6,7 domain have branched out to reduce computational times and required power. Even if the methods are theoretically well-defined, there is only open-source MATLAB code available for this application. Therefore, the purpose of this work is to demonstrate the version 0 of a Python-based open-source code that performs off-resonance correction methods on spiral-acquired MR images.


We implemented three techniques: frequency-segmented Conjugate Phase Reconstruction (fs-CPR)6, Multi-Frequency Interpolation (MFI)7 and continuous CPR5. The code is available on GitHub8. First, we tested our methods on a simulated phantom (Shepp-Logan, Figure1A). We designed a forward model that synthesizes the off-resonance effect. The model samples the k-space data along a variable density spiral trajectory with 54 shots and center oversampling (Figure1B), adding a different phase at each time point. The added phase term depends both on the acquisition time and B0 map frequency at that specific k-space position. For the numerical simulations experiment, we synthesized a B0 map. This map was constant over the phantom region but presented varying frequency values at locations corresponding to the phantom edges. With this arrangement, we wanted to emphasize the effect of off-resonance at tissue boundaries (Figure1D). Corruption of the image was performed using field maps ranging over different frequency intervals. We performed in vitro experiments on the ACR phantom9 and in vivo experiments on the brain of a healthy volunteer. The acquisition sequence is the same as in the forward model. The sequence parameters are FA=30 degrees, TE/TR=4.6/25 ms, dTE=1.22ms, FOV=384 cm, in-plane resolution of 2x2 mm2 and slice thickness of 3 mm. In both cases, we acquired an external B0 map on a Siemens (Siemens Healthlineers, Erlagen) 3T Prisma. Reconstruction was performed using the python package for Non-Uniform Fourier Transform (NUFFT)10.


The image resulting from the forward model when the field map is zero and constant over the FOV is the Ground Truth (GT) (Figure 1C). This image reflects the characteristic artifact of spiral k-space sampling and not off-resonance. Figure 2A shows that correction methods perform poorer as the frequency range in the field map increases. Consequently, corrected images increasingly differ from GT in all three cases (Figure 2B). Figure 3 and 5 show the acquired data and corresponding field map for both in vitro and in vivo experiments. The field map was masked to avoid noise caused by main field drift on regions of low signal. This speeds up the calculation, especially for CPR. The figures also display the same slices after correction and the effect of the number of frequency segments (L) on the deblurring performance. Line intensity profile was calculated along the middle line of the phantom image. It helps to spot differences before/after correction and across the techniques’ results (Figure 4).


Results from the forward model demonstrate that when the B0 inhomogeneity range increases so does the difference of the simulated corrupted image with respect to the GT (Figure1D). This fact demonstrates the causality relation between off-resonance effect and field inhomogeneity. All the techniques increasingly fail at correction as the map frequency range gets wider. Note that for numerical simulations the output of the forward model is double-sampled along the trajectory before correction, introducing errors. In figure 3 all the methods corrected similarly. There are areas of the phantom that present sharper edges after correction. However, by looking at the line intensity profiles in figure 4 we see that the correction modifies the contrast of the image. We will study this effect deeply for future releases. Continuous CPR took about 26 hours on a dataset with only a slice and 20 channels. Since the results didn’t show a significant difference with respect to fs-CPR and due to lack of time, we chose not to apply this method on the in vivo dataset. The correction of the brain image shows that by increasing the number of frequency segments in both fsCPR and MFI, image quality significantly improves. All the techniques arrive at similar results, which proves the consistency of the methods.


We have validated the methods by correcting spiral images subjected to off-resonance. We believe the availability of this package will favour the use of non-cartesian trajectories that are prone to this artifact. Future steps include implementation of techniques for off-resonance correction on EPI images and building a Graphical interface for better user experience.


1.Zuckerman Institute Technical Development Grant for MR, Zuckerman Mind Brain Behavior Institute,Grant Number: CU-ZI-MR-T-0002; PI: Geethanath;

2.Zuckerman Institute Seed Grant for MR studies, Zuckerman Mind Brain Behavior Institute,Grant Number:CU-ZI-MR-S-0007; PI: Geethanath;


  1. Noll, D. C., Meyer, C. H., Pauly, J. M., Nishimura, D. G. and Macovski, A. (1991), A homogeneity correction method for magnetic resonance imaging with time-varying gradients. IEEE Transactions on Medical Imaging, 10(4): 629-637. doi: 10.1109/42.108599
  2. Chen, W., Sica, C. T., & Meyer, C. H. (2008). Fast conjugate phase image reconstruction based on a Chebyshev approximation to correct for B0 field inhomogeneity and concomitant gradients. Magnetic resonance in medicine, 60(5), 1104–1111. doi:10.1002/mrm.21703
  3. Chen, W. and Meyer, C. H. (2008), Semiautomatic off‐resonance correction in spiral imaging. Magn. Reson. Med., 59: 1212-1219. doi:10.1002/mrm.21599
  4. Schomberg, H. (1999), Off-resonance correction of MR images. IEEE Transactions on Medical Imaging, 18( 6): 481-495. doi: 10.1109/42.781014
  5. Maeda, A., Sano, K. and Yokoyama, T. (1988), Reconstruction by weighted correlation for MRI with time-varying gradients. IEEE Transactions on Medical Imaging, 7(1): 26-31. doi: 10.1109/42.3926
  6. Noll, D. C., Pauly, J. M., Meyer, C. H., Nishimura, D. G. and Macovskj, A. (1992), Deblurring for non‐2D fourier transform magnetic resonance imaging. Magn. Reson. Med., 25: 319-333. doi:10.1002/mrm.1910250210
  7. Man, L., Pauly, J. M. and Macovski, A. (1997), Multifrequency interpolation for fast off‐resonance correction. Magn. Reson. Med., 37: 785-792. doi:10.1002/mrm.1910370523
  8. https://github.com/imr-framework/Off-Resonance-Correction
  9. Chen, C. C., Wan, Y. L., Wai, Y. Y., and Liu, H. L., (2004), Quality assurance of clinical MRI scanners using ACR MRI phantom: preliminary results. Journal of digital imaging, 17(4): 279-284.
  10. Lin, Jyh-Miin (2018), Python Non-Uniform Fast Fourier Transform (PyNUFFT): An Accelerated Non-Cartesian MRI Package on a Heterogeneous Platform (CPU/GPU). Journal of Imaging, 4(3): 51.


Figure 1: A) Forward Model Input: Original Shepp-Logan phantom image (192x192). B) Variable Density Spiral (VDS) trajectory with 54 shots and center oversampling factor (alpha) equal to 9. C) Corrupted phantom image after sampling the signal along the trajectory in the condition of magnetic field homogeneity. D) Forward model results and difference with respect to GT in the presence of different ranges of field inhomogeneity.

Figure 2: Numerical simulation results after correcting with frequency segmented Conjugate Phase Reconstruction (fs-CPR), Multi-Frequency Interpolation (MFI) and original CPR for B0 map of ranges ±250, ±1000 and ±2000 Hz. Panel A) Corrected Images. Panel B) Difference images with respect to GT.

Figure 3: Top) Slice of ACR phantom acquired with a spiral (54 shots 9 alpha) sequence and external B0 map. Bottom) slice corrected with fs-CPR, MFI and continuous CPR.

Figure 4: Line intensity profiles along the middle line of the ACR phantom slice in Figure 3. Figures correspond to the following images: A)Off-resonance corrupted data, B) Result after correcting with fsCPR, C) MFI and D)CPR

Figure 5: A) Image of brain acquired with a spiral (54 shots 9 alpha) sequence and external B0 map. B) Top row: Image corrected with fs-CPR and MFI at the minimum number of frequency segments, bottom row: Image corrected with fs-CPR and MFI doubling the number of frequency segments.

Proc. Intl. Soc. Mag. Reson. Med. 28 (2020)