3111

Shimming-Toolbox: An open-source software package for performing realtime B0 shimming experiments
Alexandre D'Astous1, Ryan Topfer1, Gaspard Cereza1, Eva Alonso-Ortiz1, Lincoln Craven-Brightman2, Jason Stockmann2,3, and Julien Cohen-Adad1,4
1NeuroPoly Lab, Institute of Biomedical Engineering, Ecole Polytechnique, Montreal, QC, Canada, 2Athinoula A. Martinos Center for Biomedical Imaging, Massachusetts General Hospital, Charlestown, MA, United States, 3Harvard Medical School, Boston, MA, United States, 4Functional Neuroimaging Unit, Centre de recherche de l'Institut universitaire de gériatrie de Montréal, Montreal, QC, Canada

Synopsis

As MRI static fields get increasingly stronger, reducing $$$B_0$$$ inhomogeneities becomes more important but also challenging. When standard active shimming on commercial systems is insufficient for researchers’ needs, alternative approaches such as external shim or hybrid AC/DC coils can be used. However, in order to perform advanced shimming experiments, a proper software ecosystem is required and there is currently no open-source solution for transparent and reproducible shimming experiments. Here we introduce the Shimming Toolbox (https://shimming-toolbox.org), an open-source software package for performing and prototyping static, dynamic and realtime $$$B_0$$$ shimming experiments.

Introduction

For the past decades, solutions have been proposed around “active shimming”, which consists in modifying the static $$$B_0$$$ magnetic field by passing current through shim coils. With the recent introduction of custom external1,2 or hybrid AC/DC shim coils3,4, there is an increasing need to “test out” this new exciting hardware and validate it with the necessary software solution. The software typically takes the form of a custom collection of scripts that can generate a region of interest (ROI), perform a fitting with the shim coil and the input fieldmap to minimize a given cost function and output a set of shim coefficients. While there are existing software packages to perform advanced shimming experiments1,5, to the best of our knowledge, there is no free and open source code that (i) promotes transparent implementation of a variety of shimming algorithms and (ii) enables the research community to contribute to it by adding cutting-edge methods.

We present the Shimming Toolbox (https://shimming-toolbox.org/), an open-source software ecosystem designed to enable advanced $$$B_0$$$ shimming experiments. Shimming Toolbox is written in Python and comes with documented APIs and a set of useful command line interfaces (CLI), which can be launched from a laptop connected to the MRI console. Shimming toolbox can accommodate the most basic shimming scenario (calculating optimal shim coefficients within a single ROI) to more complex scenarios such as dynamic and realtime shimming. As a proof-of-concept, here we show how the Shimming Toolbox can be used in a realtime z-shimming experiment6, whereby slice-select gradients are modulated during image acquisition based on a respiration trace.

Methods

Shimming Toolbox

Shimming Toolbox is organized according to the following modules:

  • File transfer: Dicom data is transferred to the Laptop running the Shimming Toolbox from the MRI console via an ethernet socket, or directly within the VLAN where the MR reconstruction system sits.
  • File conversion: Dicom data are converted to NIfTI files and organized according to the Brain Imaging Data Structure (BIDS)7. The benefits of BIDS include a JSON sidecar, which includes useful metadata (e.g. TE, echo number). Conversion is leveraged by dcm2niix8 and dcm2bids9.
  • Phase unwrapping: Phase data intended for field mapping are unwrapped and appropriately scaled. The module is a “wrapper” for 3rd-party unwrapping software such as FSL Prelude10.
  • Masking: Selection of custom ROI(s) can be done by image thresholding, shapes, or via 3rd-party software such as FSL’s Brain Extraction Tool11 or Spinal Cord Toolbox12.
  • Coil profile: Generates 3D profiles for custom shim coils (e.g., via Biot-Savart law and input wire geometry) or a spherical harmonics basis.
  • Optimizer: A set of Python APIs take the fieldmap(s) and coil profiles and output a set of coefficients (one for each coil channel) that satisfy a given cost function.

Realtime z-shimming experiment

Respiration affects the magnetic field, which is problematic for brain13 and spinal cord imaging14,15. The principle of realtime shimming is to associate the respiratory trace of an individual with the magnetic field changes. We recently introduced realtime z-shimming, where compensation gradients along the slice-selection axis are applied to offset both static (a.k.a. dynamic shimming16) and time-varying magnetic field inhomogeneities6. Here, we validate the use of Shimming Toolbox in the context of realtime z-shimming. We used a pneumatic phantom17 that connects to the respiratory probe of the MRI system. This phantom has a long stick, which terminates by a slightly ferromagnetic object (staple) that oscillates back and forth as shown in Figure 1, creating a controlled, time-varying magnetic field.

The whole shimming experiment is devised as a sequence of CLI calls to Shimming-Toolbox. This sequence of CLI calls are organized in a shell script (https://github.com/shimming-toolbox/shimming-toolbox/blob/master/examples/realtime_zshimming.sh). Figure 2 describes the realtime z-shimming process.

Results

Figure 3 shows the training anatomical data compared to the shimmed data. Due to the strong inhomogeneities caused by the movement of the ferromagnetic object, some ghosting can be seen in the axial plane where no shimming was performed. With realtime z-shimming, ghosting is still observed although with lesser intensity (especially when looking within the phantom). Using the equation on figure 3 the percent signal ghosting18 averaged across all slices and echoes was 33.1% without and 29.6% with realtime z-shimming.

Discussion

Results from the realtime z-shimming experiment showed about 10% reduction in percent signal ghosting. The improvement was more visible at later echoes. Ghosting was however still present, probably due to the in-plane inhomogeneity not corrected in this experiment. The Shimming Toolbox easily accommodated the realtime z-shimming experiment, and other variations of this experiment are ongoing: for example the addition of external shim coils. Future improvements include: support for coil geometry in the PUMCIN format19, a graphical user interface to create/adjust the ROI shim box, coverage of additional shimming scenarios such as dual-ROI shimming for ASL application, support for more field unwrapping algorithms such as Quality-Guided Phase Unwrapping20, SEGUE21 and ROMEO22.

Conclusion

The Shimming Toolbox provides an easy-to-use, streamlined open-source platform to perform static, dynamic and realtime $$$B_0$$$ shimming experiments. Proof-of-concept application with a realtime z-shimming experiment showed a 10% decrease in ghosting artefacts. We hope the Shimming Toolbox will be useful to the community for more transparent and more reproducible $$$B_0$$$ shimming experiments over time and across sites.

Acknowledgements

The authors thank the following people who also made the Shimming Toolbox possible: Johanan Idicula, Gabriel Berestovoy, Maylis Heussner, Nick Guenther, Mathieu Boudreau, Alexandru Foias

The study was funded by the Canada Research Chair in Quantitative Magnetic Resonance Imaging [950-230815], the Canadian Institute of Health Research [CIHR FDN-143263], the Canada Foundation for Innovation [32454, 34824], the Fonds de Recherche du Québec - Santé [28826], the Natural Sciences and Engineering Research Council of Canada [RGPIN-2019-07244], the Canada First Research Excellence Fund (IVADO and TransMedTech), the Courtois NeuroMod project and the Quebec BioImaging Network [5886, 35450].

References

1. Pan JW, Lo KM, Hetherington HP. Role of very high order and degree B0 shimming for spectroscopic imaging of the human brain at 7 tesla. Magn Reson Med. 2012;68: 1007–1017.

2. Juchem C, Nixon TW, McIntyre S, Rothman DL, de Graaf RA. Magnetic field modeling with a set of individual localized coils. J Magn Reson. 2010;204: 281–289.

3. Stockmann JP, Witzel T, Arango N, Mareyam A, Sappo C, Zhou J, et al. An integrated 32ch RF-shim array coil for improved B0 shimming of the brain at 7 Tesla. Proc Intl Soc Magn Reson Med. 2017. p. 0967.

4. Han H, Song AW, Truong T-K. Integrated parallel reception, excitation, and shimming (iPRES). Magn Reson Med. 2013;70: 241–247.

5. Juchem C. B0 Detoxification through Magnetic Field Shimming. Available: http://juchem.bme.columbia.edu/sites/default/files/2020-07/B0DETOX_Manual.pdf

6. Alonso-Ortiz E, Tous C, Topfer R, Cohen-Adad J. Real-Time Z-Shimming for Magnetic Resonance Imaging of the Spinal Cord. Proceedings of the 28th Annual Meeting of ISMRM, Sydney, Australia. 2020.

7. Gorgolewski KJ, Auer T, Calhoun VD, Craddock RC, Das S, Duff EP, et al. The brain imaging data structure, a format for organizing and describing outputs of neuroimaging experiments. Sci Data. 2016;3: 160044.

8. Li X, Morgan PS, Ashburner J, Smith J, Rorden C. The first step for neuroimaging data analysis: DICOM to NIfTI conversion. J Neurosci Methods. 2016;264: 47–56.

9. Dcm2Bids. In: Github Dcm2Bids [Internet]. Available: https://github.com/UNFmontreal/Dcm2Bids

10. Jenkinson M. Fast, automated, N-dimensional phase-unwrapping algorithm. Magn Reson Med. 2003;49: 193–197.

11. S.M. Smith. Fast robust automated brain extraction. Human Brain Mapping, 17(3):143-155, November 2002.

12. De Leener B, Lévy S, Dupont SM, Fonov VS, Stikov N, Louis Collins D, et al. SCT: Spinal Cord Toolbox, an open-source software for processing spinal cord MRI data. Neuroimage. 2017;145: 24–43.

13. 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.

14. Verma T, Cohen-Adad J. Effect of respiration on the B0 field in the human spinal cord at 3T. Magn Reson Med. 2014;72: 1629–1636.

15. Vannesjo SJ, Clare S, Kasper L, Tracey I, Miller KL. A method for correcting breathing-induced field fluctuations in T2*-weighted spinal cord imaging using a respiratory trace. Magn Reson Med. 2019;81: 3745–3753.

16. Morrell G, Spielman D. Dynamic shimming for multi-slice magnetic resonance imaging. Magn Reson Med. 1997;38: 477–483.

17. Morozov D, Rios NL, Duval T, Foias A, Cohen-Adad J. Effect of cardiac-related translational motion in diffusion MRI of the spinal cord. Magn Reson Med. 2018. pp. 119–124. doi:10.1016/j.mri.2018.04.001

18. Jackson EF, Bronskill MJ, Drost DJ, Och J, Pooley RA, Sobol WT, et al. Acceptance testing and quality assurance procedures for magnetic resonance imaging facilities. American Association of Physicists in Medicine. 2010; 23–25.

19. Juchem C, de Graaf RA. The public multi-coil information (PUMCIN) policy. Magn Reson Med. 2017;78: 2042–2047.

20. Zhang Y-D, Wang S, Ji G, Dong Z. An improved quality guided phase unwrapping method and its applications to MRI. Prog Electromagn Res B Pier B. 2014;145: 273–286.

21. Karsa A, Shmueli K. SEGUE: A Speedy rEgion-Growing Algorithm for Unwrapping Estimated Phase. IEEE Trans Med Imaging. 2019;38: 1347–1357.

22. Dymerska B, Eckstein K, Bachrata B, Siow B, Trattnig S, Shmueli K, et al. Phase unwrapping with a rapid opensource minimum spanning tree algorithm (ROMEO). Magn Reson Med. 2020. doi:10.1002/mrm.28563

Figures

Figure 1: Pneumatic phantom with a long stick, which terminates by a slightly ferromagnetic object that oscillates back and forth creating a time-varying magnetic field.

Figure 2: Realtime z-shimming overview. Training session: Step 1: The pressure and fieldmaps are acquired. Step 2: Shimming Toolbox’s optimizer computes a time series of Gz maps. A linear regression is computed between the field gradient and the pressure. Imaging session: Step 3: A dummy GRE scan is run in order to obtain the target image. Step 4: The $$$G_z$$$ maps are resampled onto the target GRE images and $$$G_{z, static}$$$ and c for each slice are sent to the scanner. Step 5: Run the custom realtime z-shimming GRE sequence.

Figure 3: 2D axial multi-echo GRE sequence (TR = 1000 ms, TE1 = 2.5 ms, delta TE = 3ms, 8 echoes, matrix = 128 x 68 x 30, resolution = 1.4 x 1.4 x 3 mm2) without realtime z-shimming (left) and with realtime z-shimming (middle). Ghosting calculation formula and regions where it was applied (right).

Proc. Intl. Soc. Mag. Reson. Med. 29 (2021)
3111