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

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)

Detailed Description

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:

  • Surface vertex positions and neighbor topology
  • Source vertex indices (from the STC file)
  • Cancel distance and interpolation function

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.

Inheritance diagram for DISP3DRHILIB::RtSourceInterpolationMatWorker:
Inheritance graph

Member Enumeration Documentation

◆ VisualizationType

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.

Constructor & Destructor Documentation

◆ RtSourceInterpolationMatWorker()

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

Constructor.

Parameters
[in]parentParent QObject.

Definition at line 53 of file rtsourceinterpolationmatworker.cpp.

Member Function Documentation

◆ computeInterpolationMatrix

void RtSourceInterpolationMatWorker::computeInterpolationMatrix ( )
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.

◆ newInterpolationMatrixLeftAvailable

void DISP3DRHILIB::RtSourceInterpolationMatWorker::newInterpolationMatrixLeftAvailable ( QSharedPointer< Eigen::SparseMatrix< float > > interpMat)
signal

Emitted when a new left hemisphere interpolation matrix is available.

Parameters
[in]interpMatSparse interpolation matrix (nVertices x nSources).

◆ newInterpolationMatrixRightAvailable

void DISP3DRHILIB::RtSourceInterpolationMatWorker::newInterpolationMatrixRightAvailable ( QSharedPointer< Eigen::SparseMatrix< float > > interpMat)
signal

Emitted when a new right hemisphere interpolation matrix is available.

Parameters
[in]interpMatSparse interpolation matrix (nVertices x nSources).

◆ setAnnotationInfoLeft()

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.

Parameters
[in]vecLabelIdsPer-vertex label IDs for the surface.
[in]lLabelsList of FreeSurfer Labels.
[in]vecVertNoSource-space vertex numbers.

Definition at line 112 of file rtsourceinterpolationmatworker.cpp.

◆ setAnnotationInfoRight()

void RtSourceInterpolationMatWorker::setAnnotationInfoRight ( const Eigen::VectorXi & vecLabelIds,
const QList< FSLIB::Label > & lLabels,
const Eigen::VectorXi & vecVertNo )

Set annotation info for the right hemisphere.

Parameters
[in]vecLabelIdsPer-vertex label IDs for the surface.
[in]lLabelsList of FreeSurfer Labels.
[in]vecVertNoSource-space vertex numbers.

Definition at line 136 of file rtsourceinterpolationmatworker.cpp.

◆ setCancelDistance()

void RtSourceInterpolationMatWorker::setCancelDistance ( double dCancelDist)

Set the cancel distance used in SCDC distance calculations. Distances larger than this are ignored (coefficients set to zero).

Parameters
[in]dCancelDistCancel distance in meters (default: 0.05).

Definition at line 68 of file rtsourceinterpolationmatworker.cpp.

◆ setInterpolationFunction()

void RtSourceInterpolationMatWorker::setInterpolationFunction ( const QString & sInterpolationFunction)

Set the interpolation function used for weight computation.

Available functions: "linear", "gaussian", "square", "cubic" (default).

Parameters
[in]sInterpolationFunctionFunction name.

Definition at line 60 of file rtsourceinterpolationmatworker.cpp.

◆ setInterpolationInfoLeft()

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.

Parameters
[in]matVerticesVertex positions (nVerts x 3).
[in]vecNeighborVerticesPer-vertex neighbor index lists.
[in]vecSourceVerticesSource vertex indices into the surface.

Definition at line 76 of file rtsourceinterpolationmatworker.cpp.

◆ setInterpolationInfoRight()

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.

Parameters
[in]matVerticesVertex positions (nVerts x 3).
[in]vecNeighborVerticesPer-vertex neighbor index lists.
[in]vecSourceVerticesSource vertex indices into the surface.

Definition at line 90 of file rtsourceinterpolationmatworker.cpp.

◆ setVisualizationType()

void RtSourceInterpolationMatWorker::setVisualizationType ( int iVisType)

Set the visualization type. When set to AnnotationBased, the worker emits annotation matrices instead of interpolation matrices.

Parameters
[in]iVisTypeVisualizationType enum value.

Definition at line 104 of file rtsourceinterpolationmatworker.cpp.


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