Thin-plate-spline fit and evaluation kernels and the landmark-file reader. More...
#include "warp.h"#include <iostream>#include <fstream>#include <Eigen/LU>#include <QDebug>#include <QFile>#include <QList>#include <QRegularExpression>
Go to the source code of this file.
Thin-plate-spline fit and evaluation kernels and the landmark-file reader.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors
Implements the TPS solver declared in warp.h. Fitting assembles the (n+4)×(n+4) block-symmetric matrix \(\begin{bmatrix}K & P\\P^T & 0\end{bmatrix}\) from the pairwise kernel evaluations \(U(r)=r\) and the affine constraints, factorises it once via Eigen::FullPivLU, and recovers the warp weights w and affine part (A, t). Evaluation at m new vertices then costs O(m*n + m) and is performed batchwise so a complete cortical mesh can be warped in one pass.
The companion Warp::readsLm parses the simple x y z per-line electrode landmark format used by the MRI-side calibration tools so the class can be driven directly from a digitiser export without needing a separate IO layer.
Definition in file warp.cpp.