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

Background worker for real-time source estimate streaming. More...

#include <rtsourcedataworker.h>

Public Slots

void streamData ()

Signals

void newRtSmoothedData (const QVector< uint32_t > &colorsLh, const QVector< uint32_t > &colorsRh)
void newRtRawData (const Eigen::VectorXd &dataLh, const Eigen::VectorXd &dataRh)

Public Member Functions

 RtSourceDataWorker (QObject *parent=nullptr)
void addData (const Eigen::VectorXd &data)
void clear ()
void setInterpolationMatrixLeft (QSharedPointer< Eigen::SparseMatrix< float > > mat)
void setInterpolationMatrixRight (QSharedPointer< Eigen::SparseMatrix< float > > mat)
void setNumberAverages (int numAvr)
void setColormapType (const QString &name)
void setThresholds (double min, double mid, double max)
void setLoopState (bool enabled)
void setSFreq (double sFreq)
void setStreamSmoothedData (bool bStreamSmoothedData)
void setSurfaceColor (const QVector< uint32_t > &baseColorsLh, const QVector< uint32_t > &baseColorsRh)

Detailed Description

Background worker for real-time source estimate streaming.

RtSourceDataWorker processes incoming source estimate data in a background thread. It manages a data queue, performs averaging, applies interpolation matrices, and converts source values to per-vertex ABGR colors for rendering.

This worker is driven by a timer in the RtSourceDataController.

Definition at line 68 of file rtsourcedataworker.h.

Inheritance diagram for DISP3DRHILIB::RtSourceDataWorker:
Inheritance graph

Constructor & Destructor Documentation

◆ RtSourceDataWorker()

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

Constructor.

Parameters
[in]parentParent QObject.

Definition at line 53 of file rtsourcedataworker.cpp.

Member Function Documentation

◆ addData()

void RtSourceDataWorker::addData ( const Eigen::VectorXd & data)

Add a new source estimate data vector to the streaming queue. The vector contains source values for all sources (LH + RH concatenated).

Parameters
[in]dataSource activity vector (nSources x 1).

Definition at line 60 of file rtsourcedataworker.cpp.

◆ clear()

void RtSourceDataWorker::clear ( )

Clear all queued data.

Definition at line 81 of file rtsourcedataworker.cpp.

◆ newRtRawData

void DISP3DRHILIB::RtSourceDataWorker::newRtRawData ( const Eigen::VectorXd & dataLh,
const Eigen::VectorXd & dataRh )
signal

Emitted when new raw (non-interpolated) data is available.

Parameters
[in]dataLhSource values for left hemisphere.
[in]dataRhSource values for right hemisphere.

◆ newRtSmoothedData

void DISP3DRHILIB::RtSourceDataWorker::newRtSmoothedData ( const QVector< uint32_t > & colorsLh,
const QVector< uint32_t > & colorsRh )
signal

Emitted when new interpolated color data is ready for rendering.

Parameters
[in]colorsLhPer-vertex ABGR color array for the left hemisphere.
[in]colorsRhPer-vertex ABGR color array for the right hemisphere.

◆ setColormapType()

void RtSourceDataWorker::setColormapType ( const QString & name)

Set the colormap type used for color conversion.

Parameters
[in]nameColormap name ("Hot", "Jet", "Viridis", "Cool", "RedBlue").

Definition at line 117 of file rtsourcedataworker.cpp.

◆ setInterpolationMatrixLeft()

void RtSourceDataWorker::setInterpolationMatrixLeft ( QSharedPointer< Eigen::SparseMatrix< float > > mat)

Set the interpolation matrix for the left hemisphere.

Parameters
[in]matSparse interpolation matrix (nVertices x nSourcesLH).

Definition at line 93 of file rtsourcedataworker.cpp.

◆ setInterpolationMatrixRight()

void RtSourceDataWorker::setInterpolationMatrixRight ( QSharedPointer< Eigen::SparseMatrix< float > > mat)

Set the interpolation matrix for the right hemisphere.

Parameters
[in]matSparse interpolation matrix (nVertices x nSourcesRH).

Definition at line 101 of file rtsourcedataworker.cpp.

◆ setLoopState()

void RtSourceDataWorker::setLoopState ( bool enabled)

Enable or disable looping (replay from beginning when queue is exhausted).

Parameters
[in]enabledTrue to enable looping.

Definition at line 135 of file rtsourcedataworker.cpp.

◆ setNumberAverages()

void RtSourceDataWorker::setNumberAverages ( int numAvr)

Set the number of samples to average before emitting.

Parameters
[in]numAvrNumber of averages (1 = no averaging).

Definition at line 109 of file rtsourcedataworker.cpp.

◆ setSFreq()

void RtSourceDataWorker::setSFreq ( double sFreq)

Set the sampling frequency of the incoming data.

Parameters
[in]sFreqSampling frequency in Hz.

Definition at line 143 of file rtsourcedataworker.cpp.

◆ setStreamSmoothedData()

void RtSourceDataWorker::setStreamSmoothedData ( bool bStreamSmoothedData)

Toggle between emitting interpolated color data (smoothed) and raw source values split by hemisphere.

When enabled (default), streamData() performs interpolation + colormap conversion and emits newRtSmoothedData(). When disabled, it emits newRtRawData() with the raw source values per hemisphere, which can be used for GPU-side interpolation.

Parameters
[in]bStreamSmoothedDataTrue for smoothed colors (default), false for raw.

Definition at line 161 of file rtsourcedataworker.cpp.

◆ setSurfaceColor()

void RtSourceDataWorker::setSurfaceColor ( const QVector< uint32_t > & baseColorsLh,
const QVector< uint32_t > & baseColorsRh )

Set the base surface colors for both hemispheres. Sub-threshold vertices will display these colors instead of being transparent.

Parameters
[in]baseColorsLhPer-vertex ABGR colors for the left hemisphere.
[in]baseColorsRhPer-vertex ABGR colors for the right hemisphere.

Definition at line 151 of file rtsourcedataworker.cpp.

◆ setThresholds()

void RtSourceDataWorker::setThresholds ( double min,
double mid,
double max )

Set the threshold values for normalization.

Parameters
[in]minLower threshold (values below are transparent).
[in]midMid-point threshold (fade-in range).
[in]maxUpper threshold (values above are clamped).

Definition at line 125 of file rtsourcedataworker.cpp.

◆ streamData

void RtSourceDataWorker::streamData ( )
slot

Stream one frame of data. Called by the controller's timer. Pops data from the queue, averages, interpolates, and emits per-vertex colors.

Definition at line 169 of file rtsourcedataworker.cpp.


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