Background worker for computing source interpolation matrices. More...
#include <rtsourceinterpolationmatworker.h>
Public Types | |
| enum | VisualizationType { InterpolationBased = 0 , AnnotationBased = 1 } |
Public Slots | |
| void | computeInterpolationMatrix () |
Signals | |
| void | newInterpolationMatrixLeftAvailable (QSharedPointer< Eigen::SparseMatrix< float > > interpMat) |
| void | newInterpolationMatrixRightAvailable (QSharedPointer< Eigen::SparseMatrix< float > > interpMat) |
Public Member Functions | |
| RtSourceInterpolationMatWorker (QObject *parent=nullptr) | |
| void | setInterpolationFunction (const QString &sInterpolationFunction) |
| void | setCancelDistance (double dCancelDist) |
| void | setInterpolationInfoLeft (const Eigen::MatrixX3f &matVertices, const QVector< QVector< int > > &vecNeighborVertices, const QVector< int > &vecSourceVertices) |
| void | setInterpolationInfoRight (const Eigen::MatrixX3f &matVertices, const QVector< QVector< int > > &vecNeighborVertices, const QVector< int > &vecSourceVertices) |
| void | setVisualizationType (int iVisType) |
| void | setAnnotationInfoLeft (const Eigen::VectorXi &vecLabelIds, const QList< FSLIB::Label > &lLabels, const Eigen::VectorXi &vecVertNo) |
| void | setAnnotationInfoRight (const Eigen::VectorXi &vecLabelIds, const QList< FSLIB::Label > &lLabels, const Eigen::VectorXi &vecVertNo) |
Background worker for computing source interpolation matrices.
RtSourceInterpolationMatWorker computes sparse source-to-vertex interpolation matrices in a background thread.
This worker encapsulates the expensive GeometryInfo::scdc() (geodesic distance computation) and Interpolation::createInterpolationMat() calls that were previously performed either in StcLoadingWorker (at load time only) or not recomputed at all when parameters changed at runtime.
The worker for each hemisphere stores:
When any parameter changes, computeInterpolationMatrix() can be called (typically via a queued connection) to recompute the sparse interpolation matrix on the worker thread. When done, the result is emitted via newInterpolationMatrixAvailable().
Definition at line 90 of file rtsourceinterpolationmatworker.h.

Visualization type enum — selects which matrix the worker emits.
| Enumerator | |
|---|---|
| InterpolationBased | Smooth distance-based interpolation (default). |
| AnnotationBased | Per-parcellation uniform coloring from annotation. |
Definition at line 99 of file rtsourceinterpolationmatworker.h.
|
explicit |
Constructor.
| [in] | parent | Parent QObject. |
Definition at line 53 of file rtsourceinterpolationmatworker.cpp.
|
slot |
Compute the interpolation matrices for both hemispheres. This slot performs the heavy SCDC + interpolation matrix computation. It should be called from a worker thread via a queued connection.
Definition at line 210 of file rtsourceinterpolationmatworker.cpp.
|
signal |
Emitted when a new left hemisphere interpolation matrix is available.
| [in] | interpMat | Sparse interpolation matrix (nVertices x nSources). |
|
signal |
Emitted when a new right hemisphere interpolation matrix is available.
| [in] | interpMat | Sparse interpolation matrix (nVertices x nSources). |
| void RtSourceInterpolationMatWorker::setAnnotationInfoLeft | ( | const Eigen::VectorXi & | vecLabelIds, |
| const QList< FSLIB::Label > & | lLabels, | ||
| const Eigen::VectorXi & | vecVertNo ) |
Set annotation info for the left hemisphere. Required for AnnotationBased visualization.
| [in] | vecLabelIds | Per-vertex label IDs for the surface. |
| [in] | lLabels | List of FreeSurfer Labels. |
| [in] | vecVertNo | Source-space vertex numbers. |
Definition at line 112 of file rtsourceinterpolationmatworker.cpp.
| void RtSourceInterpolationMatWorker::setAnnotationInfoRight | ( | const Eigen::VectorXi & | vecLabelIds, |
| const QList< FSLIB::Label > & | lLabels, | ||
| const Eigen::VectorXi & | vecVertNo ) |
Set annotation info for the right hemisphere.
| [in] | vecLabelIds | Per-vertex label IDs for the surface. |
| [in] | lLabels | List of FreeSurfer Labels. |
| [in] | vecVertNo | Source-space vertex numbers. |
Definition at line 136 of file rtsourceinterpolationmatworker.cpp.
| void RtSourceInterpolationMatWorker::setCancelDistance | ( | double | dCancelDist | ) |
Set the cancel distance used in SCDC distance calculations. Distances larger than this are ignored (coefficients set to zero).
| [in] | dCancelDist | Cancel distance in meters (default: 0.05). |
Definition at line 68 of file rtsourceinterpolationmatworker.cpp.
| void RtSourceInterpolationMatWorker::setInterpolationFunction | ( | const QString & | sInterpolationFunction | ) |
Set the interpolation function used for weight computation.
Available functions: "linear", "gaussian", "square", "cubic" (default).
| [in] | sInterpolationFunction | Function name. |
Definition at line 60 of file rtsourceinterpolationmatworker.cpp.
| void RtSourceInterpolationMatWorker::setInterpolationInfoLeft | ( | const Eigen::MatrixX3f & | matVertices, |
| const QVector< QVector< int > > & | vecNeighborVertices, | ||
| const QVector< int > & | vecSourceVertices ) |
Set the surface and source geometry for the left hemisphere.
| [in] | matVertices | Vertex positions (nVerts x 3). |
| [in] | vecNeighborVertices | Per-vertex neighbor index lists. |
| [in] | vecSourceVertices | Source vertex indices into the surface. |
Definition at line 76 of file rtsourceinterpolationmatworker.cpp.
| void RtSourceInterpolationMatWorker::setInterpolationInfoRight | ( | const Eigen::MatrixX3f & | matVertices, |
| const QVector< QVector< int > > & | vecNeighborVertices, | ||
| const QVector< int > & | vecSourceVertices ) |
Set the surface and source geometry for the right hemisphere.
| [in] | matVertices | Vertex positions (nVerts x 3). |
| [in] | vecNeighborVertices | Per-vertex neighbor index lists. |
| [in] | vecSourceVertices | Source vertex indices into the surface. |
Definition at line 90 of file rtsourceinterpolationmatworker.cpp.
| void RtSourceInterpolationMatWorker::setVisualizationType | ( | int | iVisType | ) |
Set the visualization type. When set to AnnotationBased, the worker emits annotation matrices instead of interpolation matrices.
| [in] | iVisType | VisualizationType enum value. |
Definition at line 104 of file rtsourceinterpolationmatworker.cpp.