Skip to content

API reference

Auto-generated from docstrings. UniMRI is pre-alpha; anything not listed here is either an internal detail or a not-yet-implemented stub (see the roadmap).

UniMRI: a unified Python framework for MRI raw-data processing and reconstruction.

This package is in pre-alpha. The data model, operator algebra, and reconstruct(method="adjoint"|"cg") work today, validated on real 3-D radial data; unimri.read reads Cartesian ISMRMRD files end-to-end. Other vendor formats (Siemens TWIX, GE, Philips) and non-Cartesian ISMRMRD are still stubs. See docs/roadmap.md.

__version__ = '0.1.0a1' module-attribute

read(path, **options)

Read a raw-data file into :class:MRIData, choosing the reader automatically.

Raises:

Type Description
FileNotFoundError

If path does not exist.

UnsupportedFormatError

If no registered reader recognises the file.

reconstruct(data, method='adjoint', **kwargs)

Reconstruct an image from :class:MRIData.

The top-level entry point. Currently implemented:

  • "adjoint" -- centered inverse FFT (Cartesian) or density-compensated gridding via the adjoint NUFFT (non-Cartesian).
  • "cg" -- CG-SENSE: iterative reconstruction with coil sensitivities, the same solver for Cartesian and non-Cartesian data.

Both non-Cartesian paths need the nufft extra (pip install "unimri[nufft]"). Planned: "sense", "grappa", "cs" -- see docs/roadmap.md.

Parameters:

Name Type Description Default
data MRIData

The raw data to reconstruct.

required
method str

Reconstruction method name.

'adjoint'
**kwargs object

Method-specific options (e.g. coil_combine="rss" for "adjoint"; n_iter, l2, sensitivity for "cg").

{}

Returns:

Type Description
ndarray

The reconstructed image ((z, y, x) for 3-D, (y, x) for 2-D).