Repository navigation
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.