Release 2.5.1
Summary
- Faster MRI augmentation with MotionArtifact, RicianNoise, KSpaceSpikeNoise, and BiasField.
- Lower temporary-array usage for eligible Rician noise and bias-field reconstruction, with channel-independent scratch buffers for shared k-space spikes.
- Regression coverage for MRI replay, strided arrays, backend selection, and direct volume batches.
- One source for development dependencies and automated license-review synchronization for eligible Dependabot lockfile updates.
Breaking changes
No public API or minimum Python-version changes; Python 3.11 or higher remains required. Optimized MRI kernels can introduce floating-point roundoff differences. Motion and Rician reconstruction can differ from 2.5.0 by one intensity level for uint8 outputs; seeded replay remains deterministic within this version.
For contributors, requirements-dev.txt has been removed. Use the groups in pyproject.toml:
uv sync --locked --group dev --inexact
Install the PyTorch build appropriate for your environment. For the CPU-only CI profile:
uv sync --locked --group dev --group ci-torch-cpu --inexact
The pip fallback is python -m pip install -e . --group dev with pip 25.1 or higher. See development setup.
New features
MRI performance
- MotionArtifact computes FFTs along the acquisition axis, eliminating two spatial FFT axes. Large writable single-channel volumes use CPU PyTorch FFTs; other inputs use SciPy. #577
- RicianNoise fuses magnitude reconstruction for eligible large float32 arrays and removes a full-size imaginary-square temporary. #577
- KSpaceSpikeNoise combines separable coefficients for up to five shared spikes, using published Albucore 0.2.21 operations. Coefficient storage is independent of channel count, and each allocating addition is bounded to one XY plane. #578
- BiasField interpolates and applies gains one plane at a time for eligible float32 volumes, avoiding a full-volume gain field. Other shapes, dtypes, and field configurations retain their established routes. #578
Measured through the allocating Compose route on Apple M4 Max, exactly one CPU thread, NumPy DHWC float32 volumes of shape 32 × 256 × 256 × 1:
| Transform | Parameters | Before | After | Speedup |
|---|---|---|---|---|
| MotionArtifact | 2 events | 101.43 ms | 70.12 ms | 1.45× |
| RicianNoise | std 0.1, shared fields | 15.18 ms | 14.14 ms | 1.07× |
| KSpaceSpikeNoise | 5 shared spikes, intensity 0.25 | 12.450 ms | 4.954 ms | 2.51× |
| BiasField | std 0.25, scale 0.03 | 6.485 ms | 2.838 ms | 2.29× |
These are the paired measurements reported in #577 and #578, which include exact revisions, parameters, methods, and complete comparison matrices. They used Python 3.12.7, NumPy 2.5.1, SciPy 1.18.0, PyTorch 2.14.0, OpenCV 5.0.0, and Albucore 0.2.21. Results depend on workload and hardware.
Bug fixes
- RicianNoise retains its NumPy route for noise views whose byte strides are incompatible with PyTorch, preventing a conversion error. Motion reconstruction applies the same stride guard. #577
- BiasField restricts streaming to rank-four volume inputs, preserving direct five-dimensional batch behavior. Tests cover optimized and fallback dispatch, independent numerical references, input ownership, and replay. #578
- Dependency license reviews now synchronize with eligible Dependabot lockfile updates after checking unchanged package metadata and license files. Updates use expected-head commits and dispatch ordinary PR checks. #575
Misc
- Development dependencies now live in
pyproject.tomlgroups. Dependabot updates the lockfile within declared requirements, with compatibility-policy changes owned by maintainers. #574 - The lockfile updates NumKong from 7.8.0 to 7.8.4 and Pydantic from 2.13.4 to 2.13.5, along with development and CI dependencies. Runtime minimum requirements and the Albucore 0.2.21 pin are unchanged. #575
- Ruff and pyupgrade hooks are refreshed. #578
- Release assets include the wheel, source distribution, checksums, CycloneDX SBOM, and Correctness & Compatibility Report. See release verification.
Commits
| Commit | PR | Description |
|---|---|---|
780a76a | #574 | Unify dependency declarations and lockfile updates |
db2e4b3 | #577 | Accelerate MotionArtifact and RicianNoise |
acee073 | #578 | Accelerate KSpaceSpikeNoise and BiasField |
8d236a0 | #575 | Synchronize dependency license reviews with lockfile updates |
c046ae6 | #580 | Bump version to 2.5.1 |
Full changelog: 2.5.0…2.5.1