Thin-plate-spline 3-D warp from landmark correspondences. More...


Go to the source code of this file.
Classes | |
| class | UTILSLIB::Warp |
| Thin-plate-spline 3-D warp fitted from landmark correspondences. More... | |
Namespaces | |
| namespace | UTILSLIB |
| Shared utilities (I/O helpers, spectral analysis, layout management, warp algorithms). | |
Thin-plate-spline 3-D warp from landmark correspondences.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors
UTILSLIB::Warp implements Bookstein's thin-plate spline (TPS), the minimum-bending-energy interpolant that maps an n×3 set of source landmarks exactly onto an n×3 set of destination landmarks and extends smoothly to the rest of R^3. It is mne-cpp's reference tool for non-rigid registration of EEG electrodes and MEG digitiser points onto a subject MRI scalp, and for warping a template mesh (cortex, head surface) into the geometry of an individual subject.
The warp evaluates as \(f(\mathbf{x}) = A\mathbf{x} + \mathbf{t} + \sum_i w_i\,U(\|\mathbf{x}-\mathbf{p}_i\|)\) with \(U(r) = r\) for 3-D (the conditionally positive definite TPS kernel). Fitting requires one (n+4)×(n+4) linear solve (Eigen::FullPivLU); evaluation at m points is then O(m*n + m). The class is also a wrapper around a tiny landmark file reader (readsLm) so calibration data shipped as plain text can be ingested without extra glue.
Reference: Bookstein (1989) "Principal Warps: Thin-Plate Splines and the Decomposition of Deformations".
Definition in file warp.h.