PyTorch-based ESPIRiT coil sensitivity calibration for MRI
Project description
ESPIRiT
PyTorch-based ESPIRiT coil sensitivity calibration for MRI.
Single codebase that runs on CPU, CUDA GPU, and Apple Silicon (MPS) — no separate code paths needed.
Notice
This package contains a PyTorch translation of the ESPIRiT implementation from the BART (Berkeley Advanced Reconstruction Toolbox), © 2013–2026 The Regents of the University of California and BART Developer Team. BART is licensed under the BSD 3-Clause License. See https://codeberg.org/mrirecon/bart.
Usage
1) CLI
uvx espirit kspace.npy
2) Python
uv add espirit
import numpy as np
import torch
from espirit import espirit
# NumPy
kspace_np = np.load("kspace.npy")
csm_np = espirit(kspace_np)
# PyTorch
kspace_pt = torch.randn(8, 24, 24, 24, dtype=torch.complex64)
csm_pt = espirit(kspace_pt)
Options
csm = espirit(
kspace, # (n_coils, *spatial_dims)
calib_size=24, # calibration region size
kernel_size=6, # sliding-window kernel size
threshold=0.001, # singular-value threshold
mask_threshold=0.8, # eigenvalue mask threshold
normalize=True, # RSS=1 normalization
rotphase=True, # remove phase ambiguity
device=None # cuda, mps, or cpu (auto-detect when None)
)
Device support
| Device | Backend | Notes |
|---|---|---|
cpu |
NumPy/MKL | Always available |
cuda |
NVIDIA GPU | Requires CUDA toolkit |
mps |
Apple Metal | macOS with Apple Silicon |
The same code runs on all devices — PyTorch handles dispatch automatically.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file espirit-0.1.2.tar.gz.
File metadata
- Download URL: espirit-0.1.2.tar.gz
- Upload date:
- Size: 16.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67e9440ac4b9a5a382c637439dc1972df5c5bff840a2f276ac37913251c1807a
|
|
| MD5 |
00cc4ee4868fe7232fa92d1d72dcd335
|
|
| BLAKE2b-256 |
c86305adc42af0d8257549f203af1eb49f53040b30a3ff89c76b40c849c4fb71
|
Provenance
The following attestation bundles were made for espirit-0.1.2.tar.gz:
Publisher:
python-publish.yml on oscarvanderheide/espirit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
espirit-0.1.2.tar.gz -
Subject digest:
67e9440ac4b9a5a382c637439dc1972df5c5bff840a2f276ac37913251c1807a - Sigstore transparency entry: 1186027704
- Sigstore integration time:
-
Permalink:
oscarvanderheide/espirit@b8129829f6e6ff9ed5d72d51fe59cbd520a1425a -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/oscarvanderheide
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@b8129829f6e6ff9ed5d72d51fe59cbd520a1425a -
Trigger Event:
release
-
Statement type:
File details
Details for the file espirit-0.1.2-py3-none-any.whl.
File metadata
- Download URL: espirit-0.1.2-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6806f6187675b8b8854ae5146dcfa21befe2455d52a88932323b5d1a0ff4989
|
|
| MD5 |
d32fa98a0accee58e9bfd29a9a3f4965
|
|
| BLAKE2b-256 |
e47b533cad01765cf1e51bf8c82acf3865f91d7513971067cff7865a61814975
|
Provenance
The following attestation bundles were made for espirit-0.1.2-py3-none-any.whl:
Publisher:
python-publish.yml on oscarvanderheide/espirit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
espirit-0.1.2-py3-none-any.whl -
Subject digest:
c6806f6187675b8b8854ae5146dcfa21befe2455d52a88932323b5d1a0ff4989 - Sigstore transparency entry: 1186027754
- Sigstore integration time:
-
Permalink:
oscarvanderheide/espirit@b8129829f6e6ff9ed5d72d51fe59cbd520a1425a -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/oscarvanderheide
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@b8129829f6e6ff9ed5d72d51fe59cbd520a1425a -
Trigger Event:
release
-
Statement type: