Skip to main content

An interoperable GROG package to accelerate Non-Cartesian MR reconstructions.

Project description

PyGROG

GPU-accelerated GROG (GRAPPA Operator Gridding) for non-Cartesian MRI reconstruction.

PyPI version Read the Docs Tests Docs Check Coverage Ruff Code style: black License: MIT

PyGROG implements the GROG algorithm — a data-driven, parallel-imaging-aware gridding method that maps non-Cartesian k-space samples onto a Cartesian grid using GRAPPA kernels trained from an auto-calibration region. It provides:

  • GROG interpolator (pygrog.calib.GrogInterpolator) — non-Cartesian to Cartesian gridding via fractional GRAPPA operators.
  • SparseFFT operator (pygrog.operator.SparseFFT) — fast sparse forward and adjoint Cartesian FFT for undersampled MRI, with optional sensitivity maps and GPU pipelining.
  • MaskedFFT operator (pygrog.operator.MaskedFFT) — dense-grid masked FFT companion for GROG gridded paths.
  • Reconstruction gadgets (pygrog.gadgets) — off-resonance correction and low-rank subspace projection, stackable on any base operator. Public aliases include SubspaceGadget, OffResonanceGadget, with_subspace, and with_offresonance.
  • Calibration utilities (pygrog.utils) — NLINV coil sensitivity estimation and PCA coil compression.
  • Iterative solvers (op.solve(...), pygrog.solve) — CG/LSMR interfaces that accept torch, NumPy, and CuPy arrays (CuPy via DLPack, no CPU copy).
  • Interoperability (pygrog.interop) — drop-in adapters for mri-nufft, sigpy, mrpro, and deepinverse.

Quick Start

pip install pygrog
import numpy as np
from pygrog.calib import GrogInterpolator
from pygrog.operator import SparseFFT

# 1. Build the GROG plan from the non-Cartesian trajectory
grog = GrogInterpolator(shape=(256, 256), coords=coords)

# 2. Fit GRAPPA kernels from the auto-calibration region (ACR)
grog.calc_interp_table(acr_data)

# 3. Grid and reconstruct in one call
image = grog.interpolate(kspace_nc, ret_image=True)

See the documentation for full examples, API reference, and theory.

Documentation

Full documentation (installation, examples, API, theory) lives at https://pygrog.readthedocs.io/en/latest/.

Installation

# CPU (from PyPI)
pip install pygrog

# Development install with all optional dependencies
pip install --no-build-isolation -e ".[dev]"

CUDA wheels are attached to each GitHub Release.

Development Style

For contributors, formatting and linting are Ruff-only:

ruff format .
ruff check .

ruff check is configured to apply safe auto-fixes by default.

Related Projects

  • mri-nufft — Non-uniform FFT for MRI
  • mrpro — MRI reconstruction in PyTorch
  • sigpy — Signal processing for inverse problems
  • deepinverse — Deep learning for inverse problems

License

MIT — see LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pygrog-0.1.1-cp313-cp313-win_amd64.whl (229.6 kB view details)

Uploaded CPython 3.13Windows x86-64

pygrog-0.1.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (232.0 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

pygrog-0.1.1-cp313-cp313-macosx_12_0_arm64.whl (55.8 MB view details)

Uploaded CPython 3.13macOS 12.0+ ARM64

pygrog-0.1.1-cp312-cp312-win_amd64.whl (229.6 kB view details)

Uploaded CPython 3.12Windows x86-64

pygrog-0.1.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (231.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

pygrog-0.1.1-cp312-cp312-macosx_12_0_arm64.whl (55.8 MB view details)

Uploaded CPython 3.12macOS 12.0+ ARM64

pygrog-0.1.1-cp311-cp311-win_amd64.whl (228.7 kB view details)

Uploaded CPython 3.11Windows x86-64

pygrog-0.1.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (225.4 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

pygrog-0.1.1-cp311-cp311-macosx_12_0_arm64.whl (55.7 MB view details)

Uploaded CPython 3.11macOS 12.0+ ARM64

pygrog-0.1.1-cp310-cp310-win_amd64.whl (227.7 kB view details)

Uploaded CPython 3.10Windows x86-64

pygrog-0.1.1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (226.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

pygrog-0.1.1-cp310-cp310-macosx_12_0_arm64.whl (55.7 MB view details)

Uploaded CPython 3.10macOS 12.0+ ARM64

File details

Details for the file pygrog-0.1.1-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pygrog-0.1.1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 229.6 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pygrog-0.1.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 3fa05dbf835c06e7e8ace8e0356ba774a1ab2f3180be37fde4f11b949b9dec04
MD5 330ef52cedcd40874745eaacc00b0fad
BLAKE2b-256 4d1eb781e1afb6e6552f20d1b308abc307554f8d8128082321325c261c9b2982

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrog-0.1.1-cp313-cp313-win_amd64.whl:

Publisher: publish-pypi.yml on FiRMLAB-Pisa/pygrog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pygrog-0.1.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pygrog-0.1.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6889987552189ea355c032a5264601c442e853fbf4fae6d2120d7aefb443d5c0
MD5 98d334a69dc78abee5b3f973374db641
BLAKE2b-256 bf68ef6f009e8943b3e69e6ba57ce544ea600391823438c6d1b8c0dcafa9f61c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrog-0.1.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish-pypi.yml on FiRMLAB-Pisa/pygrog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pygrog-0.1.1-cp313-cp313-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for pygrog-0.1.1-cp313-cp313-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 60588715196ddac1fc1cb2a70f8460ccaeb8aeba9851ada6010c043b83b4716a
MD5 6a8d8c9e58a31333b5bf3419a57e5382
BLAKE2b-256 7ee4df7d91048ae665ed8e9b99797a3e59d4dc2bdadaa301264cb3aab0c6f36a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrog-0.1.1-cp313-cp313-macosx_12_0_arm64.whl:

Publisher: publish-pypi.yml on FiRMLAB-Pisa/pygrog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pygrog-0.1.1-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pygrog-0.1.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 229.6 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pygrog-0.1.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a0afd6bd33e73af673658f9faa44ea6a22f3a2b8b8d485efa919365b4d65c6fe
MD5 8c930b76089cb6f644aad67b60f04ea3
BLAKE2b-256 5ace4cac207505d2d5e23f8b7508904bf63dbe41b27525dce3f19d0c6b639c9e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrog-0.1.1-cp312-cp312-win_amd64.whl:

Publisher: publish-pypi.yml on FiRMLAB-Pisa/pygrog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pygrog-0.1.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pygrog-0.1.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5b555eccde839ca5bc7bd6d07f5d899c5fe5ed259c3cfe15de5cea0d05e4d82b
MD5 c319e667987c3fe4a03fc93907427033
BLAKE2b-256 7ac36e8faeb2951284c7e0e8166ddb39dae4a37198e44786e5c82118d383439b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrog-0.1.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish-pypi.yml on FiRMLAB-Pisa/pygrog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pygrog-0.1.1-cp312-cp312-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for pygrog-0.1.1-cp312-cp312-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 13e9af4a29c1994ea5a00c9a10cb2455efb399b5090e3370865b20b447adb661
MD5 f4c0ed3e07b7e21442de7eb65cd79ce0
BLAKE2b-256 4aa69f1c4ea01cf31db8eb94970689bc2d15692cde8c807e7d7bf585df4200c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrog-0.1.1-cp312-cp312-macosx_12_0_arm64.whl:

Publisher: publish-pypi.yml on FiRMLAB-Pisa/pygrog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pygrog-0.1.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pygrog-0.1.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 228.7 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pygrog-0.1.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 fe50440430793cbe63a8f598a1e01c84df8bf54deff71bf2653b19679985580c
MD5 9beaccee74fdafda4374820dfc8f16a6
BLAKE2b-256 14e8cf6b5841f4a3fedeb0da2c1ea90757a2c469c6469e97de6a01c44e232f8e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrog-0.1.1-cp311-cp311-win_amd64.whl:

Publisher: publish-pypi.yml on FiRMLAB-Pisa/pygrog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pygrog-0.1.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pygrog-0.1.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3779f51f85de764c7842fa33a26a94b5464c8dd8775dddd5bb286901b852357f
MD5 68c7c873deaaf840a2062f959f627d3c
BLAKE2b-256 48e943fe1b632d26451fe6b6ccba5650f2551ed5c82a586d78cf4da76f2dd512

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrog-0.1.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish-pypi.yml on FiRMLAB-Pisa/pygrog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pygrog-0.1.1-cp311-cp311-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for pygrog-0.1.1-cp311-cp311-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 db2e1dcedcb594e313da28b8a8fe80d7df05ba0f5146582c1b4b4c278d523172
MD5 1869e02f2c14218aef1b5367cd68e82e
BLAKE2b-256 aa2c80b3fef5a14818be5bcd2427ed1ec15cfcb6cdfe258fb24543592266462b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrog-0.1.1-cp311-cp311-macosx_12_0_arm64.whl:

Publisher: publish-pypi.yml on FiRMLAB-Pisa/pygrog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pygrog-0.1.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pygrog-0.1.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 227.7 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pygrog-0.1.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 0487865233014c1f32e79110db86eb21a4c4299bfea354ace63d248bb6ad14f6
MD5 e6386b59ba3b87a72a40ecc257f52316
BLAKE2b-256 0814ab15a7eae84c8c75feeda5cc949dadde34b68e31cc22d57961690fedff0e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrog-0.1.1-cp310-cp310-win_amd64.whl:

Publisher: publish-pypi.yml on FiRMLAB-Pisa/pygrog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pygrog-0.1.1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pygrog-0.1.1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 83ea9f706505e1999bfa56db31d96dae43715775e0edbac92caeccb9eaab5e65
MD5 388181dc6ab1ee35c48c4fec9b84720b
BLAKE2b-256 748f3acc34681d1e4470b0041cb24faaee884676e337d9d823b171f475ccea52

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrog-0.1.1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish-pypi.yml on FiRMLAB-Pisa/pygrog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pygrog-0.1.1-cp310-cp310-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for pygrog-0.1.1-cp310-cp310-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 34dcfa0b9ef37f7a61785cae27ce6675e86ef9193c190191055ad8b33e04855d
MD5 3b597383c8a67f6c7a48c4bb67ffdbb9
BLAKE2b-256 00ecdc372d96674033e2c4b46c1f9158ffa40ab98deba87901321ab7356cdaf3

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrog-0.1.1-cp310-cp310-macosx_12_0_arm64.whl:

Publisher: publish-pypi.yml on FiRMLAB-Pisa/pygrog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page