Skip to main content

HPISortStruct

Namespace: INVLIB  ·  Library: Inverse Library

#include <inv/inv_hpi_fit_data.h>

struct INVLIB::HPISortStruct

The strucut specifing the sorting parameters.

Helper for sorting HPI coil dipole fits by matching each fit to the nearest expected coil position


Example​

No example of its own: Sort key InvHpiFitData uses to match coil fits to expected positions; internal to the HPI 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​