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 makes BART, the Berkeley Advanced Reconstruction Toolbox, available in Python on PyTorch tensors, in host memory or on a CUDA device. BART is compiled into the package and runs in the Python process, so a reconstruction written in Python uses BART's parallel imaging, compressed sensing, non-Cartesian and model-based methods without writing files or calling an executable, and can be placed inside a larger PyTorch computation such as the training of an unrolled network.

BART's encoding operators are composable Python objects, its iterative algorithms are solver classes and differentiable iteration blocks, its reconstructions (pics, moba, mobafit, POCSENSE) are pipelines assembled from both, and its remaining commands are Python functions. The arithmetic is BART's except where bartorch substitutes a component: FINUFFT and cuFINUFFT compute every non-uniform FFT, 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's reconstructions (pics, moba, mobafit, POCSENSE) as pipelines of operators and solvers, and its calibration, sampling and simulation commands (ecalib, nlinv, traj, phantom, ...) as functions of tensors.
  • Corrections outside the reconstruction (EPI ghosting, bias field, gradient nonlinearity, off-resonance and susceptibility distortion) and rigid motion estimation from navigators.
  • The bartorch command line, which accepts the arguments of bart.
  • MRI encoding operators — Cartesian, non-Cartesian and wave-encoded SENSE, subspace models, B0 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 BlochSim.
  • 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 apps, priors

kspace = bt.phantom(128, coils=8, kspace=True)  # (coils, z, y, x)
maps = bt.ecalib(kspace, maps=1)
image = apps.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://pulserver.github.io/bartorch/ has the user guide (supported platforms, installation, reporting issues), 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 FINUFFT (Apache-2.0), the libraries FINUFFT's build compiles in with it, 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.9

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.9
File Size Uploaded
bartorch-0.0.9.tar.gz 7.2 MB Details

Built distributions (wheels)

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

Total release size: 30.9 MB

Release files / bartorch-0.0.9.tar.gz

Download URL bartorch-0.0.9.tar.gz
Size 7.2 MB
Tags Source
SHA-256 checksum
How to use checksums
c643e4d0d807e88cdc7c520a2aeea54bc25767e6f27bbeee7292c53d787bf490
BLAKE2b-256 checksum
How to use checksums
0dfb1d91e6e0bd385cc9f32204ffe0249859ea0ab7994d161dd820634daa1757
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 Oct 6, 2026.

Transparency log

Release files / bartorch-0.0.9-py3-none-win_amd64.whl

Download URL bartorch-0.0.9-py3-none-win_amd64.whl
Size 7.6 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
78439d66c79bd319851bcd65c3feacea8dd5852fd3c69f6781fd5821c56aedbc
BLAKE2b-256 checksum
How to use checksums
39b760e9cbe362bf6a17afcbdd4ff8af28dd154319b2d7b8e4c1820263fd7355
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 Oct 6, 2026.

Transparency log

Release files / bartorch-0.0.9-py3-none-manylinux_2_28_x86_64.whl

Download URL bartorch-0.0.9-py3-none-manylinux_2_28_x86_64.whl
Size 13.1 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
5fc9046b2bf109f1a7ef75cc1ac7d094c84110c49331c897099fcf5b3936ffb1
BLAKE2b-256 checksum
How to use checksums
9b45bd1214538e92bed97d1321fad639416081b5680cca163b0e71938bd2e279
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 Oct 6, 2026.

Transparency log

Release files / bartorch-0.0.9-py3-none-macosx_11_0_arm64.whl

Download URL bartorch-0.0.9-py3-none-macosx_11_0_arm64.whl
Size 3.0 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
2af020d0c18f16d509de959c5fac314c4571025ae5018e09ec842e685e65cf73
BLAKE2b-256 checksum
How to use checksums
8c4f4b660d43e507c7e64bea6073bd6cb3d81f09e673dacc16652b3ce661d26f
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 Oct 6, 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

This release

0.0.9 This release

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

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