Standalone fastMRI prostate T2 and diffusion regridding, GRAPPA filling, and complex IFFT outputs.
Project description
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:
- Loads
kspace,calibration_data, and the ISMRMRD header. - Detects T2 or diffusion data, or uses the sequence passed on the command line.
- Applies trapezoidal EPI regridding for diffusion data when header parameters are present. T2 data keeps its Cartesian readout grid.
- Fills missing samples with GRAPPA using the calibration data.
- Computes a centered complex inverse FFT from the filled k-space.
- 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 ofkspace_grappa.image_complex_coil_combined: diffusion only, whencoil_sens_mapsis 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.
- Create a PyPI project or pending publisher for
fastmri_tools. - Configure PyPI Trusted Publishing with:
- Owner:
meis-01 - Repository name:
fastmri_tools - Workflow name:
publish.yml - Environment name:
pypi
- Owner:
- 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.
Project details
Release history Release notifications | RSS feed
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 fastmri_tools-0.1.0.tar.gz.
File metadata
- Download URL: fastmri_tools-0.1.0.tar.gz
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac3e8d47aa623337b8c9c286f3df1707c6ee9b084ca9d083120960e70ec541c9
|
|
| MD5 |
3e63b9dd32d1bc1a6a0ee3b0827c6aa4
|
|
| BLAKE2b-256 |
d032a3776b0b26a4e40bb8aa4410a46d5c9f8f92dbab880efeaf8759ae3c51dc
|
Provenance
The following attestation bundles were made for fastmri_tools-0.1.0.tar.gz:
Publisher:
publish.yml on meis-01/fastmri_tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fastmri_tools-0.1.0.tar.gz -
Subject digest:
ac3e8d47aa623337b8c9c286f3df1707c6ee9b084ca9d083120960e70ec541c9 - Sigstore transparency entry: 1996196843
- Sigstore integration time:
-
Permalink:
meis-01/fastmri_tools@e5ba804412e26d90cd0fff364e92ba3241047cff -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/meis-01
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e5ba804412e26d90cd0fff364e92ba3241047cff -
Trigger Event:
release
-
Statement type:
File details
Details for the file fastmri_tools-0.1.0-py3-none-any.whl.
File metadata
- Download URL: fastmri_tools-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5d4dd57b3e895df439023744313c388fe1674acbf5994920836046e222d194b
|
|
| MD5 |
f4d3cafe131c609db230551755c3480e
|
|
| BLAKE2b-256 |
124c2ab5a072702450db84c7fc0639d33fba7a876067c998a6de728c70c6483a
|
Provenance
The following attestation bundles were made for fastmri_tools-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on meis-01/fastmri_tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fastmri_tools-0.1.0-py3-none-any.whl -
Subject digest:
b5d4dd57b3e895df439023744313c388fe1674acbf5994920836046e222d194b - Sigstore transparency entry: 1996196931
- Sigstore integration time:
-
Permalink:
meis-01/fastmri_tools@e5ba804412e26d90cd0fff364e92ba3241047cff -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/meis-01
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e5ba804412e26d90cd0fff364e92ba3241047cff -
Trigger Event:
release
-
Statement type: