Skip to main content

DipFitError

Namespace: INVLIB  ·  Library: Inverse Library

#include <inv/inv_hpi_fit_data.h>

struct INVLIB::DipFitError

The strucut specifing the dipole error.

Residual error and moment vector from a single magnetic dipole fit iteration


Example​

No example of its own: Per-iteration residual record of the HPI dipole fit inside InvHpiFitData; internal to the fit.

It is exercised by:

src/examples/ex_inv_hpi/main.cpp
// One coil's magnetic-dipole fit, as InvHpiFit runs it per coil: seeded 5 mm off the fitted position.
const MatrixXd coilsDevice = fit.devHeadTrans.apply_inverse_trans(updater.getHpiDigitizer().cast<float>()).cast<double>();
InvHpiFitData coilFit;
coilFit.m_coilPos = coilsDevice.row(0) + RowVector3d(0.005, 0.0, 0.0);
const int strongest = amplitudes.row(0).squaredNorm() >= amplitudes.row(4).squaredNorm() ? 0 : 4;
coilFit.m_sensorData = amplitudes.row(strongest).transpose();
coilFit.m_sensors = updater.getSensors();
coilFit.m_matProjector = updater.getProjectors();
coilFit.m_iMaxIterations = 500;
coilFit.m_fAbortError = 1e-9f;
coilFit.doDipfitConcurrent();

From ex_inv_hpi.

Authors of this file​