v2.0.0
Loading...
Searching...
No Matches
DISP3DRHILIB::RtSensorInterpolationMatWorker Class Reference

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)

Detailed Description

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.

Inheritance diagram for DISP3DRHILIB::RtSensorInterpolationMatWorker:
Inheritance graph

Constructor & Destructor Documentation

◆ RtSensorInterpolationMatWorker()

RtSensorInterpolationMatWorker::RtSensorInterpolationMatWorker ( QObject * parent = nullptr)
explicit

Constructor.

Parameters
[in]parentParent QObject.

Definition at line 111 of file rtsensorinterpolationmatworker.cpp.

Member Function Documentation

◆ computeMapping

void RtSensorInterpolationMatWorker::computeMapping ( )
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.

◆ newEegMappingAvailable

void DISP3DRHILIB::RtSensorInterpolationMatWorker::newEegMappingAvailable ( const QString & surfaceKey,
QSharedPointer< Eigen::MatrixXf > mappingMat,
const QVector< int > & pick )
signal

Emitted when new EEG mapping data is available.

Parameters
[in]surfaceKeyThe surface the mapping targets.
[in]mappingMatDense mapping matrix (nVerts x nChannels).
[in]pickChannel indices picked for this mapping.

◆ newMegMappingAvailable

void DISP3DRHILIB::RtSensorInterpolationMatWorker::newMegMappingAvailable ( const QString & surfaceKey,
QSharedPointer< Eigen::MatrixXf > mappingMat,
const QVector< int > & pick )
signal

Emitted when new MEG mapping data is available.

Parameters
[in]surfaceKeyThe surface the mapping targets.
[in]mappingMatDense mapping matrix (nVerts x nChannels).
[in]pickChannel indices picked for this mapping.

◆ setBadChannels()

void RtSensorInterpolationMatWorker::setBadChannels ( const QStringList & bads)

Set the bad channels. Triggers recomputation if changed.

Parameters
[in]badsList of bad channel names.

Definition at line 171 of file rtsensorinterpolationmatworker.cpp.

◆ setEegSurface()

void RtSensorInterpolationMatWorker::setEegSurface ( const QString & surfaceKey,
const Eigen::MatrixX3f & vertices )

Set the surface geometry used for EEG field mapping.

Parameters
[in]surfaceKeyThe key identifying the surface.
[in]verticesVertex positions (nVerts x 3).

Definition at line 160 of file rtsensorinterpolationmatworker.cpp.

◆ setEvoked()

void RtSensorInterpolationMatWorker::setEvoked ( const FIFFLIB::FiffEvoked & evoked)

Set the evoked data that contains channel info and sensor definitions.

Parameters
[in]evokedThe evoked dataset.

Definition at line 118 of file rtsensorinterpolationmatworker.cpp.

◆ setMegFieldMapOnHead()

void RtSensorInterpolationMatWorker::setMegFieldMapOnHead ( bool onHead)

Set whether the MEG field should be mapped onto the head (BEM) surface rather than the helmet surface.

Parameters
[in]onHeadTrue to map onto head.

Definition at line 137 of file rtsensorinterpolationmatworker.cpp.

◆ setMegSurface()

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).

Parameters
[in]surfaceKeyThe key identifying the surface.
[in]verticesVertex positions (nVerts x 3).
[in]normalsVertex normals (nVerts x 3).
[in]trianglesTriangle indices (nTris x 3).

Definition at line 145 of file rtsensorinterpolationmatworker.cpp.

◆ setTransform()

void RtSensorInterpolationMatWorker::setTransform ( const FIFFLIB::FiffCoordTrans & trans,
bool applySensorTrans )

Set the head-to-MRI coordinate transform.

Parameters
[in]transThe transform.
[in]applySensorTransWhether to apply the transform.

Definition at line 127 of file rtsensorinterpolationmatworker.cpp.


The documentation for this class was generated from the following files: