Skip to main content

Tests codecov CodeFactor Docs Lint Typos Ruff PyPI Downloads Python PyTorch Wheels License: MIT Source Stars FAIR checklist badge

bartorch

bartorch embeds BART, the Berkeley Advanced Reconstruction Toolbox, in the Python process and calls it on PyTorch tensors in host or CUDA device memory. BART's commands are Python functions; its linear and nonlinear operators are composable Python objects; its iterative algorithms are solver classes and iteration blocks. Applying an operator or a solver to a tensor that requires a gradient records it for PyTorch autograd. The arithmetic is BART's except where bartorch substitutes a component: FINUFFT and cuFINUFFT compute every non-uniform Fourier transform, the FFT and BLAS/LAPACK routines come from MKL, PyTorch's linked library or SciPy, and the MRI encoding operators run on bartorch's own executor built from BART's operators.

Features

  • BART commands (pics, ecalib, nlinv, moba, ...) as functions of tensors, and the bartorch command line, which accepts the arguments of bart.
  • MRI encoding operators — Cartesian, non-Cartesian and wave-encoded SENSE, off-resonance correction — composed with @ and + into single BART operators.
  • BART's regularization terms and its CG, IST, FISTA, ADMM and primal-dual iterations, as solvers and as differentiable iteration blocks.
  • Nonlinear operators, iteratively regularized Gauss-Newton, and quantitative signal models from TorchSim.
  • Adapters for unrolled networks, plug-and-play denoisers and DeepInverse.

bartorch architecture: PyTorch tensors enter the command-style and composable interfaces, which call the bartorch C ABI through ctypes; the ABI runs the embedded BART, whose non-uniform Fourier transforms and linear algebra are served by substituted backends

Quick start

pip install bartorch
import bartorch.tools as bt
from bartorch import priors

kspace = bt.phantom(128, coils=8, kspace=True)  # (coils, z, y, x)
maps = bt.ecalib(kspace, maps=1)
image = bt.pics(kspace, maps, regularizers=priors.Wavelet((-1, -2), 0.005), solver="fista")

The same reconstruction can be assembled from an encoding operator and a solver; Interfaces and execution describes which interface fits which task.

Documentation

https://mcencini.github.io/bartorch/ has the user guide (installation, supported platforms, data layout), the developer guide, conceptual explanations, executed examples and the API reference, with a version switcher between the development version and the releases.

Citation

bartorch has no publication or archival DOI. Work that uses it should cite BART and the methods it applied (ESPIRiT, compressed sensing, nonlinear inversion, ...), and report the bartorch version or commit and the pinned BART revision; Contributors and citation gives the references and what else a reproducible report records.

License

bartorch is MIT-licensed. The embedded BART (BSD-3-Clause) and the vendored pocketfft (BSD-3-Clause) and BlocksRuntime (MIT or NCSA) keep their own licenses; see License and third-party notices. bartorch is an independent project, not affiliated with or endorsed by the BART developers, the PyTorch Foundation or The Linux Foundation. The logo combines BART's mark with the PyTorch logo's flame; PyTorch, the PyTorch logo and any related marks are trademarks of The Linux Foundation.

Metadata

Release files for bartorch 0.0.3.post0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bartorch 0.0.3.post0
File Size Uploaded
bartorch-0.0.3.post0.tar.gz 2.3 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for bartorch 0.0.3.post0
File Interpreter ABI Platform
bartorch-0.0.3.post0-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details
bartorch-0.0.3.post0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details

Total release size: 5.9 MB

Release files / bartorch-0.0.3.post0.tar.gz

Download URL bartorch-0.0.3.post0.tar.gz
Size 2.3 MB
Tags Source
SHA-256 checksum
How to use checksums
37ab0190ef186cdb52c662b5d70b38d7ab932ae0c10f83df0cc3803b94dc2e0d
BLAKE2b-256 checksum
How to use checksums
bb934f545f5b201bbdaacb8ab18630a293ca616735fdc616e18cf584dead770e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.

Transparency log

Release files / bartorch-0.0.3.post0-py3-none-manylinux_2_28_x86_64.whl

Download URL bartorch-0.0.3.post0-py3-none-manylinux_2_28_x86_64.whl
Size 2.0 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
3d6b103cb4e322aa2e9258968097dd31dea7d0a4ea8e97a02ea0547de966f3e8
BLAKE2b-256 checksum
How to use checksums
e8283e4e9be43b7b24967cb924b31347a1a8f006c10e185000a695f5df6264a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.

Transparency log

Release files / bartorch-0.0.3.post0-py3-none-macosx_11_0_arm64.whl

Download URL bartorch-0.0.3.post0-py3-none-macosx_11_0_arm64.whl
Size 1.7 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
d7bbb71a1cc4e42dc730b2e4a67287e626111c21549cc219e812d9f28ad4f8a7
BLAKE2b-256 checksum
How to use checksums
c5ee9497b5b44b323c83c700ab89be51a70548f3f2ebb967761becd843ee9b56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.

Transparency log

Release history Release notifications | RSS feed

0.0.16

4 release files

0.0.15

4 release files

0.0.14

4 release files

0.0.13

4 release files

0.0.9

4 release files

0.0.8

4 release files

0.0.7

4 release files

0.0.6

4 release files

0.0.5

4 release files

0.0.4

4 release files

This release

0.0.3.post0 This release

3 release files

0.0.2

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page