Skip to content

Releases: mrx-org/bifti-phantoms

bifti (Rust) 0.3.0

Choose a tag to compare

@github-actions github-actions released this 28 Oct 13:10
da6f0aa

Published to crates.io: https://crates.io/crates/bifti/0.3.0

bifti (Rust) 0.2.0

Choose a tag to compare

@github-actions github-actions released this 28 Oct 11:22
33a0830

Changed

  • Breaking: Phantom::load(path, max_substeps) and
    Phantom::load_from_config(config, base_dir, max_substeps) take the cap on quadrature
    samples per axis used when an oblique reslice_to is resampled, previously fixed at 8.
    Pass bifti::DEFAULT_MAX_SUBSTEPS for the old behaviour.
  • Resampling onto an oblique reslice_to now warns (through tracing with the tracing
    feature, on stderr otherwise): the result is averaged by approximate midpoint quadrature
    instead of the exact box average used for axis-aligned grids. The warning says when
    max_substeps leaves the quadrature under-sampled, so the result may alias
    (#23).

Added

  • DEFAULT_MAX_SUBSTEPS (8).

bifti (Python) 0.3.0

Choose a tag to compare

@github-actions github-actions released this 28 Oct 13:09
da6f0aa

bifti (Python) 0.2.1

Choose a tag to compare

@github-actions github-actions released this 28 Oct 11:32
deaa01f

bifti (Python) 0.2.0

Choose a tag to compare

@github-actions github-actions released this 28 Oct 11:22
33a0830

Added

  • max_substeps keyword on NumpyPhantom.load, NumpyPhantom.load_from_config and
    load_tissue (default 8): the cap on quadrature samples per axis used when an oblique
    reslice_to is resampled, previously only settable through Resampler.build.
  • Resampler.weight_sum / resample_weighted accept a (C, X, Y, Z) weight, one per
    channel, so a 4-D phantom NIfTI (one density per tissue) goes through a single call
    (#23).
  • ObliqueResampleWarning and Resampler.capped.

Changed

  • Resampling onto an oblique grid now emits an ObliqueResampleWarning: the result is
    averaged by approximate midpoint quadrature instead of the exact box average used for
    axis-aligned grids. The warning says when max_substeps leaves the quadrature
    under-sampled, so the result may alias
    (#23).
  • A weight whose shape matches neither the source grid nor (C, *source grid) now raises
    ValueError instead of failing inside the contraction.

BiftiPhantoms-v0.3.0

Choose a tag to compare

@github-actions github-actions released this 28 Oct 13:26
da6f0aa

BiftiPhantoms BiftiPhantoms-v0.3.0

Diff since BiftiPhantoms-v0.2.1

Added

  • save_bifti(...; constant_threshold=...): store a map as a constant when its RMS
    deviation from the real part of its mean (its standard deviation, for a real map) is at
    most the threshold. nothing (the default) or a negative value disables it; density
    always stays a map.

Changed

  • Breaking: save_bifti prefixes every NIfTI with the name of the JSON file
    (phantom_density.nii.gz, phantom_B1plus_0.nii.gz, ... for phantom.json), so several
    phantoms can be saved into one directory without overwriting each other's maps.

Merged pull requests:

  • Prefix saved NIfTIs, constant threshold on save, complex maps in Python (0.3.0) (#34) (@J-Endres)

BiftiPhantoms-v0.2.1

Choose a tag to compare

@github-actions github-actions released this 28 Oct 11:36
deaa01f

BiftiPhantoms BiftiPhantoms-v0.2.1

Diff since BiftiPhantoms-v0.2.0

Added

  • load_bifti(...; max_substeps=8): the cap on quadrature samples per axis used when an
    oblique reslice_to is resampled, previously fixed at 8.

Changed

  • Reslicing onto an oblique reslice_to now logs a warning: the result is averaged by
    approximate midpoint quadrature instead of the exact box average used for axis-aligned
    grids. The warning says when max_substeps leaves the quadrature under-sampled, so the
    result may alias (#23).

Merged pull requests:

  • setup publishing workflow (#31) (@J-Endres)
  • Warn on oblique resampling, per-channel weights; bump all packages to 0.2 (fixes #23) (#32) (@J-Endres)
  • python: parse func expressions instead of eval (0.2.1) (#33) (@J-Endres)

Closed issues:

  • resample: the oblique path is silently approximate, and a per-tissue weight can't be batched (#23)

bifti (Python) 0.1.0

Choose a tag to compare

@J-Endres J-Endres released this 27 Oct 13:28

First release of bifti on PyPI: a Python package for loading, saving and resampling
BIfTI MRI simulation phantoms (one JSON file
plus NIfTI files).

pip install bifti          # or: uv add bifti
pip install "bifti[torch]" # optional: torch-accelerated resampling (CPU or CUDA)

Requires Python 3.12 or newer.

Features

  • Load phantoms into NumPy: NumpyPhantom.load(path) reads the phantom JSON and every
    NIfTI it references into one NumpyTissue per tissue (density, T1, T2, T2', ADC,
    dB0, multi-channel B1+/B1-), with property defaults and func value mappings applied.
  • Reslicing (reslice_to): density-weighted footprint averaging, so downsampling really
    averages instead of dropping data and edges are not pulled towards zero. Uses torch when it is
    installed, NumPy otherwise (override with BIFTI_RESAMPLE_BACKEND=numpy|torch).
  • Saving: NumpyPhantom.save(dir) writes a self-contained, deterministic folder (float64
    NIfTIs + JSON, func baked in, no reslice_to), so you can reslice a phantom on disk or
    export one you built in memory.
  • JSON data model: BiftiPhantom.load / .save parse and write just the JSON, for
    generating or editing phantoms without touching voxel data.
  • Patient position: patient_to_scanner / to_scanner_affine map phantom coordinates to
    scanner coordinates.
  • Public registry: load_catalog(), load_registry() and
    load_registry_phantom(collection, name) download phantoms from Zenodo into a local cache.
    Browse them at https://mrx-org.github.io/bifti-phantoms/.

Known limitations

  • func mappings are evaluated with Python's eval: only load phantoms you trust.
  • Complex-valued NIfTI data is not supported yet: the imaginary part of a complex B1+/B1-
    map is dropped.
  • Only the default units are accepted.

This package was built with LLM assistance and has not been reviewed thoroughly yet. Expect
rough edges while the version is 0.x. Please report problems at
https://github.com/mrx-org/bifti-phantoms/issues.

Full documentation: https://github.com/mrx-org/bifti-phantoms/blob/main/python/bifti/README.md

BiftiPhantoms-v0.2.0

Choose a tag to compare

@github-actions github-actions released this 27 Oct 13:12
8cb6f96

BiftiPhantoms BiftiPhantoms-v0.2.0

Diff since BiftiPhantoms-v0.1.0

Breaking changes

None. 0.2.0 only adds functionality; existing code keeps working.
The minor version was bumped because the package is still pre-1.0.

Added

  • save_bifti / save_nifti: save a loaded VoxelPhantom as a deterministic, self-contained
    folder (stacked NIfTI-1 files plus JSON; func mappings baked in, no reslice_to).

Merged pull requests:

  • feat: add option to save phantoms to disk for all impls (#29) (@J-Endres)
  • feat: PR template; docs for easier phantom contribution (#30) (@J-Endres)

BiftiPhantoms-v0.1.0

Choose a tag to compare

@github-actions github-actions released this 09 Oct 14:41
3e1ae35

BiftiPhantoms BiftiPhantoms-v0.1.0

Initial release. Reads, writes and loads BIfTI phantoms, with density-weighted resampling, patient positions and registry downloads.

Closed issues:

  • Proposal: bifti_registry_v3 — phantom groups (shared NIfTIs + multiple JSON configs) (#10)
  • please add semantic versioning to readme or release notes etc. (#18)