Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2023 Apr;89(4):1401-1417.
doi: 10.1002/mrm.29528. Epub 2022 Nov 28.

Shimming toolbox: An open-source software toolbox for B0 and B1 shimming in MRI

Affiliations

Shimming toolbox: An open-source software toolbox for B0 and B1 shimming in MRI

Alexandre D'Astous et al. Magn Reson Med. 2023 Apr.

Abstract

Purpose: Introduce Shimming Toolbox ( https://shimming-toolbox.org), an open-source software package for prototyping new methods and performing static, dynamic, and real-time B0 shimming as well as B1 shimming experiments.

Methods: Shimming Toolbox features various field mapping techniques, manual and automatic masking for the brain and spinal cord, B0 and B1 shimming capabilities accessible through a user-friendly graphical user interface. Validation of Shimming Toolbox was demonstrated in three scenarios: (i) B0 dynamic shimming in the brain at 7T using custom AC/DC coils, (ii) B0 real-time shimming in the spinal cord at 3T, and (iii) B1 static shimming in the spinal cord at 7T.

Results: The B0 dynamic shimming of the brain at 7T took about 10 min to perform. It showed a 47% reduction in the standard deviation of the B0 field, associated with noticeable improvements in geometric distortions in EPI images. Real-time dynamic xyz-shimming in the spinal cord took about 5 min and showed a 30% reduction in the standard deviation of the signal distribution. B1 static shimming experiments in the spinal cord took about 10 min to perform and showed a 40% reduction in the coefficient of variation of the B1 field.

Conclusion: Shimming Toolbox provides an open-source platform where researchers can collaborate, prototype and conveniently test B0 and B1 shimming experiments. Future versions will include additional field map preprocessing techniques, optimization algorithms, and compatibility across multiple MRI manufacturers.

Keywords: B0; B1; MRI; Python; inhomogeneities; open-source software; parallel transmit; shimming.

PubMed Disclaimer

Figures

Figure 1:
Figure 1:
Overview of Shimming Toolbox. The toolbox is installed on a computer and can be connected directly to the scanner console to access the images as they are reconstructed. Shimming Toolbox can calculate field maps, define masks and create shim coil calibration profiles, optimize B0 and B1 shim currents and send the currents to the MRI scanner in predefined format. The bottom right panel illustrates a respiratory-modulated real-time shimming scenario, wherein the shim current for each coil element is dependent on a pressure probe that relates to the patient’s respiratory trace. The coefficients are then sent to the scanner or to the custom coil drivers.
Figure 2:
Figure 2:
A) Manual creation of a mask using FSLeyes’ existing interface. B) Creation of a brain mask using FSL BET. C) Creation of a spinal cord mask using SCT.
Figure 3:
Figure 3:
Overview of B0 static and dynamic shimming. Inputs: Both static and dynamic shimming require (i) a ΔB0 field map, (ii) a target image, (iii) a mask, (iv) shim coil profiles and their respective constraints. Step 1: The mask is either considered as a single block (static) or multiple slice groups (dynamic), and resampled to the ΔB0 field map space. Step 2: The ROI of the field map is extracted using the mask. Step 3: The coil profiles are resampled to the field map space and shimming coefficients are calculated based on the selected solver and criterion. Step 4: The coefficients are written to a text file.
Figure 4:
Figure 4:
Real-time dynamic xyz-shimming sequence showing one line of k-space. Gradients (in red) along x, y and z are played out during the pulse sequence to correct for through-slice and in-plane inhomogeneities. The amplitude of these gradients is modulated in real-time by the respiratory pressure trace. Note that the pressure reading was purposely made faster for illustration purposes (one TR is much shorter than one breathing cycle).
Figure 5:
Figure 5:
Example text files output by Shimming Toolbox. A) Text file to be read by an Arduino Teensy board in the case of custom shim coils during B0 dynamic shimming (13). The slices were acquired in an interleaved fashion and are chronologically written to the text file. Each row corresponds to a slice and each column a coil channel. B) Text file to be read by the pulse sequence during B0 real-time dynamic shimming. Each block of three rows corresponds to a slice and within that block, a static coefficient, real-time coefficient and mean pressure are provided. C) Text file with B1+ static shimming coefficients where each row is a transmit channel and the columns are the magnitude and phase coefficients.
Figure 6:
Figure 6:
Comparison of field maps of the brain between the global 2nd order spherical harmonics optimized by the scanner (Global 2SH), the predicted dynamic shim using the AC/DC custom coil optimized by Shimming Toolbox (Dynamic (predicted)) and the acquired dynamic shim with that coil (Dynamic AC/DC). Standard deviation is shown for each slice in Hz. Slice numbers: A: 16, B: 24, C: 32, D: 40.
Figure 7:
Figure 7:
Comparison of the distortion between 2nd order SH global shimming and dynamic shimming using a 31-channel custom multi-coil shim array. Column 1 shows a reference MPRAGE acquisition where the brain outline was segmented for reference using BET and overlaid in red. Columns 2 through 5 show EPI acquisitions with the same acquisition parameters except for the shimming procedure and phase encoding direction. Columns 2 and 3 show global shimming using 2nd order spherical harmonics in the AP and PA phase encoding direction respectively. Column 4 and 5 show dynamic shimming using Shimming Toolbox and the multi-coil shim array with phase encoding direction of AP and PA respectively. Slice numbers: A: 16, B: 24, C: 32, D: 40.
Figure 8:
Figure 8:
Violin plot comparing the signal distribution within the spinal cord with 2nd order global shimming (black) optimized by the scanner and with real-time dynamic xyz-shimming (red) optimized by Shimming Toolbox for multiple echo times. Mean signal intensity across slices and echo times: global/real-time: 151.54/174.99. Average standard deviation within slices: global/real-time: 19.61/13.81. An axial slice showing the location of the shim ROI for real-time shimming as well as the segmented spinal cord is shown at the bottom left of the plot.
Figure 9:
Figure 9:
Comparison between 2nd order global shimming and real-time dynamic xyz-shimming in the spinal cord at 3 T. (Left) Localizer showing where the slices are located. (Center and Right) Slice number 1 and 2 of the same multi-echo GRE sequence acquired using 2nd order global shimming optimized by the scanner and real-time dynamic xyz-shimming optimized by Shimming Toolbox.
Figure 10:
Figure 10:
UNI (A, B) and GRE-INV2 images (C, D) spinal cord images from the MP2RAGE sequence, normalized by the maximum intensity in the spinal cord. Spinal cords were automatically segmented with SCT (and manually adjusted when required) on CP mode and shimmed images and a co-registration was performed. After shimming with Shimming Toolbox, the coefficient of variation in the spinal cord is reduced by 10.59% on UNI images (A, B) and 39.72% on GRE images (C, D).

Similar articles

Cited by

References

    1. Karamat MI, Darvish-Molla S, Santos-Diaz A. Opportunities and Challenges of 7 Tesla Magnetic Resonance Imaging: A Review. Crit. Rev. Biomed. Eng 2016;44:73–89. - PubMed
    1. Ibrahim TS, Hue Y-K, Tang L. Understanding and manipulating the RF fields at high field MRI. NMR Biomed. 2009;22:927–936. - PMC - PubMed
    1. Jezzard P, Balaban RS. Correction for geometric distortion in echo planar images from B0 field variations. Magn. Reson. Med 1995;34:65–73. - PubMed
    1. Anzai Y, Lufkin RB, Jabour BA, Hanafee WN. Fat-suppression failure artifacts simulating pathology on frequency-selective fat-suppression MR images of the head and neck. AJNR Am. J. Neuroradiol 1992;13:879–884. - PMC - PubMed
    1. van Gelderen P, de Zwart JA, Starewicz P, Hinks RS, Duyn JH. Real-time shimming to compensate for respiration-induced B0 fluctuations. Magn. Reson. Med 2007;57:362–368. - PubMed

Publication types

MeSH terms