Evidence · ANTs and ITK

ITK transform files

ANTs and fMRIPrep keep their transforms in ITK’s files: text, MATLAB and HDF5 (.h5), fMRIPrep’s composite .h5 files among them. LARMORX’s port is a replica of ITK 5.4.5’s reading and writing of these files and of the parts of the HDF5 format they use, in pure Rust, with no HDF5 library. Of its record’s 149 cases, 128 agree: the replica reads a file’s datasets as h5py reads them and its transforms as ITK reads them, bit for bit, or writes ITK’s file byte for byte given ITK’s compressed chunks and object times. ITK and the replica refuse 16 files alike; 5 cases are expected divergences. On fMRIPrep’s own composite every dataset reads as the HDF5 library and ITK read it, and ITK reads back the file the replica writes.

Ports
  • replica larmorx Apache-2.0: translated from ITK 5.4.5's transform reading and writing (Apache-2.0) and from the parts of the HDF5 file format they use, as HDF5 1.12.1 (the version ITK bundles, under The HDF Group's BSD-style licence) reads and lays them out; crates larmorx-hdf5 and larmorx-io
Status
replica validated (marked before the statuses' definition)
Records
standard comparison (ITK 5.4.5 on HDF5 1.12.1, h5py, nitransforms) · findings itk-hdf5
Reference
API page transforms-hdf5

What is compared

ANTs and fMRIPrep store transforms in ITK’s formats: affine matrices as text or MATLAB files, displacement fields as NIfTI vector images, and chains of them as HDF5 composites (fMRIPrep’s *_xfm.h5). The replica reads and writes them without the HDF5 C library, so they work on every platform the wheels support.

python
import larmorx as lx

parts = lx.transforms.read("sub-01_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5")
# ITK's class names and parameters:
[(t.name, t.parameters.shape) for t in parts]
lx.transforms.write("copy.h5", parts)

On the command line, every ANTs program takes these files, for example larmorx ants antsApplyTransforms ... -t xfm.h5. How to read what follows: how to read the evidence.

Its port

ITK comes under the Apache-2.0 licence, as LARMORX does, and HDF5 under a permissive BSD-style one, so the replica is in larmorx itself. It is translated from ITK’s transform reading and writing and follows HDF5 1.12.1 step by step, so that it reads every dataset as HDF5 does and writes ITK’s file byte for byte given ITK’s compressed chunks and object times (its own compressed chunks are compared by content). A clean room of ANTs’ and ITK’s code is planned after FreeSurfer (roadmap).

The verdicts at a glance

Agreement, replica against the original: ITK 5.4.5’s transform files, and HDF5 as h5py reads it (standard comparison, 149 cases of the record), by category and verdict
files refused20
HDF5's storage features54
reading: the test data's files4
reading: fMRIPrep 25.2.6's files10
reading: files h5py wrote26
reading: files ITK wrote17
writing18

Select a segment to list its cases below.

The files the replica reads are compared with what h5py reads (every dataset, bit for bit), with what ITK reads (ANTs writes back what it read, in double and in single precision) and with nitransforms’ chain. The files it writes are compared with ITK’s own files, byte for byte given ITK’s compressed chunks and object times, and read back by ITK, h5py and nitransforms. The files ITK refuses are refused alike. The expected divergences are files ITK reads through undefined behaviour or from other files, which the replica refuses, and a composite of 38 transforms laid out differently.

A real file, object by object

fMRIPrep 25.2.6’s T1w-to-MNI152NLin2009cAsym composite of OpenNeuro ds000005 sub-01 (PDDL-1.0): the affine of its template registration and the SyN displacement field, 25.6 million values on the 1 mm template grid. Each table is one of the comparisons the record makes for every file.

Every group and dataset of the file, as the replica reads it, against h5py on the HDF5 C library

ObjectTypeShapeValues (the replica's reading)SHA-256 of the valuesh5py ↔ replica
HDFVersionstring1“HDF5 library version: 1.14.6”2eaa8f202160Bit-identical
ITKVersionstring1“5.4.4”8afaee56f3f3Bit-identical
OSNamestring1“Linux”4828e60247c1Bit-identical
OSVersionstring1“6.8.0-124-generic”8b5d04e6519aBit-identical
TransformGroupgroup–Bit-identical
TransformGroup/0group–Bit-identical
TransformGroup/0/TransformTypestring1“CompositeTransform_float_3_3”c654182c8d6eBit-identical
TransformGroup/1group–Bit-identical
TransformGroup/1/TransformFixedParametersfloat, 8 bytes30.235927805, 21.999485, 9.745201119c41ef3da47cBit-identical
TransformGroup/1/TransformParametersfloat, 4 bytes120.950066507, 0.00142755918, 0.00215913029, … (12 values)35283160b8caBit-identical
TransformGroup/1/TransformTypestring1“AffineTransform_float_3_3”3b0834b44765Bit-identical
TransformGroup/2group–Bit-identical
TransformGroup/2/TransformFixedParametersfloat, 8 bytes18193, 229, 193, … (18 values)b7024eeef84fBit-identical
TransformGroup/2/TransformParametersfloat, 4 bytes255900630, 0, 0, … (25,590,063 values)6e541248c3a7Bit-identical
TransformGroup/2/TransformTypestring1“DisplacementFieldTransform_float_3_3”86573557f210Bit-identical

Floating-point values compared as numbers (each value bit for bit, read through HDF5’s conversion to double), strings byte for byte. The file has no attributes; neither reader finds any. The SHA-256 (first 12 hex digits) is of the values as float64 or of the strings’ bytes, for a reader to check.

The transforms as ITK reads them, against the replica’s reading

As ITK reads the fileparametersfixed parametersparameters that differITK ↔ replica
double: transform 1AffineTransform_double_3_31230Bit-identicalevery parameter and fixed parameter, bit for bit
double: transform 2DisplacementFieldTransform_double_3_325,590,063180Bit-identicalevery parameter and fixed parameter, bit for bit
float: transform 1AffineTransform_float_3_31230Bit-identicalevery parameter and fixed parameter, bit for bit
float: transform 2DisplacementFieldTransform_float_3_325,590,063180Bit-identicalevery parameter and fixed parameter, bit for bit

ITK 5.4.5 (ANTs 2.6.5’s antsApplyTransforms) reads the composite and writes back what it read (-o CompositeTransform[...]), in double and with --float 1, where ITK converts the stored floats to its precision and renames the transforms; the replica reads the file in the same precision. The composite’s own entry (CompositeTransform) is a container without parameters.

The file the replica writes, read back by ITK, and its bytes against ITK’s own file

WhatWhat was comparedResult
ITK reads the replica’s file2 transforms, as ITK reads fMRIPrep’s fileBit-identicalevery parameter, bit for bit
antsApplyTransforms through the replica’s filefMRIPrep’s T1w on the 2 mm MNI grid, linear: 1,082,035 voxelsBit-identicalthe same output image as through fMRIPrep’s file
The replica writes ITK’s own file againITK’s file: 105,141,337 bytes; given ITK’s compressed chunks and object times, the replica’s file isBit-identicalthe same bytes
… with the replica’s own deflate104,598,162 bytes differ: zlib-rs (the replica) and zlib-ng 2.1.6 (ITK’s HDF5) choose other matches, so the compressed chunks, their sizes and the addresses after them differ; the content does notBit-identicalthe same datasets (the comparison by content, decided 2026-10-16)

The replica writes the transforms it read from fMRIPrep’s file (lx.transforms.write). ITK’s own file is the one antsApplyTransforms wrote above; itk_h5_replay rewrites it with the replica’s writer, ITK’s strings and times and, first, ITK’s compressed chunks.

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.

149 cases

CaseCategoryWhat it testsVerdictChecks
errors/h5py/2d-fixedfiles refusedwritten by h5py, refused by ITK: 2d-fixedRejected by both

Description: ITK ERROR: HDF5TransformIOTemplate(0x0): Wrong # of dims for TransformType in HDF5 File

5/5
errors/h5py/2d-parametersfiles refusedwritten by h5py, refused by ITK: 2d-parametersRejected by both

Description: ITK ERROR: HDF5TransformIOTemplate(0x0): Wrong # of dims for TransformType in HDF5 File

5/5
errors/h5py/external-storagefiles refusedwritten by h5py, read by ITK, refused by the replica: parameters in an external raw file (H5Pset_external)Expected divergence

parameters in an external raw file (H5Pset_external): ITK’s HDF5 follows it; the replica refuses the file

5/5
errors/h5py/fixed-stringfiles refusedwritten by h5py, refused by ITK: fixed-stringRejected by both

Description: ITK ERROR: HDF5TransformIOTemplate(0x0): H5Dread failed for variable length string

5/5
errors/h5py/gap-in-namesfiles refusedwritten by h5py, refused by ITK: gap-in-namesRejected by both

Description: ITK ERROR: HDF5TransformIOTemplate(0x0): H5Gopen2 failed

5/5
errors/h5py/int-fixedfiles refusedwritten by h5py, refused by ITK: int-fixedRejected by both

Description: ITK ERROR: HDF5TransformIOTemplate(0x0): Wrong data type for /TransformGroup/1/TransformFixedParametersin HDF5 File

5/5
errors/h5py/int-parametersfiles refusedwritten by h5py, refused by ITK: int-parametersRejected by both

Description: ITK ERROR: HDF5TransformIOTemplate(0x0): Wrong data type for /TransformGroup/1/TransformParametersin HDF5 File

5/5
errors/h5py/lzffiles refusedwritten by h5py, refused by ITK: lzfRejected by both

Description: ITK ERROR: HDF5TransformIOTemplate(0x0): H5Dread failed

5/5
errors/h5py/missing-parametersfiles refusedwritten by h5py, refused by ITK: missing-parametersRejected by both

Description: ITK ERROR: HDF5TransformIOTemplate(0x0): H5Dopen2 failed

5/5
errors/h5py/mixed-dimensionfiles refusedwritten by h5py, refused by ITK: mixed-dimensionExpected divergence

ITK-17: ITK casts the 2-D component to a 3-D transform (undefined behaviour) and antsApplyTransforms exits 0; the replica refuses the file

3/3
errors/h5py/no-precision-in-namefiles refusedwritten by h5py, refused by ITK: no-precision-in-nameRejected by both

basic_string::replace: __pos (which is 18446744073709551615) > this->size() (which is 15)

5/5
errors/h5py/no-transform-groupfiles refusedwritten by h5py, refused by ITK: no-transform-groupRejected by both

failed to read file: /tmp/lx-h5-sdd15ydg/no-transform-group.h5

5/5
errors/h5py/not-hdf5files refusedwritten by h5py, refused by ITK: not-hdf5Rejected by both

set the suffix to an unsupported type.

5/5
errors/h5py/scalar-parametersfiles refusedwritten by h5py, refused by ITK: scalar-parametersRejected by both

Description: ITK ERROR: HDF5TransformIOTemplate(0x0): Wrong # of dims for TransformType in HDF5 File

5/5
errors/h5py/superblock3-chunkedfiles refusedwritten by h5py, refused by ITK: superblock3-chunkedRejected by both

Description: ITK ERROR: HDF5TransformIOTemplate(0x0): H5Dopen2 failed

5/5
errors/h5py/truncatedfiles refusedwritten by h5py, refused by ITK: truncatedRejected by both

set the suffix to an unsupported type.

5/5
errors/h5py/two-stringsfiles refusedwritten by h5py, refused by ITK: two-stringsRejected by both

Description: ITK ERROR: HDF5TransformIOTemplate(0x0): H5Dread failed for variable length string

5/5
errors/h5py/unknown-typefiles refusedwritten by h5py, refused by ITK: unknown-typeRejected by both

“VersorTransform_float_3_3”

5/5
errors/h5py/virtualfiles refusedwritten by h5py, read by ITK, refused by the replica: parameters in a virtual dataset (mapping another dataset of the same file)Expected divergence

parameters in a virtual dataset (mapping another dataset of the same file): ITK’s HDF5 follows it; the replica refuses the file

5/5
hdf5/fixture/sb0HDF5's storage featuresa golden-test fixture (tests/golden/hdf5/sb0.h5.gz)Bit-identical

every dataset as h5py reads it, bit for bit

2/2
hdf5/fixture/sb1HDF5's storage featuresa golden-test fixture (tests/golden/hdf5/sb1.h5.gz)Bit-identical

every dataset as h5py reads it, bit for bit

2/2
hdf5/fixture/sb3-datasetsHDF5's storage featuresa golden-test fixture (tests/golden/hdf5/sb3-datasets.h5.gz)Bit-identical

every dataset as h5py reads it, bit for bit

2/2
hdf5/fixture/sb3-groupsHDF5's storage featuresa golden-test fixture (tests/golden/hdf5/sb3-groups.h5.gz)Bit-identical

every dataset as h5py reads it, bit for bit

2/2
hdf5/fixture/sohmHDF5's storage featuresa golden-test fixture (tests/golden/hdf5/sohm.h5.gz)Bit-identical

every dataset as h5py reads it, bit for bit

4/4
hdf5/group/deflate-directHDF5's storage featuresan HDF5 storage feature written by h5py: group:deflate-directBit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/group/deflate-fletcher32-directHDF5's storage featuresan HDF5 storage feature written by h5py: group:deflate-fletcher32-directBit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/group/deflate-fletcher32-hugeHDF5's storage featuresan HDF5 storage feature written by h5py: group:deflate-fletcher32-hugeBit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/group/deflate-fletcher32-indirectHDF5's storage featuresan HDF5 storage feature written by h5py: group:deflate-fletcher32-indirectBit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/group/deflate-hugeHDF5's storage featuresan HDF5 storage feature written by h5py: group:deflate-hugeBit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/group/deflate-indirectHDF5's storage featuresan HDF5 storage feature written by h5py: group:deflate-indirectBit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/group/order-indirectHDF5's storage featuresan HDF5 storage feature written by h5py: group:order-indirectBit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/group/plain-directHDF5's storage featuresan HDF5 storage feature written by h5py: group:plain-directBit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/group/plain-hugeHDF5's storage featuresan HDF5 storage feature written by h5py: group:plain-hugeBit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/group/plain-indirectHDF5's storage featuresan HDF5 storage feature written by h5py: group:plain-indirectBit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/index/bt2HDF5's storage featuresan HDF5 storage feature written by h5py: index:bt2Bit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/index/bt2-filteredHDF5's storage featuresan HDF5 storage feature written by h5py: index:bt2-filteredBit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/index/earray-2d-swizzledHDF5's storage featuresan HDF5 storage feature written by h5py: index:earray-2d-swizzledBit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/index/earray-3d-swizzledHDF5's storage featuresan HDF5 storage feature written by h5py: index:earray-3d-swizzledBit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/index/earray-dblocksHDF5's storage featuresan HDF5 storage feature written by h5py: index:earray-dblocksBit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/index/earray-filteredHDF5's storage featuresan HDF5 storage feature written by h5py: index:earray-filteredBit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/index/earray-pagedHDF5's storage featuresan HDF5 storage feature written by h5py: index:earray-pagedBit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/index/earray-sblocksHDF5's storage featuresan HDF5 storage feature written by h5py: index:earray-sblocksBit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/index/earray-smallHDF5's storage featuresan HDF5 storage feature written by h5py: index:earray-smallBit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/index/farrayHDF5's storage featuresan HDF5 storage feature written by h5py: index:farrayBit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/index/farray-pagedHDF5's storage featuresan HDF5 storage feature written by h5py: index:farray-pagedBit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/index/farray-paged-filteredHDF5's storage featuresan HDF5 storage feature written by h5py: index:farray-paged-filteredBit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/index/implicitHDF5's storage featuresan HDF5 storage feature written by h5py: index:implicitBit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/index/singleHDF5's storage featuresan HDF5 storage feature written by h5py: index:singleBit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/index/single-filteredHDF5's storage featuresan HDF5 storage feature written by h5py: index:single-filteredBit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/nbit/floatHDF5's storage featuresan HDF5 storage feature written by h5py: nbit:floatBit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/nbit/intHDF5's storage featuresan HDF5 storage feature written by h5py: nbit:intBit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/nbit/int-beHDF5's storage featuresan HDF5 storage feature written by h5py: nbit:int-beBit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/scaleoffset/>f8,3,HDF5's storage featuresan HDF5 storage feature written by h5py: scaleoffset:>f8,3,Bit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/scaleoffset/f4,0,HDF5's storage featuresan HDF5 storage feature written by h5py: scaleoffset:f4,0,Bit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/scaleoffset/f4,2,HDF5's storage featuresan HDF5 storage feature written by h5py: scaleoffset:f4,2,Bit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/scaleoffset/f4,2,-7.5HDF5's storage featuresan HDF5 storage feature written by h5py: scaleoffset:f4,2,-7.5Bit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/scaleoffset/f4,6,HDF5's storage featuresan HDF5 storage feature written by h5py: scaleoffset:f4,6,Bit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/scaleoffset/f8,0,HDF5's storage featuresan HDF5 storage feature written by h5py: scaleoffset:f8,0,Bit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/scaleoffset/f8,2,HDF5's storage featuresan HDF5 storage feature written by h5py: scaleoffset:f8,2,Bit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/scaleoffset/f8,6,HDF5's storage featuresan HDF5 storage feature written by h5py: scaleoffset:f8,6,Bit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/scaleoffset/i1,0,HDF5's storage featuresan HDF5 storage feature written by h5py: scaleoffset:i1,0,Bit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/scaleoffset/i2,0,HDF5's storage featuresan HDF5 storage feature written by h5py: scaleoffset:i2,0,Bit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/scaleoffset/i4,0,HDF5's storage featuresan HDF5 storage feature written by h5py: scaleoffset:i4,0,Bit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/scaleoffset/i4,0,12345HDF5's storage featuresan HDF5 storage feature written by h5py: scaleoffset:i4,0,12345Bit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/scaleoffset/i8,0,HDF5's storage featuresan HDF5 storage feature written by h5py: scaleoffset:i8,0,Bit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/scaleoffset/u1,0,HDF5's storage featuresan HDF5 storage feature written by h5py: scaleoffset:u1,0,Bit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/scaleoffset/u2,0,HDF5's storage featuresan HDF5 storage feature written by h5py: scaleoffset:u2,0,Bit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/scaleoffset/u4,0,HDF5's storage featuresan HDF5 storage feature written by h5py: scaleoffset:u4,0,Bit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/scaleoffset/u8,0,HDF5's storage featuresan HDF5 storage feature written by h5py: scaleoffset:u8,0,Bit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/sohm/btreeHDF5's storage featuresan HDF5 storage feature written by h5py: sohm:btreeBit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/sohm/one-listHDF5's storage featuresan HDF5 storage feature written by h5py: sohm:one-listBit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/sohm/superblock2HDF5's storage featuresan HDF5 storage feature written by h5py: sohm:superblock2Bit-identical

every dataset as h5py reads it, bit for bit

1/1
hdf5/sohm/two-listsHDF5's storage featuresan HDF5 storage feature written by h5py: sohm:two-listsBit-identical

every dataset as h5py reads it, bit for bit

1/1
read/catalog/openneuro-derivatives/ds000005-fmriprep/sub-01/anat/sub-01_from-MNI152NLin2009cAsym_to-T1w_mode-image_xfm.h5reading: the test data's filesInverse composite transform MNI152NLin2009cAsym -> T1w (HDF5), used to bring template masks/priors into T1w space.Bit-identical

every dataset as h5py reads it, bit for bit

5/5
read/catalog/openneuro-derivatives/ds000005-fmriprep/sub-01/anat/sub-01_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5reading: the test data's filesANTs composite transform (HDF5: affine + SyN displacement field) T1w -> MNI152NLin2009cAsym, as written by antsRegistration: input for reading ITK/ANTs .h5 transforms and for applying normalisation to BOLD.Bit-identical

every dataset as h5py reads it, bit for bit

5/5
read/catalog/synthetic/resampling/transforms/composite-affine-warp.h5reading: the test data's filesITK HDF5 composite, as antsApplyTransforms -o CompositeTransform[...] writes it from -t warp-lps-vector.nii.gz -t affine-centered.mat (queue: affine, then field).Bit-identical

every dataset as h5py reads it, bit for bit

5/5
read/catalog/synthetic/series-resampling/transforms/anat2std-composite.h5reading: the test data's filesAnatomical-to-standard ITK composite in ITK's HDF5 layout: an AffineTransform_double_3_3 (with a centre) then a DisplacementFieldTransform_float_3_3 on a 2 mm grid of 34 × 40 × 30 (smooth displacements up to about 3 mm, LPS), the queue fMRIPrep's *_xfm.h5 files have.Bit-identical

every dataset as h5py reads it, bit for bit

5/5
read/fmriprep-25.2.6/ds000005-sub-01-noreconall/sub-01_from-MNI152NLin2009cAsym_to-T1w_mode-image_xfm.h5reading: fMRIPrep 25.2.6's filesfound: sub-01_from-MNI152NLin2009cAsym_to-T1w_mode-image_xfm.h5Bit-identical

every dataset as h5py reads it, bit for bit

5/5
read/fmriprep-25.2.6/ds000005-sub-01-noreconall/sub-01_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5reading: fMRIPrep 25.2.6's filesfound: sub-01_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5Bit-identical

every dataset as h5py reads it, bit for bit

5/5
read/fmriprep-25.2.6/ds001600-sub-1-noreconall/sub-1_from-MNI152NLin2009cAsym_to-T1w_mode-image_xfm.h5reading: fMRIPrep 25.2.6's filesfound: sub-1_from-MNI152NLin2009cAsym_to-T1w_mode-image_xfm.h5Bit-identical

every dataset as h5py reads it, bit for bit

5/5
read/fmriprep-25.2.6/ds001600-sub-1-noreconall/sub-1_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5reading: fMRIPrep 25.2.6's filesfound: sub-1_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5Bit-identical

every dataset as h5py reads it, bit for bit

5/5
read/fmriprep-25.2.6/ds005040-sub-002-noreconall/sub-002_from-MNI152NLin2009cAsym_to-T1w_mode-image_xfm.h5reading: fMRIPrep 25.2.6's filesfound: sub-002_from-MNI152NLin2009cAsym_to-T1w_mode-image_xfm.h5Bit-identical

every dataset as h5py reads it, bit for bit

5/5
read/fmriprep-25.2.6/ds005040-sub-002-noreconall/sub-002_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5reading: fMRIPrep 25.2.6's filesfound: sub-002_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5Bit-identical

every dataset as h5py reads it, bit for bit

5/5
read/fmriprep-25.2.6/ds005454-sub-16-noreconall/sub-16_from-MNI152NLin2009cAsym_to-T1w_mode-image_xfm.h5reading: fMRIPrep 25.2.6's filesfound: sub-16_from-MNI152NLin2009cAsym_to-T1w_mode-image_xfm.h5Bit-identical

every dataset as h5py reads it, bit for bit

5/5
read/fmriprep-25.2.6/ds005454-sub-16-noreconall/sub-16_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5reading: fMRIPrep 25.2.6's filesfound: sub-16_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5Bit-identical

every dataset as h5py reads it, bit for bit

5/5
read/fmriprep-25.2.6/ds005752-sub-ON01016-noreconall/sub-ON01016_ses-01_acq-FSPGR_rec-SCIC_from-MNI152NLin2009cAsym_to-T1w_mode-image_xfm.h5reading: fMRIPrep 25.2.6's filesfound: sub-ON01016_ses-01_acq-FSPGR_rec-SCIC_from-MNI152NLin2009cAsym_to-T1w_mode-image_xfm.h5Bit-identical

every dataset as h5py reads it, bit for bit

5/5
read/fmriprep-25.2.6/ds005752-sub-ON01016-noreconall/sub-ON01016_ses-01_acq-FSPGR_rec-SCIC_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5reading: fMRIPrep 25.2.6's filesfound: sub-ON01016_ses-01_acq-FSPGR_rec-SCIC_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5Bit-identical

every dataset as h5py reads it, bit for bit

5/5
read/h5py/big-endian-f4reading: files h5py wrotewritten by h5py: big-endian-f4Bit-identical

every dataset as h5py reads it, bit for bit

5/5
read/h5py/big-endian-f8reading: files h5py wrotewritten by h5py: big-endian-f8Bit-identical

every dataset as h5py reads it, bit for bit

5/5
read/h5py/compactreading: files h5py wrotewritten by h5py: compactBit-identical

every dataset as h5py reads it, bit for bit

5/5
read/h5py/compositereading: files h5py wrotewritten by h5py: compositeBit-identical

every dataset as h5py reads it, bit for bit

5/5
read/h5py/composite-secondreading: files h5py wrotewritten by h5py: composite-secondBit-identical

every dataset as h5py reads it, bit for bit

7/7
read/h5py/dense-11reading: files h5py wrotewritten by h5py: dense-11Bit-identical

every dataset as h5py reads it, bit for bit

5/5
read/h5py/dense-11-superblock3reading: files h5py wrotewritten by h5py: dense-11-superblock3Bit-identical

every dataset as h5py reads it, bit for bit

5/5
read/h5py/earrayreading: files h5py wrotewritten by h5py: earrayBit-identical

every dataset as h5py reads it, bit for bit

5/5
read/h5py/empty-compositereading: files h5py wrotewritten by h5py: empty-compositeBit-identical

every dataset as h5py reads it, bit for bit

5/5
read/h5py/farrayreading: files h5py wrotewritten by h5py: farrayBit-identical

every dataset as h5py reads it, bit for bit

5/5
read/h5py/farray-pagedreading: files h5py wrotewritten by h5py: farray-pagedBit-identical

every dataset as h5py reads it, bit for bit

5/5
read/h5py/float32reading: files h5py wrotewritten by h5py: float32Bit-identical

every dataset as h5py reads it, bit for bit

5/5
read/h5py/halfreading: files h5py wrotewritten by h5py: halfBit-identical

every dataset as h5py reads it, bit for bit

5/5
read/h5py/implicitreading: files h5py wrotewritten by h5py: implicitBit-identical

every dataset as h5py reads it, bit for bit

5/5
read/h5py/long-doublereading: files h5py wrotewritten by h5py: long-doubleBit-identical

every dataset as h5py reads it, bit for bit

5/5
read/h5py/misspelt-itk4reading: files h5py wrotewritten by h5py: misspelt-itk4Bit-identical

every dataset as h5py reads it, bit for bit

5/5
read/h5py/nbitreading: files h5py wrotewritten by h5py: nbitBit-identical

every dataset as h5py reads it, bit for bit

5/5
read/h5py/no-version-stringsreading: files h5py wrotewritten by h5py: no-version-stringsBit-identical

every dataset as h5py reads it, bit for bit

5/5
read/h5py/scalar-typereading: files h5py wrotewritten by h5py: scalar-typeBit-identical

every dataset as h5py reads it, bit for bit

5/5
read/h5py/scaleoffsetreading: files h5py wrotewritten by h5py: scaleoffsetBit-identical

every dataset as h5py reads it, bit for bit

5/5
read/h5py/shuffle-fletcher32reading: files h5py wrotewritten by h5py: shuffle-fletcher32Bit-identical

every dataset as h5py reads it, bit for bit

5/5
read/h5py/singlereading: files h5py wrotewritten by h5py: singleBit-identical

every dataset as h5py reads it, bit for bit

5/5
read/h5py/single-chunkreading: files h5py wrotewritten by h5py: single-chunkBit-identical

every dataset as h5py reads it, bit for bit

5/5
read/h5py/superblock3reading: files h5py wrotewritten by h5py: superblock3Bit-identical

every dataset as h5py reads it, bit for bit

5/5
read/h5py/two-linearreading: files h5py wrotewritten by h5py: two-linearBit-identical

every dataset as h5py reads it, bit for bit

5/5
read/h5py/utf8-stringsreading: files h5py wrotewritten by h5py: utf8-stringsBit-identical

every dataset as h5py reads it, bit for bit

5/5
read/itk/assemblereading: files ITK wrotewritten by ITK: CompositeTransformUtil --assemble (itk::ants::WriteTransform)Bit-identical

every dataset as h5py reads it, bit for bit

5/5
read/itk/assemble-field-firstreading: files ITK wrotewritten by ITK: CompositeTransformUtil --assemble: a field, then two linear transforms (objects allocated after the compressed chunk)Bit-identical

every dataset as h5py reads it, bit for bit

5/5
read/itk/composite-11-affinesreading: files ITK wrotewritten by ITK: -o CompositeTransform[...] of 11 affines: 12 links (dense: a fractal heap and a v2 B-tree)Bit-identical

every dataset as h5py reads it, bit for bit

5/5
read/itk/composite-37-affinesreading: files ITK wrotewritten by ITK: -o CompositeTransform[...] of 37 affines: 38 links (dense: a fractal heap and a v2 B-tree)Bit-identical

every dataset as h5py reads it, bit for bit

5/5
read/itk/composite-38-affinesreading: files ITK wrotewritten by ITK: -o CompositeTransform[...] of 38 affines: 39 links (dense: a fractal heap and a v2 B-tree)Bit-identical

every dataset as h5py reads it, bit for bit

5/5
read/itk/composite-8-affinesreading: files ITK wrotewritten by ITK: -o CompositeTransform[...] of 8 affines: 9 links (dense: a fractal heap and a v2 B-tree)Bit-identical

every dataset as h5py reads it, bit for bit

5/5
read/itk/composite-9-affinesreading: files ITK wrotewritten by ITK: -o CompositeTransform[...] of 9 affines: 10 links (dense: a fractal heap and a v2 B-tree)Bit-identical

every dataset as h5py reads it, bit for bit

5/5
read/itk/composite-affinereading: files ITK wrotewritten by ITK: -o CompositeTransform[...]: one affineBit-identical

every dataset as h5py reads it, bit for bit

5/5
read/itk/composite-floatreading: files ITK wrotewritten by ITK: --float 1 -o CompositeTransform[...]: float parametersBit-identical

every dataset as h5py reads it, bit for bit

5/5
read/itk/composite-identityreading: files ITK wrotewritten by ITK: -o CompositeTransform[...] -t identityBit-identical

every dataset as h5py reads it, bit for bit

5/5
read/itk/composite-typesreading: files ITK wrotewritten by ITK: -o CompositeTransform[...]: six transform types (seven links, compact)Bit-identical

every dataset as h5py reads it, bit for bit

5/5
read/itk/composite-warp-affinereading: files ITK wrotewritten by ITK: -o CompositeTransform[...]: a displacement field and an affine (chunk of 190 KB)Bit-identical

every dataset as h5py reads it, bit for bit

5/5
read/itk/displacement-fieldreading: files ITK wrotewritten by ITK: -o DisplacementField[...]: a collapsed field on the reference gridBit-identical

every dataset as h5py reads it, bit for bit

5/5
read/itk/fmriprep-rewrittenreading: files ITK wrotewritten by ITK: fMRIPrep's T1w→MNI composite rewritten by ITK 5.4.5: a field of several 1 Mi-value chunksBit-identical

every dataset as h5py reads it, bit for bit

5/5
read/itk/linearreading: files ITK wrotewritten by ITK: -o Linear[...]: two transforms collapsed into one affineBit-identical

every dataset as h5py reads it, bit for bit

5/5
read/itk/linear-floatreading: files ITK wrotewritten by ITK: --float 1 -o Linear[...]: float parametersBit-identical

every dataset as h5py reads it, bit for bit

5/5
read/itk/linear-inversereading: files ITK wrotewritten by ITK: -o Linear[...,1]: the inverseBit-identical

every dataset as h5py reads it, bit for bit

5/5
write/assemblewritingCompositeTransformUtil --assemble (itk::ants::WriteTransform)Bit-identical

byte for byte given ITK’s compressed chunks and object times; with the replica’s own deflate: 78899 bytes differ; ITK, h5py and nitransforms read the replica’s file as ITK’s

7/7
write/assemble-field-firstwritingCompositeTransformUtil --assemble: a field, then two linear transforms (objects allocated after the compressed chunk)Bit-identical

byte for byte given ITK’s compressed chunks and object times; with the replica’s own deflate: 79355 bytes differ; ITK, h5py and nitransforms read the replica’s file as ITK’s

7/7
write/composite-11-affineswriting-o CompositeTransform[...] of 11 affines: 12 links (dense: a fractal heap and a v2 B-tree)Bit-identical

byte for byte given ITK’s compressed chunks and object times; with the replica’s own deflate: identical; ITK, h5py and nitransforms read the replica’s file as ITK’s

6/6
write/composite-37-affineswriting-o CompositeTransform[...] of 37 affines: 38 links (dense: a fractal heap and a v2 B-tree)Bit-identical

byte for byte given ITK’s compressed chunks and object times; with the replica’s own deflate: identical; ITK, h5py and nitransforms read the replica’s file as ITK’s

6/6
write/composite-38-affineswriting-o CompositeTransform[...] of 38 affines: 39 links (dense: a fractal heap and a v2 B-tree)Expected divergence

39 links do not fit the first block of TransformGroup’s fractal heap: HDF5 adds an indirect block, which the replica’s writer does not cover; the replica keeps the links as link messages (a group info storing 39 compact links), a layout HDF5 itself writes for such a …

6/6
write/composite-8-affineswriting-o CompositeTransform[...] of 8 affines: 9 links (dense: a fractal heap and a v2 B-tree)Bit-identical

byte for byte given ITK’s compressed chunks and object times; with the replica’s own deflate: identical; ITK, h5py and nitransforms read the replica’s file as ITK’s

6/6
write/composite-9-affineswriting-o CompositeTransform[...] of 9 affines: 10 links (dense: a fractal heap and a v2 B-tree)Bit-identical

byte for byte given ITK’s compressed chunks and object times; with the replica’s own deflate: identical; ITK, h5py and nitransforms read the replica’s file as ITK’s

6/6
write/composite-affinewriting-o CompositeTransform[...]: one affineBit-identical

byte for byte given ITK’s compressed chunks and object times; with the replica’s own deflate: identical; ITK, h5py and nitransforms read the replica’s file as ITK’s

7/7
write/composite-floatwriting--float 1 -o CompositeTransform[...]: float parametersBit-identical

byte for byte given ITK’s compressed chunks and object times; with the replica’s own deflate: identical; ITK, h5py and nitransforms read the replica’s file as ITK’s

6/6
write/composite-identitywriting-o CompositeTransform[...] -t identityBit-identical

byte for byte given ITK’s compressed chunks and object times; with the replica’s own deflate: identical; ITK, h5py and nitransforms read the replica’s file as ITK’s

6/6
write/composite-typeswriting-o CompositeTransform[...]: six transform types (seven links, compact)Bit-identical

byte for byte given ITK’s compressed chunks and object times; with the replica’s own deflate: identical; ITK, h5py and nitransforms read the replica’s file as ITK’s

7/7
write/composite-warp-affinewriting-o CompositeTransform[...]: a displacement field and an affine (chunk of 190 KB)Bit-identical

byte for byte given ITK’s compressed chunks and object times; with the replica’s own deflate: 78899 bytes differ; ITK, h5py and nitransforms read the replica’s file as ITK’s

7/7
write/displacement-fieldwriting-o DisplacementField[...]: a collapsed field on the reference gridBit-identical

byte for byte given ITK’s compressed chunks and object times; with the replica’s own deflate: identical; ITK, h5py and nitransforms read the replica’s file as ITK’s

6/6
write/fmriprep-rewrittenwritingfMRIPrep's T1w→MNI composite rewritten by ITK 5.4.5: a field of several 1 Mi-value chunksBit-identical

byte for byte given ITK’s compressed chunks and object times; with the replica’s own deflate: 104442002 bytes differ; ITK, h5py and nitransforms read the replica’s file as ITK’s

6/6
write/itk15-identity-compressedwritingCompositeTransformUtil --assemble with an IdentityTransform: ITK fails (ITK-15) and leaves a partial fileBit-identical

ITK fails (ITK-15) and leaves a partial file; the replica in reproduce fails alike and leaves the same file, byte for byte; in fix, its default, it stores the empty parameters, a file ANTs reads

7/7
write/linearwriting-o Linear[...]: two transforms collapsed into one affineBit-identical

byte for byte given ITK’s compressed chunks and object times; with the replica’s own deflate: identical; ITK, h5py and nitransforms read the replica’s file as ITK’s

6/6
write/linear-floatwriting--float 1 -o Linear[...]: float parametersBit-identical

byte for byte given ITK’s compressed chunks and object times; with the replica’s own deflate: identical; ITK, h5py and nitransforms read the replica’s file as ITK’s

6/6
write/linear-inversewriting-o Linear[...,1]: the inverseBit-identical

byte for byte given ITK’s compressed chunks and object times; with the replica’s own deflate: identical; ITK, h5py and nitransforms read the replica’s file as ITK’s

6/6

Speed

No benchmark report yet: reading HDF5 against h5py and ANTs is among the planned benchmarks (next steps).

Corrections by default

Where ITK, HDF5 or nitransforms has a deterministic defect that changes a result, the replica corrects it by default, fix, and warns. upstream_defects="reproduce" (on the command line --upstream-defects reproduce from the next release, LARMORX_UPSTREAM_DEFECTS=reproduce in 0.1.0rc1) gives their behaviour, and the record compares with it. In reading: a TransformType stored as a fixed-length string, as h5py writes it, is read (ITK-12); a parameter dataset of the wrong class or rank is named in the message (ITK-13); parameters wider than 8 bytes (long double, quadruple) are read in the reader’s precision, not through float (ITK-14); non-native floats are converted element by element, without the state HDF5 1.12 carries from one to the next (HDF-01); a composite’s transforms are read in numeric order, 2 before 10 (PIPE-04), and a file’s first group is read when it is not a composite (PIPE-17). In writing: a transform without parameters has its empty parameters stored uncompressed, where ITK fails and leaves a file it cannot read (ITK-15). ITK-16 (a null TransformType string, which crashes ITK) and ITK-17 are refused either way. The API page has the table and the register every entry. fMRIPrep’s composites meet none of them; PIPE-04 would from eleven transforms on.

Random testing

Random testing writes random transform files and reads them through ITK, as ANTs’ programs do (an ANTs program writes back what it read, in double and in single precision), and through the replica, h5py and nitransforms, in long runs of several hours. The files come from seeded plain arithmetic: text and MATLAB files holding one to four transforms of every linear type ITK reads (in double and float, 2-D and 3-D) and composites, their numbers spelt in many ways, and HDF5 files from the replica’s writer, with and without compression, that also hold displacement fields (how random testing works). A difference is shrunk to the smallest file that still shows it, then fixed and kept as a comparison case, registered as a defect of the original, or reported. The latest long run:

Random testing, the replica against the original: ITK 5.4.5’s transform files, 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
ITK transform filesreplica2,2600212,244···16···
  • fixed in LARMORX ITK transform files (replica), 16 case(s): ITK's float reading (--float N): ANTs cannot write the transforms back; antsApplyTransforms agrees, ITK's reading: ANTs cannot write the transforms back; antsApplyTransforms agrees: QuaternionRigidTransform, ScaleVersor3DTransform, ScaleSkewVersor3DTransform and ScaleTransform: LARMORX read them but its antsApplyTransforms could not evaluate them (exit 1, ANTs 0); now evaluated as ITK computes them (vnl’s rotation matrix of the conjugate quaternion; the versor’s matrix with scale - 1 and the skews added; ScaleTransform’s own (p - c)·s + c) (larmorx_transform::linear)

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 expected divergences: data stored in other files (external raw files, external links, virtual datasets), which ITK’s HDF5 follows, are refused; a 2-D component in a 3-D composite is refused (ITK-17, an undefined cast in ITK); a composite of 38 or more transforms is written with its links laid out compactly. Compressed chunks are compared by content, not bytes, by design.

History

  • 2026-10-16: compressed chunks compared by content, not bytes, decided (the written files’ table and the writing cases say so).
  • 2026-10-21: the standard comparison made (its Generated line).

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.