Background worker for computing sensor field mapping matrices. More...
#include <rtsensorinterpolationmatworker.h>
Public Slots | |
| void | computeMapping () |
Signals | |
| void | newMegMappingAvailable (const QString &surfaceKey, QSharedPointer< Eigen::MatrixXf > mappingMat, const QVector< int > &pick) |
| void | newEegMappingAvailable (const QString &surfaceKey, QSharedPointer< Eigen::MatrixXf > mappingMat, const QVector< int > &pick) |
Public Member Functions | |
| RtSensorInterpolationMatWorker (QObject *parent=nullptr) | |
| void | setEvoked (const FIFFLIB::FiffEvoked &evoked) |
| void | setTransform (const FIFFLIB::FiffCoordTrans &trans, bool applySensorTrans) |
| void | setMegFieldMapOnHead (bool onHead) |
| void | setMegSurface (const QString &surfaceKey, const Eigen::MatrixX3f &vertices, const Eigen::MatrixX3f &normals, const Eigen::MatrixX3i &triangles) |
| void | setEegSurface (const QString &surfaceKey, const Eigen::MatrixX3f &vertices) |
| void | setBadChannels (const QStringList &bads) |
Background worker for computing sensor field mapping matrices.
RtSensorInterpolationMatWorker computes dense sensor-to-surface field-mapping matrices in a background thread.
This worker encapsulates the expensive FieldMap::computeMegMapping() and computeEegMapping() calls that were previously performed synchronously on the main thread inside BrainView::buildSensorFieldMapping().
The worker stores all relevant parameters (evoked info, surface geometry, transforms, etc.) and recomputes the mapping matrices when any parameter changes. It emits newMappingMatrixAvailable() when a new matrix is ready.
Thread-safety: all public setters are mutex-protected and schedule a recomputation via the computeMapping() slot.
Definition at line 87 of file rtsensorinterpolationmatworker.h.

|
explicit |
Constructor.
| [in] | parent | Parent QObject. |
Definition at line 111 of file rtsensorinterpolationmatworker.cpp.
|
slot |
Compute the sensor-to-surface mapping matrices. This slot can be called directly or connected to a signal. The computation reads the stored parameters and builds dense mapping matrices via FieldMap::computeMegMapping() / computeEegMapping().
Definition at line 179 of file rtsensorinterpolationmatworker.cpp.
|
signal |
Emitted when new EEG mapping data is available.
| [in] | surfaceKey | The surface the mapping targets. |
| [in] | mappingMat | Dense mapping matrix (nVerts x nChannels). |
| [in] | pick | Channel indices picked for this mapping. |
|
signal |
Emitted when new MEG mapping data is available.
| [in] | surfaceKey | The surface the mapping targets. |
| [in] | mappingMat | Dense mapping matrix (nVerts x nChannels). |
| [in] | pick | Channel indices picked for this mapping. |
| void RtSensorInterpolationMatWorker::setBadChannels | ( | const QStringList & | bads | ) |
Set the bad channels. Triggers recomputation if changed.
| [in] | bads | List of bad channel names. |
Definition at line 171 of file rtsensorinterpolationmatworker.cpp.
| void RtSensorInterpolationMatWorker::setEegSurface | ( | const QString & | surfaceKey, |
| const Eigen::MatrixX3f & | vertices ) |
Set the surface geometry used for EEG field mapping.
| [in] | surfaceKey | The key identifying the surface. |
| [in] | vertices | Vertex positions (nVerts x 3). |
Definition at line 160 of file rtsensorinterpolationmatworker.cpp.
| void RtSensorInterpolationMatWorker::setEvoked | ( | const FIFFLIB::FiffEvoked & | evoked | ) |
Set the evoked data that contains channel info and sensor definitions.
| [in] | evoked | The evoked dataset. |
Definition at line 118 of file rtsensorinterpolationmatworker.cpp.
| void RtSensorInterpolationMatWorker::setMegFieldMapOnHead | ( | bool | onHead | ) |
Set whether the MEG field should be mapped onto the head (BEM) surface rather than the helmet surface.
| [in] | onHead | True to map onto head. |
Definition at line 137 of file rtsensorinterpolationmatworker.cpp.
| void RtSensorInterpolationMatWorker::setMegSurface | ( | const QString & | surfaceKey, |
| const Eigen::MatrixX3f & | vertices, | ||
| const Eigen::MatrixX3f & | normals, | ||
| const Eigen::MatrixX3i & | triangles ) |
Set the surface geometry used for MEG field mapping. This must include vertex positions and normals (for MEG).
| [in] | surfaceKey | The key identifying the surface. |
| [in] | vertices | Vertex positions (nVerts x 3). |
| [in] | normals | Vertex normals (nVerts x 3). |
| [in] | triangles | Triangle indices (nTris x 3). |
Definition at line 145 of file rtsensorinterpolationmatworker.cpp.
| void RtSensorInterpolationMatWorker::setTransform | ( | const FIFFLIB::FiffCoordTrans & | trans, |
| bool | applySensorTrans ) |
Set the head-to-MRI coordinate transform.
| [in] | trans | The transform. |
| [in] | applySensorTrans | Whether to apply the transform. |
Definition at line 127 of file rtsensorinterpolationmatworker.cpp.