v2.0.0
Loading...
Searching...
No Matches
warp.cpp File Reference

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>
Include dependency graph for warp.cpp:

Go to the source code of this file.

Detailed Description

Thin-plate-spline fit and evaluation kernels and the landmark-file reader.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors

Author
Christoph Dinh chris.nosp@m.toph.nosp@m..dinh.nosp@m.@mne.nosp@m.-cpp..nosp@m.org
Since
2.0.0
Date
March 2026

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.