What’s new?

26.0.0rc1 (November 20, 2026)

The first release candidate of NiFreeze 26.0.0, the first release with a calendar version. NiFreeze now holds b-vectors in world RAS+ coordinates, predicts GQI by ridge regression, registers with elastix wherever itk-elastix is installed, and requires Python 3.13 or newer. The candidate is for testing on real data, and its known limitations are listed below.

Warning

What breaks.

  • B-vectors in world RAS+ (#643, #654). DWI.gradients holds unit b-vectors in world RAS+ coordinates, with the b-value. from_nii converts FSL’s .bvec files with the image’s affine, where it took them as written before, and reads RAS+B tables (MRtrix’s .b or NiPreps’ .tsv) as gradients_file; the CLI’s --gradient-file does the same. to_nifti writes FSL’s .bvec and .bval for the output’s affine, and a RAS+B .tsv. nfHDF5 files are now written as version 3. Versions 1 and 2 are read as RAS+B, with a warning: a file whose table came from FSL files holds vectors along the voxel axes, so write it again from its NIfTI and FSL files. transform_fsl_bvec is removed: use realign_bvecs(bvecs_to_ras(bvecs, affine, "fsl"), matrix).

  • GQI predictions (#605). gqi and gqi-krr predict by ridge regression around a mean per shell, and gqi no longer overscales the signal. The ridge of gqi-krr is in new units, and its default krr_lambda is 0.3 (DEFAULT_RIDGE) instead of chosen on the data: pass krr_lambda=None to choose it on the data again. prediction_kernel and INVERSE_LAMBDA are removed from nifreeze.model.gqi.

  • Registration settings (#603). The settings of --align-config and of Estimator.run(align_kwargs=...) now apply, at every level of a cascade, and a caller’s num_threads is no longer replaced by omp_nthreads. generate_command refuses unknown settings with a TypeError.

  • Registration backends (#668, #708). The estimator and the CLI register with elastix wherever itk-elastix (the elastix extra) is installed, and with ANTs otherwise: pass registration="ants" to Estimator, or --registration ants to the CLI, to keep ANTs. ants_config is now align_config, and a leftover ants_config raises a TypeError: ants_config="dwi-to-dwi_level1" becomes align_config=AFFINE (from nifreeze.registration import AFFINE). The settings ship as two YAML files with a section per backend: nifreeze.registration.RIGID (the default, ANTs’ b0-to-b0_level0) and AFFINE (ANTs’ dwi-to-dwi_level1). The other three named settings moved to examples/registration/, which is not shipped. Settings are no longer overridden one by one: align_config takes a mapping or a file, so copy a file and edit it to change a setting. --align-config takes such a file, for every level of the cascade. generate_command takes align_config= instead of default=, and Estimator.run no longer takes clip_windows.

  • Python 3.13 or newer (#646), with the oldest versions of the dependencies set by SPEC 0 and no cap on numpy (#647). nest-asyncio moved to the notebooks extra.

Important

Known limitations. The roadmap (#596) tracks each of them.

  • Accuracy. The work on the estimator has not started, so motion estimates do not yet reach the roadmap’s target: a median error below 0.5 mm and a 95th percentile below 1 mm, at 2° and 2 mm of motion.

  • Eddy currents are approximated only by an affine registration: one more pass of the last model, with the AFFINE settings, started from the motion estimates (--eddy on the command line, or Estimator(..., align_config=AFFINE) run on the dataset after the motion pass). Elastix’s affine settings were mapped from ANTs’, not tuned (#693). The smooth field along the phase-encoding axis is not implemented (#591).

  • Memory. Only nfHDF5 inputs are memory-mapped: NIfTI inputs are held in memory, each model fit copies its training data, and nothing is checkpointed (#594, #513, #171). MRIQC’s draft head-motion correction peaked at 8.0 GB on a 0.41 GB series (nipreps/mriqc#1518).

  • Registration. Volumes are registered one after another (#590). ANTs, which is installed apart from NiFreeze, gets the images through files; elastix gets them in memory. The evidence for elastix as the default comes from the phantoms, at motions up to 4 mm and 4° (#693). The default backend depends on whether itk-elastix is installed, so two environments can give different estimates: the CLI’s sidecar records the backend that ran (ANTsVersion or ElastixVersion).

Data

  • to_nifti writes the gradients with every NIfTI it writes (#608), and with insert_b0=True it writes the b=0 followed by the resampled volumes, not the original ones (#601).

  • Readers, writers and conversions of gradient tables: load_bvec_bval, save_bvec_bval, load_rasb, save_rasb, bvecs_to_ras and bvecs_from_ras (#643).

Registration

  • The estimator registers through one interface, nifreeze.registration.Registration, with ANTs and elastix behind it: Estimator(..., registration=...) takes a backend or its name, and RegistrationFactory.init builds "ants", "elastix" or any "module:class" (#668).

  • An elastix backend, nifreeze.registration.elastix.Elastix, is given the images in memory (#676), with ANTs’ rigid and affine settings mapped onto elastix’s components (#674). It needs the new elastix extra (itk-elastix, #673).

  • Elastix is the default backend wherever itk-elastix is installed (#708). On the phantoms’ held-out volumes, it registered better than ANTs in 8 of 12 comparisons and not worse in the other 4, gave the same estimates bit for bit when run again, and took 0.31 to 0.64 of ANTs’ time (#693).

  • Registration settings are YAML files with a section per backend, or a mapping (#632, #708): RIGID (head motion, the default) and AFFINE (eddy currents) ship with NiFreeze.

  • The CLI picks the backend with --registration, and estimates eddy currents with --eddy, one more pass of the last model with the AFFINE settings (#708).

  • generate_command(num_threads=...) also sets ITK’s thread count, over a global setting (#633).

  • The CLI writes the version of the backend it ran (ANTsVersion or ElastixVersion) into a JSON sidecar (#634, #708).

  • nifreeze.analysis.registration scores a registration against a phantom’s known motion (#598), and its AntsRegistration starts from an initial transform (init) as the estimator does (#690).

Validation

  • Reports on what limits the registration error with a perfect target (#610), on the eddy-current truth of the experiments (#623), on elastix’s settings against ANTs (#674, #688), and on elastix against ANTs on held-out volumes (#693).

  • Tests of the conventions by which data reach ANTs and estimates come back (#622), of the amplitude of every model’s prediction (#602), and of the estimator with a mocked registration (#600).

  • The phantom generator (tools/phantoms/, not shipped) oversamples the simulation and simulates a few directions per shell (#636), bins the streamlines at the voxel centres (#637), simulates a slice profile (#659), and has its locks checked in CI (#656).

  • The registration experiments (tools/registration/, not shipped) share their bookkeeping (#616) and their model targets (#627), and test elastix’s settings (#683).

  • rigid_motion leaves its caller’s axis and direction unchanged, so a motion plan that starts at zero no longer turns the later motions into NaN (#684).

  • Docstrings of Perturbation.motions (#641) and of the readout of Distortion (#625).

Documentation

  • A page on citing NiFreeze and writing papers about it, with its authors credited as the NiPreps guidelines say (#663, #666).

  • Every published version of the site has a working version menu. The site opens on the latest release, and main and pre-releases carry a label and a banner that points to it (#696, #698). The home page opens with what NiFreeze does (#704).

Maintenance

  • CI tests Python 3.13 and 3.14 on every pull request (#646), and the oldest versions of the dependencies (#647), which the nipreps-spec0 app raises every quarter (#648, #652, #653).

  • The CI jobs that install ANTs run on Ubuntu 24.04 (#639), and documentation pull requests skip the long jobs (#613).

  • CI caches ANTs and no longer installs TeX Live for the tests (#678). Pull requests and pushes register 16 corners of the ANTs b=0 grid, and the weekly run all 432 cases (#682); the benchmarks compare only pull requests that change what they measure (#686).

  • The documentation builds with Sphinx 9 (#702), in about a minute when the citation has not changed (#706). gh-pages keeps a single commit, so a clone of the repository fetches 241 MB instead of 1.07 GB (#700).

  • AGENTS.md holds the instructions for coding agents, and CLAUDE.md links to it (#661).

0.2.0 (October 29, 2026)

Warning

Volumes are now stored on the first axis (#461). dataset.dataobj has shape (N, X, Y, Z), and dataset[i] returns dataobj[i]. Code that builds datasets directly (BaseDataset, DWI or PET with dataobj=) must pass the volumes first, for example np.moveaxis(data, -1, 0). from_nii and to_nifti convert to and from the NIfTI order (volumes last). HDF5 files are now written as nfHDF5 version 2 (Format="nfHDF5", for PET too) and memory-mapped when loaded. Version 1 files (Format="NFDH5" or "EMC/PET") still load, after a conversion into a temporary file; save them again with to_filename to load them lazily. nifreeze.data.NFDH5_EXT is renamed NFHDF5_EXT.

Motion estimation

  • The instant update: models train on the data realigned with the motion estimated so far (#538), and each registration starts at the current estimate (#536).

  • Realigned volumes are written through their NIfTI q/s-form (#537), and the X5 file holds every volume’s transform (#531).

  • Less per-volume overhead preparing registration inputs (#529); start and end indices for the estimator (#423).

Models

  • Closed-form leave-one-volume-out models: gp-loo and gqi-krr (#499).

  • GP: correct log-space kernel gradients and a tunable noise term (#457), better starting values and a multi-shell noise term (#498), robust and scalable hyperparameter optimization (#507), and a multi-shell kernel (#175).

  • GQI synced with DIPY (#453); DKI fitted through DIPY’s multi_voxel_fit (#450); DTI and DKI fitted on the model’s mask (#541).

  • PET: the B-spline knots span the frames’ domain (#424); the separate PET estimator is gone (#426).

Validation

  • An end-to-end motion test with known truth (#533). It runs on volumes that TRXScan simulated again from the moved head (#582), on the native Sherbrooke phantom in CI (#606).

  • Synthetic phantoms simulated with TRXScan, with their perturbations and ground truth (#555, #557, #559, #563, #570, #573, #576).

  • A sensitivity analysis of how model predictions drift under motion and eddy currents (#542, #544, #565), tracked in CI by quality benchmarks (#553, #566). Rungs 1 to 3 of its ladder run on a phantom protocol (#581), and it no longer includes the inherited-distortion share, which was a registration (#580).

  • A prediction gallery of DWI schemes and models (#460, #510).

Fixes. The estimator and models no longer modify the dataset’s arrays (#527); DWI.to_filename reopens the file it wrote (#516); DKI fits data with two non-zero shells (#415).

The full list of changes is in the GitHub release.

0.1.0 (February 6, 2026)

The first release of NiFreeze. Its changes since the eddymotion fork are listed in the GitHub release.

eddymotion fork

The NiFreeze codebase has been ported from eddymotion on commit 68f199d.