Skip to main content

fastmri_tools

Standalone reconstruction helper for fastMRI prostate T2 and diffusion HDF5 files.

The project is intentionally self-contained: it does not import anything from the parent repository. Runtime dependencies are ordinary pip packages listed in pyproject.toml.

What it does

For each input MRI HDF5 file, the pipeline:

  1. Loads kspace, calibration_data, and the ISMRMRD header.
  2. Detects T2 or diffusion data, or uses the sequence passed on the command line.
  3. Applies trapezoidal EPI regridding for diffusion data when header parameters are present. T2 data keeps its Cartesian readout grid.
  4. Fills missing samples with GRAPPA using the calibration data.
  5. Computes a centered complex inverse FFT from the filled k-space.
  6. Writes complex outputs with the same dimensions as the original input k-space: (averages, slices, coils, readout, phase).

The output HDF5 contains:

  • kspace_regridded: complex k-space after diffusion regridding, or a copy of the input k-space for T2.
  • kspace_grappa: complex GRAPPA-filled k-space.
  • image_complex: complex centered inverse FFT of kspace_grappa.
  • image_complex_coil_combined: diffusion only, when coil_sens_maps is available in the source file. This is still complex and has shape (averages, slices, readout, phase).

Install

From PyPI, once the first release has been published:

python -m pip install fastmri_tools

From GitHub:

python -m pip install git+https://github.com/meis-01/fastmri_tools.git

For local development:

python -m venv .venv
.\.venv\Scripts\python -m pip install -U pip
.\.venv\Scripts\python -m pip install -e ".[dev]"

Run one file

fastmri-tools reconstruct `
  --input C:\path\to\file.h5 `
  --output C:\path\to\recon_complex.h5 `
  --sequence auto

Use --sequence t2 or --sequence dwi to override auto-detection.

Run a folder

fastmri-tools reconstruct `
  --input C:\path\to\h5_folder `
  --output C:\path\to\output_folder `
  --sequence auto

The command writes one output HDF5 per input file.

Quick synthetic check

This creates a tiny synthetic T2-like file and reconstructs it:

fastmri-tools make-synthetic --output .\synthetic_t2.h5 --sequence t2
fastmri-tools reconstruct --input .\synthetic_t2.h5 --output .\synthetic_t2_recon.h5 --sequence t2

Inspect the output:

fastmri-tools inspect .\synthetic_t2_recon.h5

The module entry points also work:

python -m fastmri_tools inspect .\synthetic_t2_recon.h5

Publish a release

This repository includes GitHub Actions for CI and PyPI publishing.

  1. Create a PyPI project or pending publisher for fastmri_tools.
  2. Configure PyPI Trusted Publishing with:
    • Owner: meis-01
    • Repository name: fastmri_tools
    • Workflow name: publish.yml
    • Environment name: pypi
  3. Create and publish a GitHub release such as v0.1.0.

GitHub Actions will build the source distribution and wheel, then publish them to PyPI without storing a PyPI API token in GitHub secrets.

Notes

  • The complex inverse FFT is intentionally not converted to RSS magnitude. This preserves phase and coil information.
  • Output spatial dimensions match the loaded k-space dimensions. No T2 zero padding or center cropping is applied.
  • Diffusion regridding is skipped automatically if the ISMRMRD header does not contain the needed EPI timing fields.

Metadata

Release files for fastmri-tools 0.1.0

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

Source distribution (sdist)

Source distribution for fastmri-tools 0.1.0
File Size Uploaded Provenance Actions
fastmri_tools-0.1.0.tar.gz 13.9 kB With provenance Details for fastmri_tools-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fastmri-tools 0.1.0
File Interpreter ABI Platform Actions
fastmri_tools-0.1.0-py3-none-any.whl Python 3 none any Details for fastmri_tools-0.1.0-py3-none-any.whl

Total release size: 29.6 kB

Release files / fastmri_tools-0.1.0.tar.gz

Download URL fastmri_tools-0.1.0.tar.gz
Size 13.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ac3e8d47aa623337b8c9c286f3df1707c6ee9b084ca9d083120960e70ec541c9
BLAKE2b-256 checksum
How to use checksums
d032a3776b0b26a4e40bb8aa4410a46d5c9f8f92dbab880efeaf8759ae3c51dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 28, 2026.

Transparency log

Release files / fastmri_tools-0.1.0-py3-none-any.whl

Download URL fastmri_tools-0.1.0-py3-none-any.whl
Size 15.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b5d4dd57b3e895df439023744313c388fe1674acbf5994920836046e222d194b
BLAKE2b-256 checksum
How to use checksums
124c2ab5a072702450db84c7fc0639d33fba7a876067c998a6de728c70c6483a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 28, 2026.

Transparency log

Security for fastmri-tools 0.1.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for fastmri_tools-0.1.0.tar.gz

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 Jun 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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