Repository navigation
Releases
Sample data for the browser demo
Sample images for the FastWarp browser demo (not a software release).
sample-t1w-defaced.nii.gz: T1-weighted MPRAGE, 1 mm, of an adult volunteer who agreed to its public use. Header reduced to geometry only; face, eyes and ears removed (all voxels more than 10 mm outside the brain set to zero). Licence: CC0-1.0.mni152nlin2009basym-head-1mm.nii.gz: MNI ICBM 2009b nonlinear asymmetric T1w template (every second voxel of the 0.5 mm original), cut the same way. Copyright (C) 1993-2004 Louis Collins, McConnell Brain Imaging Centre, Montreal Neurological Institute, McGill University. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies. The authors and McGill University make no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.
Checksums in SHA256SUMS.
v0.2.0
0.2.0 (2026-11-15)
-
ANTs compatibility mode:
fastwarp ants-registration ARGS...and
fastwarp ants-apply-transforms ARGS...take the arguments ofantsRegistrationand
antsApplyTransforms(ANTs 2.6.5), run the subset FastWarp supports and write the files ANTs
writes under ANTs' names:0GenericAffine.mat,1Warp.nii.gz,1InverseWarp.nii.gz(or
0Warp.nii.gzfor SyN without-r),Composite.h5/InverseComposite.h5alone with-a 1,
and the warped and inverse-warped images of-o [prefix,warped,inverseWarped]on the native
grids. Supported: any Rigid / Affine stages with Mattes MI (regular sampling, 32 bins), then
at most one SyN stage with one or two CC metrics;-r [f,m,1],Identityor an affine file;
fixed masks on linear stages;-w;--random-seedandANTS_RANDOM_SEED; both stage-option
orders and brackets split over shell words. Warped images and fields arefloat64, or
float32with--float 1, as in ANTs. Everything that would change the result and is not
supported (MI in SyN, dense or random MI sampling,-z 0, histogram matching, SyN masks,
moving masks, other transforms, metrics and interpolators, ...) is refused with exit status 2
and the reason, before the GPU is opened;ants-apply-transformsaccepts-z,--time-index
and-uwith a transform output, which change nothing, with a warning.
The compatibility mode is reached only through these subcommands, never by the program's name.
The registration grid is the fixed image's smallest spacing; with an anisotropic fixed image the
warp fields are resampled onto the fixed image's grid, where ANTs writes them, so the result
differs a little more from ANTs' there (about 1 mm at the corners of the field of view in the
tests, against 0.06 to 0.5 mm for an isotropic one). Stage options are assigned to stages as
ANTs assigns them. Integer-uoutputs ofants-apply-transformswrap as in ANTs. The parsers
are pure functions (fastwarp_cli::ants::parse_registration/parse_apply, and
resolve_seedfor--random-seed/ANTS_RANDOM_SEED) that return the plan, its recipe and
its output files; the Python layerfastwarp.antsruns them through the same code. See
docs/cli.md. -
Linear stages skip a level whose sample points leave Mattes mutual information undefined
(no point on the fixed image, or one fixed value only; typical for a coarse level of a small
image or a small mask) and continue with the finer levels, with a warning: on standard error
in the command line (register,linear,ants-registration), and as aUserWarningin
Python, also listed under"warnings"in the results ofregister_synand
LinearSession.register(the result offastwarp.ants.registrationkeeps ANTsPy's keys).
ANTs 2.6.5 drops the whole stage in that case without an error.
When every level of a stage is skipped, the run fails and the message names the levels, their
shrink factors, the candidate counts and the remedies. -
fastwarp.ants: ANTsPy'sants.registrationandants.apply_transforms(ANTsPy 0.6.3) with
their arguments and results, for the part FastWarp supports. Each call builds the argument list
ANTsPy builds (compared token for token in the tests) and runs it with the ANTs compatibility
mode, the same code asfastwarp ants-registration/ants-apply-transforms, with the
ANTsImages handed over in memory. RunsRigid,Affine,AffineFast,BOLDAffine,
QuickRigid,DenseRigid,BOLDRigid,SyNCC,SyNabp,antsRegistrationSyN[r|a|s|sr|so],
antsRegistrationSyNQuick[r|a], andSyN,SyNRA,SyNOnly,SyNAggro,SyNLessAggro,
ElasticSyN,SyNBold,SyNBoldAffwithsyn_metric="CC". ANTsPy's default"SyN"(Mattes
mutual information in SyN), Translation, Similarity, BSplineSyN, GC, time-varying and other
unsupported arguments (SyN masks, moving masks, histogram matching, other interpolators, ...)
raisefastwarp.ants.UnsupportedArgument(aValueError) before any work; arguments ANTsPy
ignores for a type are ignored with aUserWarning; unknown keyword arguments raise
TypeError. The result dict has ANTsPy's keys, warped images on the native grids with the
fixed image's pixel type, and the transform lists in ANTsPy's order. Keyword-only additions:
iso_mm(default: the fixed image's smallest spacing),adapter,canceland
fallback="ants", which runs ANTsPy instead after a refusal, without a GPU or when the
registration does not fit, with a warning and an"engine"key in the result. A raw argument
list,registration([...], None), runs as the subcommand does.outprefix=""makes a private
temporary folder instead of ANTsPy'stempfile.mktempname. ANTsPy is needed at call time
only. Seedocs/guide/ants.md. -
Stage lists:
register_syn(recipe={"initial": ..., "stages": [...]})runs any number of
Rigid / Affine stages followed by at most one SyN stage (SyN alone is allowed), from the centres
of mass ("com", the default), the identity ("identity"), one affine from a.mat/.txt
file (optionally inverted) or given parameters. Without a SyN stage the composites hold only the
affine, as ANTs writes them. The capacity check (inregister_syn,fits_gpu(recipe=...)and
fastwarp fits --recipe) covers every stage: a linear-only chain is checked against the memory
its sample buffers need, not the SyN stage's, and a chain with both is refused when the larger
of the two phases does not fit. A relative path of the start file is read from the current
folder in Python and from the recipe file's folder infastwarp register --recipe.Nonefor
initialorstagesmeans the default. The existing recipe form keeps working and gives
bit-identical outputs. The result dict addsinitial_parameters,initial_center,
linear_stages,deformableandfiles. -
The recipe key
"winsorize":[lower, upper]quantiles (default[0.005, 0.995], as before) or
Nonefor ANTs' plain rescale to [0, 1], whatantsRegistration(and every ANTsPy call) does
without--winsorize-image-intensities.LinearSession(winsorize=None)is unchanged: it uses
the intensities without any rescale;winsorize=(0.0, 1.0)is ANTs' default preprocessing. -
register_syn(outputs="split" | "both")(fastwarp register --outputs) writes ANTs'
non-composite files0GenericAffine.mat,1Warp.nii.gz,1InverseWarp.nii.gz; the fields are
float32(ANTs writesfloat64). -
apply_transforms(..., invert=[...])andcompose_field(..., invert=[...]), ANTsPy's
whichtoinvert(one flag per transform), andfastwarp apply/compose -t [file,1], as
antsApplyTransforms -t [file,1]: a linear transform is replaced by its inverse in place.
Inverting a displacement field raisesValueError(exit status 2) instead of ANTs' silent exit 1.
fastwarp apply/composeandcompose_fieldread and check the transforms before they load
an image or create the output folder. -
A command line,
fastwarp(alsopython -m fastwarp), for NIfTI files:register
(register_syn),linear(one rigid or affine fit),apply(apply_transforms),compose
(compose_field),recipe(the default recipe as JSON),gpu-info,fitsandbench(timings
on built-in synthetic volumes or on your images, with a description of the machine). Images are
read as ITK and ANTsPy read them. Distinct exit status for invalid arguments (2), file errors (3),
no usable GPU (4) and a grid too large for the GPU (5);--jsonfor machine-readable output.
An internal error prints one line and exits with status 1; Rust's panic message is shown only
whenRUST_BACKTRACEis set to a value other than 0.registerandlinearread their input images before they create
the output folder. Seedocs/cli.md. The Python extension and the standalone program built from the new crate
fastwarp-clirun the same code. -
Each GitHub release carries the standalone
fastwarpprogram, which needs no Python, for Linux
x86_64 and aarch64 (glibc 2.28 or later), macOS arm64 and x86_64 (macOS 11 or later) and Windows
x86_64 (static C runtime), asfastwarp-<target>.tar.gz/.zipwith a.sha256file each,
and the installer scriptsfastwarp-installer.sh(Linux, macOS) andfastwarp-installer.ps1
(Windows). The installer of a release installs that release and holds the SHA-256 of its
archives, so it refuses a download that does not match. It installs without administrator
rights into~/.local/bin(Windows:%LOCALAPPDATA%\Programs\fastwarp\bin), adds that folder
to PATH unless told not to (--no-modify-path,-NoModifyPath), and records what it did in a
receipt next to the program;--uninstall(-Uninstall) undoes exactly that and leaves alone a
fastwarpit did not install. Every release file has a GitHub build provenance attestation
(gh attestation verify). Seedocs/cli.md. -
fits_gputakes the moving image(s) as an optional second argument and checks the moving grid
asregister_syndoes; without it a moving image larger than the fixed one could pass
fits_gpuand still raiseGpuCapacityError.channelsdefaults to the number of fixed
images, and invalid arguments (image counts,channelsother than 1 or 2,iso_mm) raise
ValueErroras inregister_syninstead of returning a result. -
The benchmark (
benchmarks/accuracy) now also measures speed in the same run, on the same
public data: every registration records its Linear, SyN and total time for FastWarp and for
ANTs (read fromantsRegistration --verbose 1);lineartimeslinear_sessionfits
(rigid, affine, a rigid multi-start) againstantsRegistrationwith the same stages, with
their landmark errors;posttimescompose_fieldandapply_transformsagainst
antsApplyTransformson uncompressed outputs (--gzipadds.nii.gz).reporttabulates
the media...
v0.1.0
0.1.0 (2026-11-12)
First public release.
register_syn: ANTs-style registration on the GPU (centre of mass, Rigid, Affine, SyN) of one
image pair, or of two channels such as T1w + T2w, onto a fixed image. It writes ANTs
Composite.h5,InverseComposite.h5and0GenericAffine.mat, whichantsApplyTransforms
reads. The schedule is the built-in recipe (cohort_recipe(channels)) or one the caller passes
asrecipe=; the result reports the recipe that ran and the time of each phase. Images are
ANTsPy images or(array, spacing, origin, direction)tuples in ITK (LPS) geometry, so ANTsPy
is optional; the registration runs on an isotropic grid ofiso_mm(default 1 mm), whose size
iso_grid_dimsreports.linear_session/LinearSession: rigid or affine fits on Mattes mutual information from any
start, with an optional fixed-image mask and winsorizing. A session uploads the image pair once
and keeps its smoothed copies between fits, so a multi-start search costs little more than one
fit.register_rigidis a one-off rigid fit;rigid_session/RigidSessionare aliases of
linear_session/LinearSession.compose_fieldandapply_transforms: write a list of ANTs transform files (.h5,.mat,
.txt, displacement fields) as one displacement field (antsApplyTransforms --compose;
compression_level=0writes stored gzip, which ANTs reads back quickly), and resample images
with the linear, nearest or Lanczos windowed-sinc interpolator, in parallel on the CPU.- GPU checks before any work:
gpu_available,gpu_info,fits_gpu, and a capacity check that
raisesGpuCapacityErrorwhen a registration would not fit the GPU's memory budget
(FASTWARP_GPU_MEMORY_BUDGET_MBoverrides it). Failures raiseGpuUnavailableError,
GpuCapacityErrororRegistrationError(allRuntimeError), an internal panic included, so
a caller can fall back to ANTs; a cancelled run raisesRegistrationCancelled; invalid
arguments raiseValueErrorbefore any work. CancelTokencancels a running registration from another thread; the GIL is released while
the engine runs.- Runs on Vulkan, Metal and DirectX 12 through wgpu;
FASTWARP_GPU_BACKENDand
FASTWARP_GPU_ADAPTERchoose the API and the device. A hardware GPU is required: software
adapters (lavapipe, WARP) are refused unlessFASTWARP_GPU_ALLOW_SOFTWARE=1. The README lists
every environment variable. - The HDF5 transform reader rejects malformed or crafted files with an error instead of
exhausting memory or aborting the process. - Wheels for Linux (x86_64, aarch64; manylinux 2.28), macOS (arm64, x86_64) and Windows
(x86_64): oneabi3wheel per platform for Python 3.11 and later, with NumPy 2.0 or later. - Apache-2.0; parts are ports of ITK and ANTs, and the sample-point generator derives from
BSD-3-Clause Mersenne Twister code; all are listed inNOTICEanddocs/THIRD_PARTY_PORTS.md. - The engine was developed inside Wyss DBS Localizer under the name
dbsloc-gpureg, which was
never published. Code written against it importsfastwarpinstead, with the same Python API,
on Python 3.11 or later and NumPy 2.0 or later. The formerDBSLOC_*environment variables are
still read when theFASTWARP_*name is unset (aFASTWARP_*name set to an empty value
wins).ENGINE_SOURCE("fastwarp-legacy 90c1df3") names the revision of that earlier
standalone copy of the engine, not a revision of this repository.