MIRTorch
A differentiable PyTorch toolbox for medical imaging reconstruction, developed at the University of Michigan. MIRTorch provides composable linear maps, proximal operators, iterative solvers, and MRI and SPECT system models.
Documentation · Examples · API
New
FINUFFT/cuFINUFFT now accelerate non-Cartesian and B0-informed MRI; warm NVIDIA A10 benchmarks measured up to 5.2× faster NUFFT, 9.4× faster Toeplitz, and 12.3× faster iterative solvers (workload-dependent). Both NUFFT backends also support efficient first-order trajectory gradients, enabling SNOPY-style sampling-pattern optimization directly in MIRTorch (Wang and Fessler, 2023).
Install
Install PyTorch for your platform, then:
pip install MIRTorch
CUDA users can install cuFINUFFT with:
pip install "MIRTorch[cufinufft]"
For local development:
pip install -e ".[dev]"
Backends and compilation
NuSense, NuSenseGram, Gmri, and GmriGram use an installed FINUFFT or
cuFINUFFT library when the device supports it, then fall back to torchkbnufft.
Base macOS, Apple Metal, and Linux ARM installs therefore work without a
native library. Set backend="torchkbnufft" or backend="finufft" to
override the automatic choice.
Real-valued CUDA runs of Diff2dgram, FISTA, and POGM use torch.compile
automatically when PyTorch provides it. Other inputs stay eager; pass
compile=False to disable compilation explicitly.
Examples
Each notebook has an Open in Colab badge and a Colab-only setup cell; local runs continue to use the current checkout. Most examples choose CUDA, Apple Metal, or CPU at runtime. The dictionary-learning example deliberately stays on CPU because it exchanges sparse arrays with SciPy:
demo_mr_physics.ipynb: MR contrast, encoding, inverse problems, and optimizationdemo_mri.ipynb: CG-SENSE and B0-informed PWLSdemo_3d.ipynb: 3D non-Cartesian MRI and Toeplitz embeddingdemo_trajectory_optimization.ipynb: SNOPY-style radial trajectory optimizationdemo_cs.ipynb: compressed-sensing MRIdemo_mlem.ipynb: SPECT reconstructiondemo_mnist.ipynb: CG, FISTA, and POGMdemo_dl.ipynb: dictionary learning
Citation and acknowledgments
MIRTorch is inspired by MIRT, MIRT.jl, SigPy, and PyLops.
If MIRTorch is useful in your work, please cite:
@inproceedings{wang:22:mirtorch,
title={{MIRTorch}: A {PyTorch}-powered Differentiable Toolbox for Fast Image
Reconstruction and Scan Protocol Optimization},
author={Wang, Guanhua and Shah, Neel and Zhu, Keyue and Noll, Douglas C. and
Fessler, Jeffrey A.},
booktitle={Proceedings of the International Society for Magnetic Resonance
in Medicine (ISMRM)},
pages={4982},
year={2022}
}
See the documentation for the BJORK and SPECT citations.
MIRTorch is distributed under the BSD 3-Clause License.
Metadata
Release files for MIRTorch 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mirtorch-0.3.1.tar.gz | 88.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mirtorch-0.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 195.1 kB
Release files / mirtorch-0.3.1.tar.gz
| Download URL | mirtorch-0.3.1.tar.gz |
|---|---|
| Size | 88.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
175b27ff39a736ca289882fe3068a9045f56ae9ca120d59ef515ddfde7c8dd52
|
|
BLAKE2b-256 checksum How to use checksums |
2f2786c83d4978e6e7a7fb522e73ed7ede66b1bdcd628f8c42e6a7ca4217e67f
|
| 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 Aug 21, 2026.
Transparency logRelease files / mirtorch-0.3.1-py3-none-any.whl
| Download URL | mirtorch-0.3.1-py3-none-any.whl |
|---|---|
| Size | 106.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c4a1764c759c1ae5201b60372db622602f29bfe287097886e130e64be738e0c8
|
|
BLAKE2b-256 checksum How to use checksums |
66234ee262f626cb8437e6a1f4578a244e04db0813f02b3df73f1f8e13ff6c4a
|
| 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 Aug 21, 2026.
Transparency log