Evidence · fMRIPrep

One-shot BOLD resampler

fMRIPrep resamples each BOLD volume once, from the original series to every output space: head motion, distortion correction and the registrations in one interpolation. LARMORX’s port is a replica of fMRIPrep’s ResampleSeries with nitransforms’ transform chains and SciPy’s interpolation, following SciPy 1.18.1 and numpy 2.5.4 since 2026-10-29. In reproduce it gives the original’s values bit for bit in 136 of its 137 compared cases, out of 139, and fMRIPrep’s own output of a real run with its field map. In the other, coordinates beyond the range of 64-bit integers, SciPy’s C code is undefined and the replica returns NaN. Its default, fix, corrects fMRIPrep’s Jacobian on other grids (PIPE-03), with fMRIPrep’s result on request. On one thread it takes 4.1 to 5.2 times less time than fMRIPrep.

Ports
  • replica larmorx Apache-2.0: crates larmorx-transform and larmorx-interp, lx.transforms.resample_series, translated from fMRIPrep's ResampleSeries (fMRIPrep at commit 21a490fb, Apache-2.0), nitransforms 25.1.0's transform chains (MIT) and SciPy's map_coordinates (BSD-3-Clause)
Status
replica validated (marked before the statuses' definition)
Records
standard comparison (fMRIPrep 26.0.0.dev1's ResampleSeries, nitransforms 25.1.0, SciPy 1.18.1) · PIPE-03 on real geometry · benchmark resample-series
Reference
API page resample-series

What is compared

fMRIPrep resamples each BOLD volume once, from the original series to every output space. It composes the head-motion transform, the voxel-shift map of the field map along the phase-encoding axis, the registration to the T1w and, for standard spaces, the T1w-to-template warp. It applies them in one cubic B-spline interpolation, with the Jacobian of the distortion correction. This Python code is fMRIPrep’s heaviest computation.

The record’s original is fMRIPrep’s ResampleSeries as installed in the comparison’s Python environments (fMRIPrep’s development version 26.0.0.dev1, at commit 21a490fb), run in-process through nipype, with nitransforms 25.1.0 and SciPy 1.18.1. The worked example also compares the replica with the file fMRIPrep 25.2.6 wrote in its own run.

python
import json
import larmorx as lx

meta = json.load(open("sub-01_task-rest_bold.json"))
bold = lx.transforms.resample_series(
    "sub-01_task-rest_desc-stc_bold.nii.gz",
    "sub-01_task-rest_desc-coreg_boldref.nii.gz",
    ["sub-01_task-rest_from-orig_to-boldref_mode-image_desc-hmc_xfm.txt"],
    fieldmap="sub-01_fmapid-auto00000_desc-coeff_fieldmap.nii.gz", pe_dir="j",
    ro_time=meta["TotalReadoutTime"], jacobian=True, n_threads=8,
)

The API page describes every option. How to read what follows: how to read the evidence.

Its port

fMRIPrep comes under the Apache-2.0 licence, nitransforms under MIT and SciPy under BSD-3-Clause, so the replica is in larmorx itself, translated bit for bit as ANTs and sdcflows are:

  • fMRIPrep’s resample_series and its voxel-shift map and Jacobian (fmriprep/interfaces/resampling.py) in larmorx-transform, which computes the coordinates once per run and resamples the volumes on the call’s threads;
  • nitransforms’ chains of transforms (affines, ITK’s head-motion lists, dense fields from .h5 composites) with their float32 parsing and LPS-to-RAS conversions;
  • SciPy’s map_coordinates and spline filters in larmorx-interp, their operation order kept, so the values are SciPy 1.18.1’s.

A clean room of fMRIPrep’s steps is planned after FreeSurfer (roadmap).

The verdicts at a glance

Agreement, replica against the original: fMRIPrep ResampleSeries 26.0.0.dev1, nitransforms 25.1.0 and SciPy 1.18.1 (standard comparison, 139 cases of the record), by category and verdict
SciPy's map_coordinates and spline filters49
transform files (nitransforms)10
onto the BOLD reference9
phase-encoding axes6
onto an anatomical grid3
onto a template's grid3
single volumes3
interpolation orders and modes48
thread counts3
errors2
a real run (ds000005)3

Select a segment to list its cases below.

The record runs its cases in-process against fMRIPrep’s ResampleSeries, nitransforms and SciPy, with upstream_defects="reproduce". 136 of the 137 compared cases are bit-identical to their original. The other is the expected divergence: coordinates beyond the range of 64-bit integers, where SciPy’s C code is undefined; the replica returns NaN there. Two cases, inputs in the wrong order or number, are refused by both with a ValueError.

Since the version update of 2026-10-29 the record runs against the newest releases, SciPy 1.18.1 and numpy 2.5.4 with OpenBLAS 0.3.34. They are kept in a Python environment of their own beside the one the other comparisons share (SciPy 1.15.3, numpy 2.3.5). Each case also runs its original under the older releases and says what changed between them, and why:

  • 122 of the 136 compared cases give the same values;
  • 14 change, every one through SciPy’s own fix of the reflect boundary (SCI-03, below): map_coordinates and the spline filters in modes reflect, grid-mirror and nearest, orders 2 to 5, where the replica follows SciPy 1.18.1;
  • numpy’s new release changes nothing the replica follows: its 4 × 4 products and inverses, checked on 18 million results.

A worked example: fMRIPrep’s resampling with a field map

fMRIPrep’s resampler also ran here on the node’s inputs, once with the newest releases and once with the shared environment’s (a panel each). On this call (mode grid-constant) the two give the same values, every one, and the replica’s output is theirs.

Worked example

fMRIPrep's one-shot resampling of a real BOLD run with its field map

What this shows: In reproduce the replica gives every value of the 63 resampled volumes as fMRIPrep’s resampler gives them with numpy 2.5.4 and SciPy 1.18.1, at 1 and 8 threads alike, and as fMRIPrep 25.2.6 wrote them in its own run. On the BOLD’s own grid fix gives the same bytes: PIPE-03 changes nothing there. fMRIPrep’s resampler gives the same values with both releases of numpy and SciPy.

The ResampleSeries node fMRIPrep 25.2.6 ran on OpenNeuro ds005040 sub-002 (task clip, run 1): the slice-time corrected series moved by its head-motion transforms and unwarped by its PEPOLAR field map (with the Jacobian) onto the BOLD reference in one cubic B-spline interpolation, by fMRIPrep and by the replica. 6 of the 63 volumes are shown; the metrics cover every volume.

Data
OpenNeuro ds005040, sub-002, task clip run 1 (CC0-1.0); shown inside fMRIPrep’s BOLD brain mask, dilated by one voxel
Node
fMRIPrep 25.2.6, bold_native_wf/boldref_bold (ResampleSeries)
Inputs
PE j, readout 0.0137951 s, Jacobian True, order 3, mode grid-constant; the field map as B-spline coefficients (desc-coeff_fieldmaprec), the head motion as one ITK transform per volume
Programs
fMRIPrep 25.2.6’s own output (its working directory); the replica’s lx.transforms.resample_series at commit 1dfe56c0dc60
Volumes
shown: file volumes 0, 12, 25, 37, 50, 62
Versions
fMRIPrep’s own output ran in its 25.2.6 image; fMRIPrep’s resampler (26.0.0.dev1, at commit 21a490fb) ran here too on the node’s inputs, with the newest numerical releases (numpy 2.5.4 with OpenBLAS 0.3.34, SciPy 1.18.1: the releases the replica follows since 2026-10-29) and with the shared environment’s (numpy 2.3.5, SciPy 1.15.3); the step between the two, for reference
Inputds005040 sub-002 BOLD, task clip run 1after fMRIPrep's slice-timing correction (the node's input), int16 × scale factor
OriginalfMRIPrep ResampleSeries 26.0.0.dev1numpy 2.5.4 (OpenBLAS 0.3.34), SciPy 1.18.1: the newest releases (oracles/python-newest), which the replica follows · run here on the node's inputs
fMRIPrep's outputfMRIPrep's outputfMRIPrep 25.2.6, as it ran: ResampleSeries in its image, 8 threads
Replicareplicalarmorx, Apache-2.0 · 8 threads, reproduce · against fMRIPrep ResampleSeries 26.0.0.dev1 with numpy 2.5.4 and SciPy 1.18.1, and fMRIPrep's output
Replicareplicalarmorx, Apache-2.0 · 8 threads, fix (the default, PIPE-03 and the rest corrected)

Bit-identical10,321,920 of 10,321,920 voxels equal

the replica against the originalreplica − fMRIPrep ResampleSeries 26.0.0.dev1

Bit-identical10,321,920 of 10,321,920 voxels equal

the replica against fMRIPrep's outputreplica − fMRIPrep's output

Bit-identical10,321,920 of 10,321,920 voxels equal

the replica against itself: fix and reproducereplica: fix − reproduce

Axial slice 19 of 40, volume 1 of 6; file volume 0; compare the input (before) with the resampled series (after) with Swipe or Blink. The interactive viewer needs JavaScript; the metrics below are complete without it.

Every comparison, computed in float64 over every voxel of the outputs

Comparison (A − B), verdict and reasonmax |Δ|Values that differRMS of Δmax |Δ| ÷ range1 − NCC
The original against itself: the yardstick
fMRIPrep ResampleSeries: numpy 2.5.4 / SciPy 1.18.1 − numpy 2.3.5 / SciPy 1.15.3referenceFor reference, the original’s own step between two releases of numpy and SciPy: with numpy 2.5.4 and SciPy 1.18.1 fMRIPrep’s resampler gives the same values as with numpy 2.3.5 and SciPy 1.15.3, every one: this call (mode grid-constant) meets none of the newest releases’ changes (SciPy 1.18 changed only the reflect boundary’s initialisation, SCI-03). the recordidentical: 0 of 10,321,920 values differ
The replica against the original
replica − fMRIPrep ResampleSeries 26.0.0.dev1Bit-identicalEvery value is that of fMRIPrep’s resampler with the newest releases, numpy 2.5.4 (OpenBLAS 0.3.34) and SciPy 1.18.1, which the replica follows since 2026-10-29.identical: 0 of 10,321,920 values differ
The replica against fMRIPrep's output
replica − fMRIPrep's outputBit-identicalEvery value of the 63 volumes is fMRIPrep’s: head motion, the field map’s displacement and its Jacobian, the cubic B-spline interpolation.identical: 0 of 10,321,920 values differ
The replica against itself: thread counts, fix and reproduce
replica: 1 thread − 8 threadsBit-identicalThe same bytes on any number of threads.identical: 0 of 10,321,920 values differ
replica: fix − reproduceBit-identicalOn the BOLD’s own grid PIPE-03’s Jacobian and the corrected one agree (the target’s axes are the source’s): the default, fix, gives the same bytes. PIPE-03identical: 0 of 10,321,920 values differ

Δ is A − B over all 10,321,920 values of the 64 × 64 × 40 × 63 series (every volume), not only the volumes and brain shown. The record’s threshold: the same shape and data type, every value within 10⁻⁶ times the reference’s largest absolute value and the affine within 10⁻⁶ mm; bit-identity reported for every comparison.

Provenance of this example
  • Data: OpenNeuro ds005040, sub-002, CC0-1.0
  • Inputs: BOLD after slice timing (sha256 fdf9b7f121be0832…); BOLD reference (sha256 db30ecbef0f5769a…); field-map coefficients (sha256 2bdeca6a3ea75270…); head motion (sha256 4d9e4f9f9ccd7561…); fMRIPrep’s output (sha256 096e37ffd04f2d89…)
  • Runs: figures cache entry resample-series/fmriprep-ds005040-native, computed 2026-10-21T14:51:43+00:00 with larmorx 1dfe56c0dc60; every command, its environment, threads and exit status are in its RUN_INFO.json
  • Runs: figures cache entry resample-series/fmriprep-ds005040-native-numerics (fMRIPrep’s resampler with the newest numerical releases and with the shared environment’s), computed 2026-10-29T17:18:06+00:00 with larmorx 5aca86d4f1ce; every command, its environment, threads and exit status are in its RUN_INFO.json

Every number above is in resample-series.json, exported by python -m larmorx_validation evidence resample-series.

PIPE-03: the Jacobian on another grid

On the BOLD’s own grid, above, fMRIPrep’s Jacobian is the right factor, and fix and reproduce give the same bytes. fMRIPrep resamples the same run onto T1w and template grids in the same step. There it differentiates the voxel-shift map along the wrong axis and in the wrong units (register, PIPE-03). By default the replica takes the derivative along the BOLD’s phase-encoding axis, in its voxels. The record measures both factors on every grid of three fMRIPrep runs: against the exact factor of a synthetic field on ds000005’s grids, and on ds005040’s and ds005454’s own field maps against the factor on the BOLD’s own grid, carried to each grid.

Worked example

PIPE-03: the Jacobian on another grid, fMRIPrep's and the corrected one

What this shows: On the MNI grid, reproduce gives fMRIPrep’s factor, which departs from the factor on the BOLD’s own grid by a median 0.0124 in the brain (0.101 at the 99th percentile). In fix, its default, the replica corrects PIPE-03 and stays within a median 0.00508 of it (0.063 at the 99th percentile), the size of the interpolation that carries the reference to this grid.

fMRIPrep multiplies the unwarped BOLD by a Jacobian, the factor that undoes the intensity pile-up of the distortion. On the BOLD’s own grid (above) its factor is right; on another grid (here the MNI152NLin2009cAsym 2 mm grid of the same run) it takes the derivative in the wrong voxels. The factors of ds005040’s real field map, against the reference.

Data
OpenNeuro ds005040, sub-002, task clip run 1 (CC0-1.0): fMRIPrep’s field map, transforms and MNI grid; inside the run’s MNI brain mask, dilated; the template, MNI ICBM 152 nonlinear asymmetric 2009c, © McConnell Brain Imaging Centre, Montreal Neurological Institute (notice)
How
a volume of ones resampled as fMRIPrep resamples the BOLD (no head motion), so the output is the factor itself; the reference is the factor on the BOLD’s own grid, where both methods agree, carried to this grid by cubic B-splines
Defect
PIPE-03: The Jacobian is taken along the wrong axis

Data shown

InputThe factor on the BOLD's own grid, carried herewhere both methods agree; cubic B-splines, as fMRIPrep resamples
Replicareplicalarmorx, Apache-2.0 · fix (the default), PIPE-03 corrected: the derivative along the BOLD's phase-encoding axis, in its voxels
ReplicafMRIPrep's factorlarmorx, Apache-2.0 · reproduce: 1 + np.gradient(vsm, axis=pe) on the target grid, bit-identical to fMRIPrep's in the record
the replica against a reference computed another way: the factor on the BOLD's own gridreplica, fix − the factor on the BOLD's own gridscale ±0.764
the replica against a reference computed another way: the factor on the BOLD's own gridreplica, reproduce (fMRIPrep's factor) − the factor on the BOLD's own gridscale ±0.764
the replica against itself: fix and reproduce (PIPE-03)replica: fix − reproduce (PIPE-03)scale ±0.764

Axial slice 38 of 80; the crosshair where the two factors differ most in it; the differences on one symmetric scale. The interactive viewer needs JavaScript; the metrics below are complete without it.

Every comparison, computed in float64 over every voxel of the outputs

Comparison (A − B), verdict and reasonmax |Δ|Values that differRMS of Δmax |Δ| ÷ range1 − NCC
The replica against a reference computed another way
replica, fix − the factor on the BOLD's own gridreferenceThe replica’s factor stays at the reference: a median 0.00508 (99th percentile 0.063), the size of the interpolation carrying the reference here. PIPE-03 the Jacobian record0.764254,304 of 254,305 (100 %)0.01720.5630.0451
replica, reproduce (fMRIPrep's factor) − the factor on the BOLD's own gridreferencefMRIPrep’s factor departs from the reference by a median 0.0124 (99th percentile 0.101) in the brain: it is compressed towards 1 on a grid finer than the BOLD’s or turned against its axes. PIPE-03 the Jacobian record0.469254,304 of 254,305 (100 %)0.0280.3450.154
The replica against itself: fix and reproduce
replica: fix − reproduce (PIPE-03)Deliberate correctionPIPE-03, corrected by default with a warning: fMRIPrep differentiates the voxel-shift map along the target’s axis in target voxels; the replica along the BOLD’s phase-encoding axis in BOLD voxels, as the factor is defined. upstream_defects=‘reproduce’ gives fMRIPrep’s factor. PIPE-03 the Jacobian record0.417254,241 of 254,305 (100 %)0.02950.4130.113

Δ is A − B over the 254,305 voxels of the run’s brain mask on the 97 × 115 × 97 grid (1,082,035 voxels; outside the BOLD’s field of view the factors have no meaning); the medians and percentiles in the reasons too.

Provenance of this example
  • Data: OpenNeuro ds005040, sub-002, CC0-1.0; MNI ICBM 152 nonlinear asymmetric 2009c (Fonov et al., 2009, 2011), from TemplateFlow, the MNI ICBM 152 notice (static/hero/LICENSE-MNI.txt)
  • Runs: figures cache entry resample-series/ds005040-sub-002-jacobian-mni, computed 2026-10-21T07:06:56+00:00 with larmorx 498069fae31d; every command, its environment, threads and exit status are in its RUN_INFO.json

Every number above is in resample-series.json, exported by python -m larmorx_validation evidence resample-series.

Every case

Each case of the record, with what it tests, its verdict and the reason. Search, filter by category or verdict (or select a segment of the chart above), sort by a column; #case=<name> links to one.

139 cases

CaseCategoryWhat it testsVerdictChecks
ndimage/grid-constant-order0SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-constant, order 0Bit-identical271/271
ndimage/grid-constant-order1SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-constant, order 1Bit-identical271/271
ndimage/grid-constant-order2SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-constant, order 2Bit-identical277/277
ndimage/grid-constant-order3SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-constant, order 3Bit-identical277/277
ndimage/grid-constant-order4SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-constant, order 4Bit-identical277/277
ndimage/grid-constant-order5SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-constant, order 5Bit-identical277/277
ndimage/constant-order0SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode constant, order 0Bit-identical271/271
ndimage/constant-order1SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode constant, order 1Bit-identical271/271
ndimage/constant-order2SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode constant, order 2Bit-identical277/277
ndimage/constant-order3SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode constant, order 3Bit-identical277/277
ndimage/constant-order4SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode constant, order 4Bit-identical277/277
ndimage/constant-order5SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode constant, order 5Bit-identical277/277
ndimage/nearest-order0SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode nearest, order 0Bit-identical271/271
ndimage/nearest-order1SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode nearest, order 1Bit-identical271/271
ndimage/nearest-order2SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode nearest, order 2Bit-identical277/277
ndimage/nearest-order3SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode nearest, order 3Bit-identical277/277
ndimage/nearest-order4SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode nearest, order 4Bit-identical277/277
ndimage/nearest-order5SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode nearest, order 5Bit-identical277/277
ndimage/mirror-order0SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode mirror, order 0Bit-identical271/271
ndimage/mirror-order1SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode mirror, order 1Bit-identical271/271
ndimage/mirror-order2SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode mirror, order 2Bit-identical277/277
ndimage/mirror-order3SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode mirror, order 3Bit-identical277/277
ndimage/mirror-order4SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode mirror, order 4Bit-identical277/277
ndimage/mirror-order5SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode mirror, order 5Bit-identical277/277
ndimage/reflect-order0SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode reflect, order 0Bit-identical271/271
ndimage/reflect-order1SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode reflect, order 1Bit-identical271/271
ndimage/reflect-order2SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode reflect, order 2Bit-identical277/277
ndimage/reflect-order3SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode reflect, order 3Bit-identical277/277
ndimage/reflect-order4SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode reflect, order 4Bit-identical277/277
ndimage/reflect-order5SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode reflect, order 5Bit-identical277/277
ndimage/grid-mirror-order0SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-mirror, order 0Bit-identical271/271
ndimage/grid-mirror-order1SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-mirror, order 1Bit-identical271/271
ndimage/grid-mirror-order2SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-mirror, order 2Bit-identical277/277
ndimage/grid-mirror-order3SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-mirror, order 3Bit-identical277/277
ndimage/grid-mirror-order4SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-mirror, order 4Bit-identical277/277
ndimage/grid-mirror-order5SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-mirror, order 5Bit-identical277/277
ndimage/wrap-order0SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode wrap, order 0Bit-identical271/271
ndimage/wrap-order1SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode wrap, order 1Bit-identical271/271
ndimage/wrap-order2SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode wrap, order 2Bit-identical277/277
ndimage/wrap-order3SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode wrap, order 3Bit-identical277/277
ndimage/wrap-order4SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode wrap, order 4Bit-identical277/277
ndimage/wrap-order5SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode wrap, order 5Bit-identical277/277
ndimage/grid-wrap-order0SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-wrap, order 0Bit-identical271/271
ndimage/grid-wrap-order1SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-wrap, order 1Bit-identical271/271
ndimage/grid-wrap-order2SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-wrap, order 2Bit-identical277/277
ndimage/grid-wrap-order3SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-wrap, order 3Bit-identical277/277
ndimage/grid-wrap-order4SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-wrap, order 4Bit-identical277/277
ndimage/grid-wrap-order5SciPy's map_coordinates and spline filtersscipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-wrap, order 5Bit-identical277/277
ndimage/overflowing-coordinatesSciPy's map_coordinates and spline filterscoordinates of 1e19-1e20, where SciPy's index arithmetic overflows (undefined behaviour)Expected divergence

For coordinates beyond the range of int64 (or whose index arithmetic overflows), SciPy’s C code casts and multiplies with undefined behaviour and then reads outside its buffer or wherever the wrapped offset points; the replica returns NaN there instead (14 of 48 …

14/14
nitransforms/hmc-seriestransform files (nitransforms)an ITK text list of 8 MatrixOffsetTransformBase transforms (float32 parsing, LPS to RAS)Bit-identical3/3
nitransforms/centred-affinetransform files (nitransforms)a centred ITK affine mapping an oblique grid (float32 inputs, fused products)Bit-identical6/6
nitransforms/inverse-affinetransform files (nitransforms)the same affine inverted (np.linalg.inv of the RAS matrix)Bit-identical6/6
nitransforms/composite-on-gridtransform files (nitransforms)an ITK .h5 composite, target on the field's nodes (displacements looked up)Bit-identical6/6
nitransforms/composite-off-gridtransform files (nitransforms)an ITK .h5 composite, target off the nodes (cubic interpolation of the field, NaN outside)Bit-identical6/6
nitransforms/chain-affine-compositetransform files (nitransforms)a chain: composite then affine, as fMRIPrep chains boldref→anat and anat→stdBit-identical6/6
nitransforms/fmriprep-mni-warptransform files (nitransforms)fMRIPrep 21.0.1's boldref→T1w affine and T1w→MNI .h5 warp, on the MNI res-2 gridBit-identical6/6
nitransforms/ndcoords-boldref-lastransform files (nitransforms)ImageGrid.ndcoords of boldref-las.nii.gzBit-identical3/3
nitransforms/ndcoords-anat-1transform files (nitransforms)ImageGrid.ndcoords of anat-1.6mm.nii.gzBit-identical3/3
nitransforms/ndcoords-std-2transform files (nitransforms)ImageGrid.ndcoords of std-2.7mm.nii.gzBit-identical3/3
native/las-hmconto the BOLD referencelas series onto its boldref grid: head motion onlyBit-identical6/6
native/las-hmc-sdc-jacobianonto the BOLD referencelas series onto its boldref: head motion + field map, PE j-, JacobianBit-identical6/6
native/las-hmc-sdconto the BOLD referencelas series onto its boldref: head motion + field map, PE j-Bit-identical6/6
native/ras-hmconto the BOLD referenceras series onto its boldref grid: head motion onlyBit-identical6/6
native/ras-hmc-sdc-jacobianonto the BOLD referenceras series onto its boldref: head motion + field map, PE i, JacobianBit-identical6/6
native/ras-hmc-sdconto the BOLD referenceras series onto its boldref: head motion + field map, PE iBit-identical6/6
native/als-hmconto the BOLD referenceals series onto its boldref grid: head motion onlyBit-identical6/6
native/als-hmc-sdc-jacobianonto the BOLD referenceals series onto its boldref: head motion + field map, PE k-, JacobianBit-identical6/6
native/als-hmc-sdconto the BOLD referenceals series onto its boldref: head motion + field map, PE k-Bit-identical6/6
pe/las-iphase-encoding axesLAS series, PE i: the readout sign after reorientation to RASBit-identical6/6
pe/las-i-phase-encoding axesLAS series, PE i-: the readout sign after reorientation to RASBit-identical6/6
pe/las-jphase-encoding axesLAS series, PE j: the readout sign after reorientation to RASBit-identical6/6
pe/las-j-phase-encoding axesLAS series, PE j-: the readout sign after reorientation to RASBit-identical6/6
pe/las-kphase-encoding axesLAS series, PE k: the readout sign after reorientation to RASBit-identical6/6
pe/las-k-phase-encoding axesLAS series, PE k-: the readout sign after reorientation to RASBit-identical6/6
anat/las-hmc-coreg-sdconto an anatomical gridLAS series onto an oblique 1.6 mm grid: head motion + boldref→anatomical affine + field mapBit-identical6/6
anat/ras-hmc-coregonto an anatomical gridoblique RAS series onto the anatomical grid: head motion + affine, no field mapBit-identical6/6
anat/inverse-affineonto an anatomical gridthe affine inverted (inverse=[False, True]): nitransforms' inverse of a centred ITK affineBit-identical6/6
std/on-grid-warponto a template's gridLAS series to a 4 mm grid on the warp's nodes (displacements looked up): motion + affine + .h5 composite + field mapBit-identical6/6
std/off-grid-warponto a template's gridLAS series to a 2.7 mm grid off the warp's nodes (displacements interpolated, NaN outside): motion + affine + .h5 + field mapBit-identical6/6
std/als-off-gridonto a template's gridaxis-permuted series to the 2.7 mm grid through the warp, no field mapBit-identical6/6
3d/sbref-anatsingle volumesa single volume onto the anatomical grid through the affineBit-identical6/6
3d/sbref-native-sdcsingle volumesa single volume onto its own grid with a field map, PE j-Bit-identical6/6
3d/sbref-identitysingle volumesa single volume onto its own grid, no transformsBit-identical6/6
interpolation/order0-grid-constantinterpolation orders and modesorder 0, mode grid-constant: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order0-constantinterpolation orders and modesorder 0, mode constant: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order0-nearestinterpolation orders and modesorder 0, mode nearest: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order0-mirrorinterpolation orders and modesorder 0, mode mirror: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order0-reflectinterpolation orders and modesorder 0, mode reflect: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order0-grid-mirrorinterpolation orders and modesorder 0, mode grid-mirror: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order0-wrapinterpolation orders and modesorder 0, mode wrap: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order0-grid-wrapinterpolation orders and modesorder 0, mode grid-wrap: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order1-grid-constantinterpolation orders and modesorder 1, mode grid-constant: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order1-constantinterpolation orders and modesorder 1, mode constant: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order1-nearestinterpolation orders and modesorder 1, mode nearest: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order1-mirrorinterpolation orders and modesorder 1, mode mirror: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order1-reflectinterpolation orders and modesorder 1, mode reflect: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order1-grid-mirrorinterpolation orders and modesorder 1, mode grid-mirror: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order1-wrapinterpolation orders and modesorder 1, mode wrap: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order1-grid-wrapinterpolation orders and modesorder 1, mode grid-wrap: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order2-grid-constantinterpolation orders and modesorder 2, mode grid-constant: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order2-constantinterpolation orders and modesorder 2, mode constant: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order2-nearestinterpolation orders and modesorder 2, mode nearest: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order2-mirrorinterpolation orders and modesorder 2, mode mirror: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order2-reflectinterpolation orders and modesorder 2, mode reflect: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order2-grid-mirrorinterpolation orders and modesorder 2, mode grid-mirror: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order2-wrapinterpolation orders and modesorder 2, mode wrap: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order2-grid-wrapinterpolation orders and modesorder 2, mode grid-wrap: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order3-grid-constantinterpolation orders and modesorder 3, mode grid-constant: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order3-constantinterpolation orders and modesorder 3, mode constant: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order3-nearestinterpolation orders and modesorder 3, mode nearest: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order3-mirrorinterpolation orders and modesorder 3, mode mirror: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order3-reflectinterpolation orders and modesorder 3, mode reflect: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order3-grid-mirrorinterpolation orders and modesorder 3, mode grid-mirror: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order3-wrapinterpolation orders and modesorder 3, mode wrap: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order3-grid-wrapinterpolation orders and modesorder 3, mode grid-wrap: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order4-grid-constantinterpolation orders and modesorder 4, mode grid-constant: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order4-constantinterpolation orders and modesorder 4, mode constant: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order4-nearestinterpolation orders and modesorder 4, mode nearest: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order4-mirrorinterpolation orders and modesorder 4, mode mirror: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order4-reflectinterpolation orders and modesorder 4, mode reflect: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order4-grid-mirrorinterpolation orders and modesorder 4, mode grid-mirror: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order4-wrapinterpolation orders and modesorder 4, mode wrap: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order4-grid-wrapinterpolation orders and modesorder 4, mode grid-wrap: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order5-grid-constantinterpolation orders and modesorder 5, mode grid-constant: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order5-constantinterpolation orders and modesorder 5, mode constant: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order5-nearestinterpolation orders and modesorder 5, mode nearest: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order5-mirrorinterpolation orders and modesorder 5, mode mirror: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order5-reflectinterpolation orders and modesorder 5, mode reflect: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order5-grid-mirrorinterpolation orders and modesorder 5, mode grid-mirror: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order5-wrapinterpolation orders and modesorder 5, mode wrap: oblique RAS series onto the anatomical grid with motionBit-identical6/6
interpolation/order5-grid-wrapinterpolation orders and modesorder 5, mode grid-wrap: oblique RAS series onto the anatomical grid with motionBit-identical6/6
threads/1thread countsThe replica with n_threads=1 (fMRIPrep with 4): the result does not changeBit-identical6/6
threads/3thread countsThe replica with n_threads=3 (fMRIPrep with 4): the result does not changeBit-identical6/6
threads/12thread countsThe replica with n_threads=12 (fMRIPrep with 4): the result does not changeBit-identical6/6
errors/hmc-not-lasterrorshead-motion transforms that are not first in the list: ValueErrorRejected by both

fMRIPrep: ValueError: HMC transforms must come last. Found sequence: [‘LinearTransformsMapping’, ‘Affine’]; the replica: ValueError: HMC transforms must come last. Found sequence: [‘AffineSeries’, ‘Affine’]

0/0
errors/mismatched-inverseerrorstwo transforms, three inverse flagsRejected by both

fMRIPrep: ValueError: Mismatched number of transforms and inverses; the replica: ValueError: Mismatched number of transforms and inverses

0/0
real/native-hmc-sdca real run (ds000005)ds000005 run 1 (64×64×34×240, LAS) onto its boldref: seeded motion + field map, PE j, JacobianBit-identical6/6
real/T1wa real run (ds000005)ds000005 run 1 onto the T1w boldref grid: motion + fMRIPrep's boldref→T1w affine + field mapBit-identical6/6
real/MNI152NLin2009cAsym-res2a real run (ds000005)ds000005 run 1 onto MNI152NLin2009cAsym res-2 (97×115×97): motion + affine + fMRIPrep's T1w→MNI .h5 warpBit-identical6/6

Speed

The benchmark (report) times the resampling as fMRIPrep’s ResampleSeries does it, without the file I/O, on real BOLD runs, and compares every output with fMRIPrep’s, value by value.

Speed, the replica against the original: fMRIPrep ResampleSeries 26.0.0.dev1

Seconds per resampling, without the file I/O (the median of repeated runs), on a log scale; the factor is fMRIPrep’s time divided by the replica’s, both on one thread.

  • fMRIPrep ResampleSeries 26.0.0.dev1, 1 thread
  • fMRIPrep ResampleSeries 26.0.0.dev1, 12 threads
  • replica, 1 thread
  • replica, 12 threads
  1. ds000005 → native (240 vol.)fMRIPrep ResampleSeries 26.0.0.dev1, 1 thread 21.2 sfMRIPrep ResampleSeries 26.0.0.dev1, 12 threads 5.25 sreplica, 1 thread 4.57 sreplica, 12 threads 0.932 s4.6×
  2. ds000005 → T1w gridfMRIPrep ResampleSeries 26.0.0.dev1, 1 thread 14.4 sfMRIPrep ResampleSeries 26.0.0.dev1, 12 threads 3.5 sreplica, 1 thread 3.52 sreplica, 12 threads 0.732 s4.1×
  3. ds000005 → MNI (.h5 warp)fMRIPrep ResampleSeries 26.0.0.dev1, 1 thread 155 sfMRIPrep ResampleSeries 26.0.0.dev1, 12 threads 42.5 sreplica, 1 thread 29.9 sreplica, 12 threads 6.88 s5.2×
  4. ds006010 → native (113 vol.)fMRIPrep ResampleSeries 26.0.0.dev1, 1 thread 46.2 sfMRIPrep ResampleSeries 26.0.0.dev1, 12 threads 13 sreplica, 1 thread 9.15 sreplica, 12 threads 1.88 s5.1×
  5. ds005454 → native (280 vol.)fMRIPrep ResampleSeries 26.0.0.dev1, 1 thread 409 sfMRIPrep ResampleSeries 26.0.0.dev1, 12 threads 109 sreplica, 1 thread 86.4 sreplica, 12 threads 16.7 s4.7×
0.1 s1 s10 s100 s1000 s

From the benchmark report docs/benchmarks/resample-series.json (Intel® Core™ i7-8750H CPU @ 2.20GHz, 12 logical CPUs).

Corrections by default

  • PIPE-03 (fMRIPrep’s Jacobian on other grids) is corrected by default; upstream_defects="reproduce" gives fMRIPrep’s result bit for bit (register). A report of PIPE-03 for fMRIPrep is drafted, not yet filed.
  • SCI-02 (SciPy’s map_coordinates answers undefined float-to-integer conversions as x86-64 does): the replica clamps them and warns by default; reproduce gives x86-64’s answers. The record’s fix pass met it in 10 cases.
  • SCI-03 (SciPy’s reflect, grid-mirror and nearest splines missing the samples on short axes, up to SciPy 1.17) was corrected by default from 2026-10-11. SciPy 1.18 fixed it, and the replica follows SciPy 1.18.1’s fix in fix and in reproduce since 2026-10-29.

Random testing

Random testing runs random valid inputs and option combinations through fMRIPrep’s resampler and the replica, in long runs of several hours. The inputs come from seeded plain arithmetic (up to 32³ voxels; orientations, data types, scale factors and value ranges of every kind), the options in random combinations from those the resampler accepts (how random testing works). A difference is shrunk to the smallest input and fewest options that still show it, then fixed and kept as a permanent case, registered as a defect of the original, or reported. The latest long run:

Random testing, the replica against the original: fMRIPrep ResampleSeries 26.0.0.dev1, the long run of 2026-10-25 (seed 20261025, 6.2 h for 21 programs): random valid inputs and option combinations, each run through both

ProgramRandom casesExtremeOptions coveredAgreeglibcNoticesUndefinedDifferHeavyGuardUnclear
one-shot resamplerreplica1,4440271,354·87·3···
  • open: not yet fixed or explained (a clean room's difference is reported for its agent) one-shot resampler (replica), 3 case(s): not bit-identical: resampled data: bit-identical: one voxel of a near-zero value (-7.8e-17, a cancellation) one float ulp from fMRIPrep’s: the order of one sum to find (validation/investigations/difftest/resample_pair.py); the random-testing run of 2026-10-29 with the newest versions (numpy 2.5.4, SciPy 1.18.1) found four more of the class (resample-series:20261029:369, 1243, 1700, 2144: mode grid-constant, orders 1, 3, 4, 3; 1 to 3 values of 13,104 to 24,000 differ, at most 5.7e-14 in absolute value), and 369 replays alike against numpy 2.3.5 and SciPy 1.15.3 (--python shared): not the update’s

Notices: a correction named in a case where it changed nothing the input shows (defect, cases): one-shot resampler: PIPE-03 (87).

Every case is drawn from its tool, the run's seed and its number, and replays anywhere: how random testing works; each difference's triage: validation/difftest/triage.toml.

Known limits

The replica covers fMRIPrep’s one-shot path. The field-map estimation before it is sdcflows’, on its own pages (PEPOLAR, direct and fieldmap-less); the rest of fMRIPrep’s BOLD workflow comes with larmorprepx, LARMORX’s preprocessing pipeline, still to come (roadmap).

History

  • 2026-10-11: PIPE-03 and SCI-03 corrected by default (the register).
  • 2026-10-12: SCI-02’s undefined conversions clamped by default, with a warning.
  • 2026-10-29: the version update: the replica follows SciPy 1.18.1 and numpy 2.5.4, kept in a Python environment of their own; SciPy 1.18 fixed SCI-03, and the replica follows its fix in both modes.

Data credits

The data this page shows or names: each dataset with its version, DOI and licence, from LARMORX's test-data catalog. Public-domain dedications (CC0, PDDL) ask nothing; the datasets are cited all the same.