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)
output_device=None, # final CSM device; use "cpu" to reduce 3D GPU memory
verbose_memory=False,
)
For large 3D datasets, output_device="cpu" moves completed sensitivity-map
slices to CPU immediately. This reduces peak GPU memory while keeping the
calibration and eigenmap calculations on the selected compute device. Tensor
inputs return a tensor on output_device; NumPy inputs always return a NumPy
array.
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.
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.2.0.tar.gz.
File metadata
- Download URL: espirit-0.2.0.tar.gz
- Upload date:
- Size: 19.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
caa70aebe74b23d4200e54fd53a9e86063782cb565636bd0f15d4082a8edaf3d
|
|
| MD5 |
e7f3f7cc1baa4b50d683040c35b99cd1
|
|
| BLAKE2b-256 |
15952ee47f0ed8d2d25efb646d8316b2417600d09de3bf45ef5d29d4ea1e05fa
|
Provenance
The following attestation bundles were made for espirit-0.2.0.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.2.0.tar.gz -
Subject digest:
caa70aebe74b23d4200e54fd53a9e86063782cb565636bd0f15d4082a8edaf3d - Sigstore transparency entry: 2590498720
- Sigstore integration time:
-
Permalink:
oscarvanderheide/espirit@f0fc3c89317c8bf3daaa643b0646312d617f5169 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/oscarvanderheide
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@f0fc3c89317c8bf3daaa643b0646312d617f5169 -
Trigger Event:
release
-
Statement type:
File details
Details for the file espirit-0.2.0-py3-none-any.whl.
File metadata
- Download URL: espirit-0.2.0-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d39963d18287504670a024621d0ba498e99ac3f13fc44a22a49051d5cce2dd46
|
|
| MD5 |
7e0787cdb775e23bc2e882ccd0e783db
|
|
| BLAKE2b-256 |
8e1b189716f6a21d566f7828a1721cf012b4f526b1107a4500d8eb7683ca0ac2
|
Provenance
The following attestation bundles were made for espirit-0.2.0-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.2.0-py3-none-any.whl -
Subject digest:
d39963d18287504670a024621d0ba498e99ac3f13fc44a22a49051d5cce2dd46 - Sigstore transparency entry: 2590500027
- Sigstore integration time:
-
Permalink:
oscarvanderheide/espirit@f0fc3c89317c8bf3daaa643b0646312d617f5169 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/oscarvanderheide
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@f0fc3c89317c8bf3daaa643b0646312d617f5169 -
Trigger Event:
release
-
Statement type: