# gGRAPPA: A Flexible, GPU-Accelerated Python Package for Fast and Efficient generalized GRAPPA Reconstruction

Maxime Bertrait, Chaithya Giliyar Radhakrishna, Philippe Ciuciu

## ► To cite this version:

Maxime Bertrait, Chaithya Giliyar Radhakrishna, Philippe Ciuciu. gGRAPPA: A Flexible, GPU-Accelerated Python Package for Fast and Efficient generalized GRAPPA Reconstruction. ISMRM & ISMRT 2025 - Annual Meeting & Exhibition, May 2025, Honolulu, Hawaii, United States. hal-04906124

HAL Id: hal-04906124

https://inria.hal.science/hal-04906124v1

Submitted on 22 Jan 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# gGRAPPA: A Flexible, GPU-Accelerated Python Package for Fast and Efficient generalized GRAPPA Reconstruction

Maxime Bertrait¹,², Chaithya G R¹,², Philippe Ciuciu¹,²

¹CEA Neurospin, Gif-sur-Yvette, France, ²Inria, MIND, Palaiseau, France

**Synopsis:**

**Motivation:** Existing open-source MR reconstruction tools often fail to efficiently utilize GPU resources and lack support for generalized GRAPPA implementations. Many tools are limited to 2D or 3D reconstruction, and few incorporate advanced techniques such as 2D-CAIPIRINHA, which enhances imaging capabilities.

**Goal(s):** gGRAPPA aims to provide a fast, flexible, and open-source tool for generalized GRAPPA/CAIPI reconstruction.

**Approach:** By utilizing PyTorch, gGRAPPA runs multiple convolutional windows in batch mode to optimize GPU memory usage and accelerate reconstruction times.

**Results:** gGRAPPA achieves up to a 65x speedup over CPU implementations and a 6x speedup compared to non-batched GPU methods, enabling efficient and fast reconstruction MRI scans.

**Purpose:** Generalized autocalibrating partially parallel acquisitions (GRAPPA) is widely used in MRI reconstruction, but conventional implementations, such as those in MATLAB on CPUs, are computationally intensive, especially for high-dimensional data, and those in Python on GPU not implementing a “generalized GRAPPA”. We developed gGRAPPA to address these limitations by (1) utilizing GPU acceleration for high-speed processing and (2) supporting flexible GRAPPA configurations (2D and 3D). Furthermore, gGRAPPA allows users to have full control on the reconstruction by tuning key parameters like kernel size and regularization strength. This tool aims to provide a generalized and flexible GRAPPA reconstruction framework allowing fast and efficient processing on GPU.

**Impact:** gGRAPPA provides a fast, flexible, and open-source solution for GRAPPA MRI reconstruction on GPU, significantly accelerating reconstruction times and enabling ultra high-resolution imaging reconstruction, thereby supporting advanced research applications across diverse MRI protocols.
**Introduction:** GRAPPA (generalized autocalibrating partially parallel acquisitions) [1] is a widely used method in multi-coil MRI reconstruction. However, available open-source implementations are either not implementing both 2D/3D GRAPPA [2] and 2D-CAIPIRINHA [3] support, and/or not leveraging GPU capabilities. As a result, without a generalized GRAPPA implementation, users are required to depend on various reconstruction tools. While GPU-based implementations have shown improvements over CPU-based ones, they still often lack efficiency as they do not provide a way to control GPU memory occupancy when reconstructing an MRI scan, which leads to avoidable underuse of resources and longer reconstruction times. Furthermore, they often lack flexibility in the crucial reconstruction parameters like GRAPPA kernel size or regularization strength.

**Methods:** To overcome these limitations and challenges, we developed gGRAPPA, a fast and flexible open-source Python package built with a PyTorch backend, designed to perform flexible and efficient generalized GRAPPA MRI reconstruction on GPU.

Key features of gGRAPPA include:

* **Generalized GRAPPA:** gGRAPPA supports GRAPPA reconstructions for 2D and 3D Cartesian undersampling in k-space. It also supports advanced acquisition protocols like 2D-CAIPIRINHA, expanding flexibility across diverse accelerated MR imaging acquisitions.

* **Convolution Windows Batching:** While traditional MRI reconstruction tools often underuse GPU memory as they process single convolutional window per iteration in the kernels application stage, gGRAPPA comes up with a Convolution Windows Batching (CWB) feature to process multiple convolutional windows in a single iteration, fully utilizing available GPU resources to drastically accelerate reconstruction. In Fig.1, we illustrate how CWB works.

* **Flexibility:** To address the lack of flexibility in existing MRI reconstruction tools, gGRAPPA provides users with control on crucial GRAPPA reconstruction parameters such as the kernel size and the regularization strength, enabling fine control over image quality and noise distribution in the final reconstruction.
* **Masked GRAPPA:** To further improve flexibility and versatility of the reconstruction, we equipped gGRAPPA with a masking feature allowing users to perform targeted reconstructions for specific regions in the k-space.

**Results:** Our results show that gGRAPPA achieves significant 65x and 6x speedups (Fig.2) in reconstruction times over respectively CPU and traditional GPU implementations, making it an efficient and versatile tool for challenging MRI reconstruction workflows such as for ultra-high field MRI (UHF) with sub-millimeter resolution as illustrated in Fig.3 with a 11.7T scan collected on the Iseult MR system at NeuroSpin (CEA, France). We also show gGRAPPA capability of reconstructing 3D MRI scans with 2D GRAPPA in Fig.4.

**Conclusion:** gGRAPPA addresses the limitations of existing open-source GRAPPA implementations. CWB on GPU, combined with adjustable parameters for kernel size and regularization, provides a practical solution for both routine and advanced MRI protocols by enabling faster reconstruction with customizable image reconstruction. Future work will be to integrate gGRAPPA inside an online reconstruction workflow using Gadgetron [5] to overcome current limitation on reconstructing ultra-high resolution data from the new 11.7T scanner at NeuroSpin [4], which is not feasible directly on the scanner at the moment.

**Figure(s):**

<figure><img src="image_2.png" /></figure>
Figure 1: Illustration in 2D of Convolutional Window Batching (CWB). Left is traditional non-batched processing of GRAPPA kernels application. Right is CWB, here representing a batch size of 3 convolutional windows processed at the same time.

<table><thead><tr><th></th><th></th><th>Matlab CPU</th><th>Python GPU Non-batched</th><th>gGRAPPA (GPU)</th></tr></thead><tbody><tr><td rowspan="3">Reconstruction time</td><td>GRAPPA Kernels Estimation</td><td></td><td>22 sec</td><td></td></tr><tr><td>GRAPPA Kernels Application</td><td>29 min 11 sec</td><td>2 min 19</td><td>27 sec</td></tr><tr><td>Overall</td><td>29 min 34</td><td>2 min 42</td><td>49 sec</td></tr></tbody></table>

Figure 2: Reconstruction time on a 3T T1-weighted 3D GRE 32 coils 400x300x319 scan acquired with a 3x2 GRAPPA acceleration. GRAPPA kernel size: 7x3x3 (kx,ky,kz), regularization strength: 1e-4, gGRAPPA batch size: 200. Hardware details: Intel Xeon Silver 4114 CPU 20 cores @ 2.20GHz. Quadro RTX 5000 16Gb GPU.

<figure><img src="image_3.png" /></figure>

Figure 3: Slice of a T2*-weighted 2D GRE scan at 11.7T from a healthy volunteer (approved by the national ethical committee and ANSM, the French medical device regulatory authority), with a resolution of 1024×1024 at 0.2 mm isotropic and GRAPPA 2×1. The scan is reconstructed by gGRAPPA (left) and the scanner (right), both using identical GRAPPA parameters: a kernel size of
3×4 (kx,ky) and a regularization strength of \(10^{-4}\). Comparable reconstruction quality is observed between gGRAPPA and the scanner.

<figure><img src="image_4.png" /><figcaption>Figure 4: Slice of a T1-weighted 3D GRE 3T of a phantom 384x384x224 0.5mm iso GRAPPA 3x2 scan reconstructed by gGRAPPA (left) and scanner (right). Both use the same GRAPPA reconstruction parameters: kernel size of 5x4x4 (kx,ky,kz) and regularization strength of \(10^{-4}\).</figcaption></figure>

**Acknowledgments:**

This work benefited from government funding (ESR/EquipEx PRESENCE, ANR-21-ESRE-0006) managed by the French National Research Agency under the France 2030 Future Investment Program. This work was granted access to the CCRT High-Performance Computing (HPC) facility under the Grant CCRT2024-bertrain awarded by the Fundamental Research Division (DRF) of CEA. This work was supported by funding from the CEA BlueSky project.

**References:**

[1] Griswold MA, Jakob PM, Heidemann RM, Nittka M, Jellus V, Wang J, Kiefer B, Haase A. Generalized autocalibrating partially parallel acquisitions (GRAPPA). Magn Reson Med. 2002 Jun;47(6):1202-10
[2] Breuer, FA., Blaimer, M, Seiberlich, N, Griswold, MA, Jakob, P. M. (2006). A 3D GRAPPA algorithm for volumetric parallel imaging. In Proc 14th Annual Meeting ISMRM, Seattle (Vol. 286).

[3] Breuer FA, Blaimer M, Mueller MF, Seiberlich N, Heidemann RM, Griswold MA, Jakob PM. Controlled aliasing in volumetric parallel imaging (2D CAIPIRINHA). Magn Reson Med. 2006 Mar;55(3):549-56

[4] Boulant, N., Mauconduit, F., Gras, V. et al. In vivo imaging of the human brain with the Iseult 11.7-T MRI scanner. Nat Methods (2024)

[5] Hansen MS, Sørensen TS. Gadgetron: An Open Source Framework for Medical Image Reconstruction. Magn Reson Med. 2013 Jun;69(6):1768-76.