CLAIRE¶
Constrained Large Deformation Diffeomorphic Image Registration: registration of 3D images on one or several GPUs
CLAIRE computes a smooth, invertible deformation that maps a template image onto a reference image. The deformation is defined by a velocity field, which CLAIRE finds by solving a PDE-constrained optimization problem with a Gauss-Newton-Krylov method. CLAIRE runs on one or several GPUs (CUDA and MPI) and scales to large images on many GPUs.
Features¶
-
Diffeomorphic
Smooth, invertible deformations, defined by a velocity field. The transport equations are solved with a semi-Lagrangian method.
-
Gauss-Newton-Krylov solver
Preconditioning, continuation in the regularization parameter, and scale continuation.
-
One or many GPUs
CUDA and MPI: the same program runs on one GPU and scales to large images on many GPUs.
-
Automatic regularization
--beta-searchchooses the regularization parameter from a bound on the determinant of the deformation gradient. -
Images and models
H1, H2 or H3 (semi)norms of the velocity, a penalty on div(v), squared L2 distance or NCC. Multi-component images, masks and probability maps in NIfTI format.
-
Tools and Python
claire-toolscomputes deformation fields and det(grad(y)), transports images and label maps, and computes Ravens maps. Python bindings:pyclaire.
Quick start¶
You need an NVIDIA GPU with CUDA, an MPI library with C/C++ compilers (e.g., OpenMPI with GCC), CMake and make. deps/makefile builds PETSc and the NIfTI library.
git clone https://github.com/andreasmang/claire.git
cd claire
cd deps && make GPU_VERSION=80 && source env_source.sh && cd .. # PETSc, NIfTI (20 to 40 minutes)
make -j 8 GPU_VERSION=80 # bin/claire, bin/claire-tools
GPU_VERSION is the compute capability of your GPU without the dot, for example 70 for V100, 80 for A100, 89 for L40S and 90 for H100. Run source deps/env_source.sh in every new shell. More in the installation guide.
Register a synthetic problem, then two brain images, and compute the determinant of the deformation gradient from the computed velocity:
./bin/claire --synthetic 0
mkdir -p results
./bin/claire --reference doc/data/brain01.nii.gz --template doc/data/brain02.nii.gz \
-o results/ --save velocity,deformed-template
./bin/claire-tools deformation-fields -o results/ --save jacobian \
--velocity-x1 results/velocity-field-x1.nii.gz \
--velocity-x2 results/velocity-field-x2.nii.gz \
--velocity-x3 results/velocity-field-x3.nii.gz
results/ then contains the velocity, the deformed template image, det(grad(y)) (det-deformation-grad.nii.gz) and a summary of the registration. More in Running CLAIRE.
Build and run on a GPU node. In an interactive session, start each program as a job step:
Started directly from the shell of an interactive session, Open MPI fails at startup. More in the installation guide.
New command line (11/2026)
The programs clairetools, test and benchmark are now called claire-tools, claire-test and claire-benchmark, and all options follow the GNU conventions (--grid-size 64). The old option names still work and print a warning; the options page lists the old and the new names. The version before these changes (v0.08) is on the branch gpu-v0.08.
The programs¶
| program | purpose |
|---|---|
claire |
registration |
claire-tools <command> |
pre- and post-processing: deformation-fields, transport-image, transport-label-map, ravens-map, resample, smooth, convert, ... |
claire-test <test> |
unit tests (built with BUILD_TEST=yes) |
claire-benchmark <benchmark> |
run times and accuracy of the solvers (BUILD_TEST=yes) |
--help shows the common options and examples, --help-all all options, and claire-tools <command> --help the options of one command.
Citing CLAIRE¶
If you use CLAIRE in your research, please cite:
- A. Mang, A. Gholami, C. Davatzikos & G. Biros. CLAIRE: A distributed-memory solver for constrained large deformation diffeomorphic image registration. SIAM Journal on Scientific Computing 41(5):C548–C584, 2019 [arXiv, SISC].
- M. Brunn, N. Himthani, G. Biros, M. Mehl & A. Mang. CLAIRE: Constrained Large Deformation Diffeomorphic Image Registration on Parallel Computing Architectures. Journal of Open Source Software 6(61):3038, 2021 [JOSS].
- A. Mang. CLAIRE: Scalable GPU-Accelerated Algorithms for Diffeomorphic Image Registration in 3D. In S. Foucart & S. Wojtowytsch (eds.), Explorations in the Mathematics of Data Science, Applied and Numerical Harmonic Analysis, pp. 167–215, Springer, Cham, 2024 [arXiv, Springer].
The BibTeX entries and the papers on the algorithms and the GPU implementation are in Publications.
Contact¶
Please report bugs and request features on GitHub. For questions and feedback, write to Andreas Mang (andreas.mang@tufts.edu). Contributions are welcome; see Contributing.
Contributors: George Biros, Malte Brunn, Amir Gholami, James Herring, Naveen Himthani, Andreas Mang and Miriam Schulte.