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
larmorxApache-2.0: crateslarmorx-transformandlarmorx-interp,lx.transforms.resample_series, translated from fMRIPrep'sResampleSeries(fMRIPrep at commit 21a490fb, Apache-2.0), nitransforms 25.1.0's transform chains (MIT) and SciPy'smap_coordinates(BSD-3-Clause)
- replica
- 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.
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_seriesand its voxel-shift map and Jacobian (fmriprep/interfaces/resampling.py) inlarmorx-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
.h5composites) with their float32 parsing and LPS-to-RAS conversions; - SciPy’s
map_coordinatesand spline filters inlarmorx-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
ResampleSeries 26.0.0.dev1, nitransforms 25.1.0 and SciPy 1.18.1 (standard comparison, 139 cases of the record), by category and verdictSelect 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
reflectboundary (SCI-03, below):map_coordinatesand the spline filters in modesreflect,grid-mirrorandnearest, 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.
- Replica against fMRIPrep ResampleSeries 26.0.0.dev1Bit-identical
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_seriesat commit1dfe56c0dc60 - 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
Data shown
- Political Moralization (OpenNeuro ds005040, version 1.2.0, doi:10.18112/openneuro.ds005040.v1.2.0), CC0 1.0 public-domain dedication.





Bit-identical10,321,920 of 10,321,920 voxels equal
Bit-identical10,321,920 of 10,321,920 voxels equal
Bit-identical10,321,920 of 10,321,920 voxels equal
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 reason | max |Δ| | Values that differ | RMS of Δ | max |Δ| ÷ range | 1 − 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 record | identical: 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-03 | identical: 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 larmorx1dfe56c0dc60; every command, its environment, threads and exit status are in itsRUN_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 larmorx5aca86d4f1ce; every command, its environment, threads and exit status are in itsRUN_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.
- Replica against fMRIPrep's factorDeliberate correction
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
- Political Moralization (OpenNeuro ds005040, version 1.2.0, doi:10.18112/openneuro.ds005040.v1.2.0), CC0 1.0 public-domain dedication.
- MNI152NLin2009cAsym template (TemplateFlow, version tpl-MNI152NLin2009cAsym git 15d7c02160f79f5218d2545b4febebeecc11531d), the MNI ICBM 152 copyright notice.






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 reason | max |Δ| | Values that differ | RMS of Δ | max |Δ| ÷ range | 1 − 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 record | 0.764 | 254,304 of 254,305 (100 %) | 0.0172 | 0.563 | 0.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 record | 0.469 | 254,304 of 254,305 (100 %) | 0.028 | 0.345 | 0.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 record | 0.417 | 254,241 of 254,305 (100 %) | 0.0295 | 0.413 | 0.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 larmorx498069fae31d; every command, its environment, threads and exit status are in itsRUN_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
| Case | Category | What it tests | Verdict | Checks |
|---|---|---|---|---|
ndimage/grid-constant-order0 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-constant, order 0 | Bit-identical | 271/271 |
ndimage/grid-constant-order1 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-constant, order 1 | Bit-identical | 271/271 |
ndimage/grid-constant-order2 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-constant, order 2 | Bit-identical | 277/277 |
ndimage/grid-constant-order3 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-constant, order 3 | Bit-identical | 277/277 |
ndimage/grid-constant-order4 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-constant, order 4 | Bit-identical | 277/277 |
ndimage/grid-constant-order5 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-constant, order 5 | Bit-identical | 277/277 |
ndimage/constant-order0 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode constant, order 0 | Bit-identical | 271/271 |
ndimage/constant-order1 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode constant, order 1 | Bit-identical | 271/271 |
ndimage/constant-order2 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode constant, order 2 | Bit-identical | 277/277 |
ndimage/constant-order3 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode constant, order 3 | Bit-identical | 277/277 |
ndimage/constant-order4 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode constant, order 4 | Bit-identical | 277/277 |
ndimage/constant-order5 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode constant, order 5 | Bit-identical | 277/277 |
ndimage/nearest-order0 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode nearest, order 0 | Bit-identical | 271/271 |
ndimage/nearest-order1 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode nearest, order 1 | Bit-identical | 271/271 |
ndimage/nearest-order2 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode nearest, order 2 | Bit-identical | 277/277 |
ndimage/nearest-order3 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode nearest, order 3 | Bit-identical | 277/277 |
ndimage/nearest-order4 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode nearest, order 4 | Bit-identical | 277/277 |
ndimage/nearest-order5 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode nearest, order 5 | Bit-identical | 277/277 |
ndimage/mirror-order0 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode mirror, order 0 | Bit-identical | 271/271 |
ndimage/mirror-order1 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode mirror, order 1 | Bit-identical | 271/271 |
ndimage/mirror-order2 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode mirror, order 2 | Bit-identical | 277/277 |
ndimage/mirror-order3 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode mirror, order 3 | Bit-identical | 277/277 |
ndimage/mirror-order4 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode mirror, order 4 | Bit-identical | 277/277 |
ndimage/mirror-order5 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode mirror, order 5 | Bit-identical | 277/277 |
ndimage/reflect-order0 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode reflect, order 0 | Bit-identical | 271/271 |
ndimage/reflect-order1 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode reflect, order 1 | Bit-identical | 271/271 |
ndimage/reflect-order2 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode reflect, order 2 | Bit-identical | 277/277 |
ndimage/reflect-order3 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode reflect, order 3 | Bit-identical | 277/277 |
ndimage/reflect-order4 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode reflect, order 4 | Bit-identical | 277/277 |
ndimage/reflect-order5 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode reflect, order 5 | Bit-identical | 277/277 |
ndimage/grid-mirror-order0 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-mirror, order 0 | Bit-identical | 271/271 |
ndimage/grid-mirror-order1 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-mirror, order 1 | Bit-identical | 271/271 |
ndimage/grid-mirror-order2 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-mirror, order 2 | Bit-identical | 277/277 |
ndimage/grid-mirror-order3 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-mirror, order 3 | Bit-identical | 277/277 |
ndimage/grid-mirror-order4 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-mirror, order 4 | Bit-identical | 277/277 |
ndimage/grid-mirror-order5 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-mirror, order 5 | Bit-identical | 277/277 |
ndimage/wrap-order0 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode wrap, order 0 | Bit-identical | 271/271 |
ndimage/wrap-order1 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode wrap, order 1 | Bit-identical | 271/271 |
ndimage/wrap-order2 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode wrap, order 2 | Bit-identical | 277/277 |
ndimage/wrap-order3 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode wrap, order 3 | Bit-identical | 277/277 |
ndimage/wrap-order4 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode wrap, order 4 | Bit-identical | 277/277 |
ndimage/wrap-order5 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode wrap, order 5 | Bit-identical | 277/277 |
ndimage/grid-wrap-order0 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-wrap, order 0 | Bit-identical | 271/271 |
ndimage/grid-wrap-order1 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-wrap, order 1 | Bit-identical | 271/271 |
ndimage/grid-wrap-order2 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-wrap, order 2 | Bit-identical | 277/277 |
ndimage/grid-wrap-order3 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-wrap, order 3 | Bit-identical | 277/277 |
ndimage/grid-wrap-order4 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-wrap, order 4 | Bit-identical | 277/277 |
ndimage/grid-wrap-order5 | SciPy's map_ | scipy.ndimage map_coordinates, spline_filter and spline_filter1d: mode grid-wrap, order 5 | Bit-identical | 277/277 |
ndimage/overflowing-coordinates | SciPy's map_ | coordinates 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-series | transform files (nitransforms) | an ITK text list of 8 MatrixOffsetTransformBase transforms (float32 parsing, LPS to RAS) | Bit-identical | 3/3 |
nitransforms/centred-affine | transform files (nitransforms) | a centred ITK affine mapping an oblique grid (float32 inputs, fused products) | Bit-identical | 6/6 |
nitransforms/inverse-affine | transform files (nitransforms) | the same affine inverted (np.linalg.inv of the RAS matrix) | Bit-identical | 6/6 |
nitransforms/composite-on-grid | transform files (nitransforms) | an ITK .h5 composite, target on the field's nodes (displacements looked up) | Bit-identical | 6/6 |
nitransforms/composite-off-grid | transform files (nitransforms) | an ITK .h5 composite, target off the nodes (cubic interpolation of the field, NaN outside) | Bit-identical | 6/6 |
nitransforms/chain-affine-composite | transform files (nitransforms) | a chain: composite then affine, as fMRIPrep chains boldref→anat and anat→std | Bit-identical | 6/6 |
nitransforms/fmriprep-mni-warp | transform files (nitransforms) | fMRIPrep 21.0.1's boldref→T1w affine and T1w→MNI .h5 warp, on the MNI res-2 grid | Bit-identical | 6/6 |
nitransforms/ndcoords-boldref-las | transform files (nitransforms) | ImageGrid.ndcoords of boldref-las.nii.gz | Bit-identical | 3/3 |
nitransforms/ndcoords-anat-1 | transform files (nitransforms) | ImageGrid.ndcoords of anat-1.6mm.nii.gz | Bit-identical | 3/3 |
nitransforms/ndcoords-std-2 | transform files (nitransforms) | ImageGrid.ndcoords of std-2.7mm.nii.gz | Bit-identical | 3/3 |
native/las-hmc | onto the BOLD reference | las series onto its boldref grid: head motion only | Bit-identical | 6/6 |
native/las-hmc-sdc-jacobian | onto the BOLD reference | las series onto its boldref: head motion + field map, PE j-, Jacobian | Bit-identical | 6/6 |
native/las-hmc-sdc | onto the BOLD reference | las series onto its boldref: head motion + field map, PE j- | Bit-identical | 6/6 |
native/ras-hmc | onto the BOLD reference | ras series onto its boldref grid: head motion only | Bit-identical | 6/6 |
native/ras-hmc-sdc-jacobian | onto the BOLD reference | ras series onto its boldref: head motion + field map, PE i, Jacobian | Bit-identical | 6/6 |
native/ras-hmc-sdc | onto the BOLD reference | ras series onto its boldref: head motion + field map, PE i | Bit-identical | 6/6 |
native/als-hmc | onto the BOLD reference | als series onto its boldref grid: head motion only | Bit-identical | 6/6 |
native/als-hmc-sdc-jacobian | onto the BOLD reference | als series onto its boldref: head motion + field map, PE k-, Jacobian | Bit-identical | 6/6 |
native/als-hmc-sdc | onto the BOLD reference | als series onto its boldref: head motion + field map, PE k- | Bit-identical | 6/6 |
pe/las-i | phase-encoding axes | LAS series, PE i: the readout sign after reorientation to RAS | Bit-identical | 6/6 |
pe/las-i- | phase-encoding axes | LAS series, PE i-: the readout sign after reorientation to RAS | Bit-identical | 6/6 |
pe/las-j | phase-encoding axes | LAS series, PE j: the readout sign after reorientation to RAS | Bit-identical | 6/6 |
pe/las-j- | phase-encoding axes | LAS series, PE j-: the readout sign after reorientation to RAS | Bit-identical | 6/6 |
pe/las-k | phase-encoding axes | LAS series, PE k: the readout sign after reorientation to RAS | Bit-identical | 6/6 |
pe/las-k- | phase-encoding axes | LAS series, PE k-: the readout sign after reorientation to RAS | Bit-identical | 6/6 |
anat/las-hmc-coreg-sdc | onto an anatomical grid | LAS series onto an oblique 1.6 mm grid: head motion + boldref→anatomical affine + field map | Bit-identical | 6/6 |
anat/ras-hmc-coreg | onto an anatomical grid | oblique RAS series onto the anatomical grid: head motion + affine, no field map | Bit-identical | 6/6 |
anat/inverse-affine | onto an anatomical grid | the affine inverted (inverse=[False, True]): nitransforms' inverse of a centred ITK affine | Bit-identical | 6/6 |
std/on-grid-warp | onto a template's grid | LAS series to a 4 mm grid on the warp's nodes (displacements looked up): motion + affine + .h5 composite + field map | Bit-identical | 6/6 |
std/off-grid-warp | onto a template's grid | LAS series to a 2.7 mm grid off the warp's nodes (displacements interpolated, NaN outside): motion + affine + .h5 + field map | Bit-identical | 6/6 |
std/als-off-grid | onto a template's grid | axis-permuted series to the 2.7 mm grid through the warp, no field map | Bit-identical | 6/6 |
3d/sbref-anat | single volumes | a single volume onto the anatomical grid through the affine | Bit-identical | 6/6 |
3d/sbref-native-sdc | single volumes | a single volume onto its own grid with a field map, PE j- | Bit-identical | 6/6 |
3d/sbref-identity | single volumes | a single volume onto its own grid, no transforms | Bit-identical | 6/6 |
interpolation/order0-grid-constant | interpolation orders and modes | order 0, mode grid-constant: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order0-constant | interpolation orders and modes | order 0, mode constant: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order0-nearest | interpolation orders and modes | order 0, mode nearest: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order0-mirror | interpolation orders and modes | order 0, mode mirror: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order0-reflect | interpolation orders and modes | order 0, mode reflect: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order0-grid-mirror | interpolation orders and modes | order 0, mode grid-mirror: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order0-wrap | interpolation orders and modes | order 0, mode wrap: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order0-grid-wrap | interpolation orders and modes | order 0, mode grid-wrap: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order1-grid-constant | interpolation orders and modes | order 1, mode grid-constant: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order1-constant | interpolation orders and modes | order 1, mode constant: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order1-nearest | interpolation orders and modes | order 1, mode nearest: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order1-mirror | interpolation orders and modes | order 1, mode mirror: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order1-reflect | interpolation orders and modes | order 1, mode reflect: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order1-grid-mirror | interpolation orders and modes | order 1, mode grid-mirror: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order1-wrap | interpolation orders and modes | order 1, mode wrap: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order1-grid-wrap | interpolation orders and modes | order 1, mode grid-wrap: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order2-grid-constant | interpolation orders and modes | order 2, mode grid-constant: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order2-constant | interpolation orders and modes | order 2, mode constant: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order2-nearest | interpolation orders and modes | order 2, mode nearest: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order2-mirror | interpolation orders and modes | order 2, mode mirror: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order2-reflect | interpolation orders and modes | order 2, mode reflect: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order2-grid-mirror | interpolation orders and modes | order 2, mode grid-mirror: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order2-wrap | interpolation orders and modes | order 2, mode wrap: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order2-grid-wrap | interpolation orders and modes | order 2, mode grid-wrap: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order3-grid-constant | interpolation orders and modes | order 3, mode grid-constant: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order3-constant | interpolation orders and modes | order 3, mode constant: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order3-nearest | interpolation orders and modes | order 3, mode nearest: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order3-mirror | interpolation orders and modes | order 3, mode mirror: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order3-reflect | interpolation orders and modes | order 3, mode reflect: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order3-grid-mirror | interpolation orders and modes | order 3, mode grid-mirror: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order3-wrap | interpolation orders and modes | order 3, mode wrap: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order3-grid-wrap | interpolation orders and modes | order 3, mode grid-wrap: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order4-grid-constant | interpolation orders and modes | order 4, mode grid-constant: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order4-constant | interpolation orders and modes | order 4, mode constant: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order4-nearest | interpolation orders and modes | order 4, mode nearest: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order4-mirror | interpolation orders and modes | order 4, mode mirror: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order4-reflect | interpolation orders and modes | order 4, mode reflect: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order4-grid-mirror | interpolation orders and modes | order 4, mode grid-mirror: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order4-wrap | interpolation orders and modes | order 4, mode wrap: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order4-grid-wrap | interpolation orders and modes | order 4, mode grid-wrap: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order5-grid-constant | interpolation orders and modes | order 5, mode grid-constant: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order5-constant | interpolation orders and modes | order 5, mode constant: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order5-nearest | interpolation orders and modes | order 5, mode nearest: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order5-mirror | interpolation orders and modes | order 5, mode mirror: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order5-reflect | interpolation orders and modes | order 5, mode reflect: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order5-grid-mirror | interpolation orders and modes | order 5, mode grid-mirror: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order5-wrap | interpolation orders and modes | order 5, mode wrap: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
interpolation/order5-grid-wrap | interpolation orders and modes | order 5, mode grid-wrap: oblique RAS series onto the anatomical grid with motion | Bit-identical | 6/6 |
threads/1 | thread counts | The replica with n_threads=1 (fMRIPrep with 4): the result does not change | Bit-identical | 6/6 |
threads/3 | thread counts | The replica with n_threads=3 (fMRIPrep with 4): the result does not change | Bit-identical | 6/6 |
threads/12 | thread counts | The replica with n_threads=12 (fMRIPrep with 4): the result does not change | Bit-identical | 6/6 |
errors/hmc-not-last | errors | head-motion transforms that are not first in the list: ValueError | Rejected 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-inverse | errors | two transforms, three inverse flags | Rejected by both fMRIPrep: ValueError: Mismatched number of transforms and inverses; the replica: ValueError: Mismatched number of transforms and inverses | 0/0 |
real/native-hmc-sdc | a real run (ds000005) | ds000005 run 1 (64×64×34×240, LAS) onto its boldref: seeded motion + field map, PE j, Jacobian | Bit-identical | 6/6 |
real/T1w | a real run (ds000005) | ds000005 run 1 onto the T1w boldref grid: motion + fMRIPrep's boldref→T1w affine + field map | Bit-identical | 6/6 |
real/MNI152NLin2009cAsym-res2 | a real run (ds000005) | ds000005 run 1 onto MNI152NLin2009cAsym res-2 (97×115×97): motion + affine + fMRIPrep's T1w→MNI .h5 warp | Bit-identical | 6/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.
ResampleSeries 26.0.0.dev1Seconds 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
- 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×
- 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×
- 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×
- 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×
- 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×
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_coordinatesanswers undefined float-to-integer conversions as x86-64 does): the replica clamps them and warns by default;reproducegives x86-64’s answers. The record’sfixpass met it in 10 cases. - SCI-03 (SciPy’s
reflect,grid-mirrorandnearestsplines 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 infixand inreproducesince 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
| Program | Random cases | Extreme | Options covered | Agree | glibc | Notices | Undefined | Differ | Heavy | Guard | Unclear |
|---|---|---|---|---|---|---|---|---|---|---|---|
| one-shot resamplerreplica | 1,444 | 0 | 27 | 1,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.
- Mixed-gambles task (OpenNeuro ds000005, version 00001), Open Data Commons Public Domain Dedication and Licence 1.0.
- Political Moralization (OpenNeuro ds005040, version 1.2.0, doi:10.18112/openneuro.ds005040.v1.2.0), CC0 1.0 public-domain dedication.
- fMRIPrep boot camp 7T training dataset (OpenNeuro ds005454, version 1.0.0, doi:10.18112/openneuro.ds005454.v1.0.0), Creative Commons Attribution 4.0 (CC BY 4.0). Attribution: Sleight EC, Esteban O, Grouiller F. fMRIPrep boot camp -- 7T training dataset. OpenNeuro ds005454, version 1.0.0. doi:10.18112/openneuro.ds005454.v1.0.0 The images shown are adapted from it: reoriented to RAS, cropped to the region shown, masked outside it, and shown as the outputs of the programs compared.
- Geometric shape regularity fMRI (OpenNeuro ds006010, version 1.0.1, doi:10.18112/openneuro.ds006010.v1.0.1), CC0 1.0 public-domain dedication.
- MNI152NLin2009cAsym template (TemplateFlow, version tpl-MNI152NLin2009cAsym git 15d7c02160f79f5218d2545b4febebeecc11531d), the MNI ICBM 152 copyright notice.