MNE-CPP  0.1.9
A Framework for Electrophysiology
Public Types | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
DISP3DLIB::RtSourceDataController Class Reference

This controller organizes data streaming and interpolation matrix calculations. It only uses Queued signals in order to be thread safe with the underlying workers. More...

#include <rtsourcedatacontroller.h>

Public Types

typedef QSharedPointer< RtSourceDataControllerSPtr
 
typedef QSharedPointer< const RtSourceDataControllerConstSPtr
 

Signals

void interpolationInfoLeftChanged (const Eigen::MatrixX3f &matVerticesLeft, const QVector< QVector< int > > &vecNeighborVerticesLeft, const QVector< int > &vecMappedSubsetLeft)
 
void interpolationInfoRightChanged (const Eigen::MatrixX3f &matVerticesRight, const QVector< QVector< int > > &vecNeighborVerticesRight, const QVector< int > &vecMappedSubsetRight)
 
void annotationInfoLeftChanged (const Eigen::VectorXi &vecLabelIdsLeftHemi, const QList< FSLIB::Label > &lLabels, const Eigen::VectorXi &vecVertNoLeft)
 
void annotationInfoRightChanged (const Eigen::VectorXi &vecLabelIdsRightHemi, const QList< FSLIB::Label > &lLabels, const Eigen::VectorXi &vecVertNoRight)
 
void surfaceColorChanged (const Eigen::MatrixX4f &matColorLeft, const Eigen::MatrixX4f &matColorRight)
 
void streamSmoothedDataChanged (bool bStreamSmoothedData)
 
void interpolationFunctionChanged (const QString &sInterpolationFunction)
 
void cancelDistanceChanged (double dCancelDist)
 
void thresholdsChanged (const QVector3D &vecThresholds)
 
void visualizationTypeChanged (int iVisType)
 
void sFreqChanged (double dSFreq)
 
void numberAveragesChanged (int iNumAvr)
 
void loopStateChanged (bool bLoopState)
 
void colormapTypeChanged (const QString &sColormapType)
 
void rawDataChanged (const Eigen::MatrixXd &data)
 
void newInterpolationMatrixLeftAvailable (QSharedPointer< Eigen::SparseMatrix< float > > pMatInterpolationMatrixLeftHemi)
 
void newInterpolationMatrixRightAvailable (QSharedPointer< Eigen::SparseMatrix< float > > pMatInterpolationMatrixRightHemi)
 
void newRtRawDataAvailable (const Eigen::VectorXd &vecDataVectorLeftHemi, const Eigen::VectorXd &vecDataVectorRightHemi)
 
void newRtSmoothedDataAvailable (const Eigen::MatrixX4f &matColorMatrixLeftHemi, const Eigen::MatrixX4f &matColorMatrixRightHemi)
 

Public Member Functions

 RtSourceDataController ()
 
 ~RtSourceDataController ()
 
void setStreamingState (bool bStreamingState)
 
void setInterpolationFunction (const QString &sInterpolationFunction)
 
void setLoopState (bool bLoopState)
 
void setCancelDistance (double dCancelDist)
 
void setTimeInterval (int iMSec)
 
void setInterpolationInfo (const Eigen::MatrixX3f &matVerticesLeft, const Eigen::MatrixX3f &matVerticesRight, const QVector< QVector< int > > &vecNeighborVerticesLeft, const QVector< QVector< int > > &vecNeighborVerticesRight, const Eigen::VectorXi &vecVertNoLeftHemi, const Eigen::VectorXi &vecVertNoRightHemi)
 
void setSurfaceColor (const Eigen::MatrixX4f &matColorLeft, const Eigen::MatrixX4f &matColorRight)
 
void setAnnotationInfo (const Eigen::VectorXi &vecLabelIdsLeftHemi, const Eigen::VectorXi &vecLabelIdsRightHemi, const QList< FSLIB::Label > &lLabelsLeftHemi, const QList< FSLIB::Label > &lLabelsRightHemi, const Eigen::VectorXi &vecVertNoLeft, const Eigen::VectorXi &vecVertNoRight)
 
void setThresholds (const QVector3D &vecThresholds)
 
void setVisualizationType (int iVisType)
 
void setColormapType (const QString &sColormapType)
 
void setNumberAverages (int iNumAvr)
 
void setSFreq (double dSFreq)
 
void setStreamSmoothedData (bool bStreamSmoothedData)
 
void addData (const Eigen::MatrixXd &data)
 

Protected Member Functions

void onNewRtRawData (const Eigen::VectorXd &vecDataVectorLeftHemi, const Eigen::VectorXd &vecDataVectorRightHemi)
 
void onNewSmoothedRtRawData (const Eigen::MatrixX4f &matColorMatrixLeftHemi, const Eigen::MatrixX4f &matColorMatrixRightHemi)
 
void onNewInterpolationMatrixLeftCalculated (QSharedPointer< Eigen::SparseMatrix< float > > pMatInterpolationMatrixLeftHemi)
 
void onNewInterpolationMatrixRightCalculated (QSharedPointer< Eigen::SparseMatrix< float > > pMatInterpolationMatrixRightHemi)
 

Protected Attributes

QTimer m_timer
 
QThread m_rtSourceDataWorkerThread
 
QThread m_rtInterpolationLeftWorkerThread
 
QThread m_rtInterpolationRightWorkerThread
 
QPointer< RtSourceDataWorkerm_pRtSourceDataWorker
 
QPointer< RtSourceInterpolationMatWorkerm_pRtInterpolationLeftWorker
 
QPointer< RtSourceInterpolationMatWorkerm_pRtInterpolationRightWorker
 
int m_iMSecInterval
 

Detailed Description

This controller organizes data streaming and interpolation matrix calculations. It only uses Queued signals in order to be thread safe with the underlying workers.

This controller organizes data streaming and interpolation matrix calculations. It only uses Queued signals in order to be thread safe with the underlying workers.

Definition at line 83 of file rtsourcedatacontroller.h.

Inheritance diagram for DISP3DLIB::RtSourceDataController:
Inheritance graph

Member Typedef Documentation

◆ ConstSPtr

Const shared pointer type for RtSourceDataController class.

Definition at line 89 of file rtsourcedatacontroller.h.

◆ SPtr

Shared pointer type for RtSourceDataController class.

Definition at line 88 of file rtsourcedatacontroller.h.

Constructor & Destructor Documentation

◆ RtSourceDataController()

RtSourceDataController::RtSourceDataController ( )

Default constructor.

Definition at line 67 of file rtsourcedatacontroller.cpp.

◆ ~RtSourceDataController()

RtSourceDataController::~RtSourceDataController ( )

Default destructor.

Definition at line 175 of file rtsourcedatacontroller.cpp.

Member Function Documentation

◆ addData()

void RtSourceDataController::addData ( const Eigen::MatrixXd &  data)

Add data which is to be streamed.

Parameters
[in]dataThe new data.

Definition at line 329 of file rtsourcedatacontroller.cpp.

◆ annotationInfoLeftChanged

void DISP3DLIB::RtSourceDataController::annotationInfoLeftChanged ( const Eigen::VectorXi &  vecLabelIdsLeftHemi,
const QList< FSLIB::Label > &  lLabels,
const Eigen::VectorXi &  vecVertNoLeft 
)
signal

Emit this signal whenever the interpolation info for the left hemisphere changed.

Parameters
[in]vecLabelIdsLeftHemiThe labels ids for each of the left hemipshere surface vertex idx.
[in]lLabelsThe label information.
[in]vecVertNoLeftThe vertNos for the left hemisphere.

◆ annotationInfoRightChanged

void DISP3DLIB::RtSourceDataController::annotationInfoRightChanged ( const Eigen::VectorXi &  vecLabelIdsRightHemi,
const QList< FSLIB::Label > &  lLabels,
const Eigen::VectorXi &  vecVertNoRight 
)
signal

Emit this signal whenever the interpolation info for the right hemisphere changed.

Parameters
[in]vecLabelIdsRightHemiThe labels ids for each of the right hemipshere surface vertex idx.
[in]lLabelsThe label information.
[in]vecVertNoRightThe vertNos for the right hemisphere.

◆ cancelDistanceChanged

void DISP3DLIB::RtSourceDataController::cancelDistanceChanged ( double  dCancelDist)
signal

Emit this signal whenever the cancel distance changed.

Parameters
[in]dCancelDistThe new cancel distance value in meters.

◆ colormapTypeChanged

void DISP3DLIB::RtSourceDataController::colormapTypeChanged ( const QString &  sColormapType)
signal

Emit this signal whenever the colormap changed.

Parameters
[in]sColormapTypeThe new colormap type.

◆ interpolationFunctionChanged

void DISP3DLIB::RtSourceDataController::interpolationFunctionChanged ( const QString &  sInterpolationFunction)
signal

Emit this signal whenever the interpolation function changed.

Parameters
[in]sInterpolationFunctionFunction that computes interpolation coefficients using the distance values.

◆ interpolationInfoLeftChanged

void DISP3DLIB::RtSourceDataController::interpolationInfoLeftChanged ( const Eigen::MatrixX3f &  matVerticesLeft,
const QVector< QVector< int > > &  vecNeighborVerticesLeft,
const QVector< int > &  vecMappedSubsetLeft 
)
signal

Emit this signal whenever the interpolation info for the left hemisphere changed.

Parameters
[in]matVerticesLeftThe mesh information in form of vertices.
[in]vecNeighborVerticesLeftThe neighbor vertex information.
[in]vecMappedSubsetLeftVector index position represents the id of the sensor and the qint in each cell is the vertex it is mapped to.

◆ interpolationInfoRightChanged

void DISP3DLIB::RtSourceDataController::interpolationInfoRightChanged ( const Eigen::MatrixX3f &  matVerticesRight,
const QVector< QVector< int > > &  vecNeighborVerticesRight,
const QVector< int > &  vecMappedSubsetRight 
)
signal

Emit this signal whenever the interpolation info for the right hemisphere changed.

Parameters
[in]matVerticesRightThe mesh information in form of vertices.
[in]vecNeighborVerticesRightThe neighbor vertex information.
[in]vecMappedSubsetRightVector index position represents the id of the sensor and the qint in each cell is the vertex it is mapped to.

◆ loopStateChanged

void DISP3DLIB::RtSourceDataController::loopStateChanged ( bool  bLoopState)
signal

Emit this signal whenever the loop state changed.

Parameters
[in]bLoopStateThe new looping state.

◆ newInterpolationMatrixLeftAvailable

void DISP3DLIB::RtSourceDataController::newInterpolationMatrixLeftAvailable ( QSharedPointer< Eigen::SparseMatrix< float > >  pMatInterpolationMatrixLeftHemi)
signal

Emit this signal whenever a new interpolation matrix for the left hemisphere is available.

Parameters
[in]pMatInterpolationMatrixLeftHemiThe new interpolation matrix for the left hemisphere.

◆ newInterpolationMatrixRightAvailable

void DISP3DLIB::RtSourceDataController::newInterpolationMatrixRightAvailable ( QSharedPointer< Eigen::SparseMatrix< float > >  pMatInterpolationMatrixRightHemi)
signal

Emit this signal whenever a new interpolation matrix for the right hemisphere is available.

Parameters
[in]pMatInterpolationMatrixRightHemiThe new interpolation matrix for the right hemisphere.

◆ newRtRawDataAvailable

void DISP3DLIB::RtSourceDataController::newRtRawDataAvailable ( const Eigen::VectorXd &  vecDataVectorLeftHemi,
const Eigen::VectorXd &  vecDataVectorRightHemi 
)
signal

Emit this signal whenever a new raw data is streamed. This function is usefull, e.g., when the interpolation is done on shader (GPU) level.

Parameters
[in]vecDataVectorLeftHemiThe new streamed raw data for the left hemispehre.
[in]vecDataVectorRightHemiThe new streamed raw data for the right hemispehre.

◆ newRtSmoothedDataAvailable

void DISP3DLIB::RtSourceDataController::newRtSmoothedDataAvailable ( const Eigen::MatrixX4f &  matColorMatrixLeftHemi,
const Eigen::MatrixX4f &  matColorMatrixRightHemi 
)
signal

Emit this signal whenever a new interpolated raw data is streamed.

Parameters
[in]matColorMatrixLeftHemiThe new streamed interpolated raw data in form of RGB colors per vertex for the left hemisphere.
[in]matColorMatrixRightHemiThe new streamed interpolated raw data in form of RGB colors per vertex for the right hemisphere.

◆ numberAveragesChanged

void DISP3DLIB::RtSourceDataController::numberAveragesChanged ( int  iNumAvr)
signal

Emit this signal whenever the number of averages changed.

Parameters
[in]iNumAvrThe new number of averages.

◆ onNewInterpolationMatrixLeftCalculated()

void RtSourceDataController::onNewInterpolationMatrixLeftCalculated ( QSharedPointer< Eigen::SparseMatrix< float > >  pMatInterpolationMatrixLeftHemi)
protected

Call this function whenever a new interpolation matrix for the left hemisphere is available to be dispatched.

Parameters
[in]pMatInterpolationMatrixLeftHemiThe new interpolation matrix for the left hemisphere.

Definition at line 354 of file rtsourcedatacontroller.cpp.

◆ onNewInterpolationMatrixRightCalculated()

void RtSourceDataController::onNewInterpolationMatrixRightCalculated ( QSharedPointer< Eigen::SparseMatrix< float > >  pMatInterpolationMatrixRightHemi)
protected

Call this function whenever a new interpolation matrix for the right hemisphere is available to be dispatched.

Parameters
[in]pMatInterpolationMatrixRightHemiThe new interpolation matrix for the right hemisphere.

Definition at line 361 of file rtsourcedatacontroller.cpp.

◆ onNewRtRawData()

void RtSourceDataController::onNewRtRawData ( const Eigen::VectorXd &  vecDataVectorLeftHemi,
const Eigen::VectorXd &  vecDataVectorRightHemi 
)
protected

Call this function whenever new raw data is available to be dispatched. This function is usefull, e.g., when the interpolation is done on shader (GPU) level.

Parameters
[in]vecDataVectorLeftHemiThe new streamed raw data for the left hemispehre.
[in]vecDataVectorRightHemiThe new streamed raw data for the right hemispehre.

Definition at line 336 of file rtsourcedatacontroller.cpp.

◆ onNewSmoothedRtRawData()

void RtSourceDataController::onNewSmoothedRtRawData ( const Eigen::MatrixX4f &  matColorMatrixLeftHemi,
const Eigen::MatrixX4f &  matColorMatrixRightHemi 
)
protected

Call this function whenever new interpolated raw data is available to be dispatched.

Parameters
[in]matColorMatrixLeftHemiThe new streamed interpolated raw data in form of RGB colors per vertex for the left hemisphere.
[in]matColorMatrixRightHemiThe new streamed interpolated raw data in form of RGB colors per vertex for the right hemisphere.

Definition at line 345 of file rtsourcedatacontroller.cpp.

◆ rawDataChanged

void DISP3DLIB::RtSourceDataController::rawDataChanged ( const Eigen::MatrixXd &  data)
signal

Emit this signal whenever new data to be streamed was added.

Parameters
[in]dataThe new data.

◆ setAnnotationInfo()

void RtSourceDataController::setAnnotationInfo ( const Eigen::VectorXi &  vecLabelIdsLeftHemi,
const Eigen::VectorXi &  vecLabelIdsRightHemi,
const QList< FSLIB::Label > &  lLabelsLeftHemi,
const QList< FSLIB::Label > &  lLabelsRightHemi,
const Eigen::VectorXi &  vecVertNoLeft,
const Eigen::VectorXi &  vecVertNoRight 
)

Set annotation info.

Parameters
[in]vecLabelIdsLeftHemiThe labels ids for each of the left hemipshere surface vertex idx.
[in]vecLabelIdsRightHemiThe labels ids for each of the right hemipshere surface vertex idx.
[in]lLabelsLeftHemiThe label information for the left hemisphere.
[in]lLabelsRightHemiThe label information for the right hemisphere.
[in]vecVertNoLeftThe vertNos for the left hemisphere.
[in]vecVertNoRightThe vertNos for the right hemisphere.

Definition at line 269 of file rtsourcedatacontroller.cpp.

◆ setCancelDistance()

void RtSourceDataController::setCancelDistance ( double  dCancelDist)

This function sets the cancel distance used in distance calculations for the interpolation. Distances higher than this are ignored, i.e. the respective coefficients are set to zero. Warning: Using this function can take some seconds because recalculation are required.

Parameters
[in]dCancelDistThe new cancel distance value in meters.

Definition at line 212 of file rtsourcedatacontroller.cpp.

◆ setColormapType()

void RtSourceDataController::setColormapType ( const QString &  sColormapType)

Set the type of the colormap.

Parameters
[in]sColormapTypeThe new colormap type.

Definition at line 301 of file rtsourcedatacontroller.cpp.

◆ setInterpolationFunction()

void RtSourceDataController::setInterpolationFunction ( const QString &  sInterpolationFunction)

This function sets the function that is used in the interpolation process. Warning: Using this function can take some seconds because recalculation are required.

Parameters
[in]sInterpolationFunctionFunction that computes interpolation coefficients using the distance values.

Definition at line 198 of file rtsourcedatacontroller.cpp.

◆ setInterpolationInfo()

void RtSourceDataController::setInterpolationInfo ( const Eigen::MatrixX3f &  matVerticesLeft,
const Eigen::MatrixX3f &  matVerticesRight,
const QVector< QVector< int > > &  vecNeighborVerticesLeft,
const QVector< QVector< int > > &  vecNeighborVerticesRight,
const Eigen::VectorXi &  vecVertNoLeftHemi,
const Eigen::VectorXi &  vecVertNoRightHemi 
)

Sets the interpoaltion inforamtion about the surfaces etc. Warning: Using this function can take some seconds because recalculation are required.

Parameters
[in]matVerticesLeftThe surface vertices in 3D space for the left hemisphere.
[in]matVerticesRightThe surface vertices in 3D space for the right hemisphere.
[in]vecNeighborVerticesLeftThe neighbor vertices for the left hemisphere.
[in]vecNeighborVerticesRightThe neighbor vertices for the right hemisphere.
[in]vecVertNoLeftHemiThe vertex indexes for the left hemipshere.
[in]vecVertNoRightHemiThe vertex indexes for the right hemipshere.

Definition at line 232 of file rtsourcedatacontroller.cpp.

◆ setLoopState()

void RtSourceDataController::setLoopState ( bool  bLoopState)

Set the loop functionality on or off.

Parameters
[in]bLoopStateThe new looping state.

Definition at line 205 of file rtsourcedatacontroller.cpp.

◆ setNumberAverages()

void RtSourceDataController::setNumberAverages ( int  iNumAvr)

Set the number of averages.

Parameters
[in]iNumAvrThe new number of averages.

Definition at line 308 of file rtsourcedatacontroller.cpp.

◆ setSFreq()

void RtSourceDataController::setSFreq ( double  dSFreq)

Set the sampling frequency.

Parameters
[in]dSFreqThe new sampling frequency.

Definition at line 315 of file rtsourcedatacontroller.cpp.

◆ setStreamingState()

void RtSourceDataController::setStreamingState ( bool  bStreamingState)

Set the streaming state (start/stop streaming).

Parameters
[in]bStreamingStateThe new straming state.

Definition at line 187 of file rtsourcedatacontroller.cpp.

◆ setStreamSmoothedData()

void RtSourceDataController::setStreamSmoothedData ( bool  bStreamSmoothedData)

Sets the state whether to stream smoothed or raw data

Parameters
[in]bStreamSmoothedDataThe new state.

Definition at line 322 of file rtsourcedatacontroller.cpp.

◆ setSurfaceColor()

void RtSourceDataController::setSurfaceColor ( const Eigen::MatrixX4f &  matColorLeft,
const Eigen::MatrixX4f &  matColorRight 
)

Set the color of the vertices for the left and right hemisphere.

Parameters
[in]matColorLeftThe color of the vertices for the left hemisphere.
[in]matColorRightThe color of the vertices for the right hemisphere.

Definition at line 260 of file rtsourcedatacontroller.cpp.

◆ setThresholds()

void RtSourceDataController::setThresholds ( const QVector3D &  vecThresholds)

Set the normalization value.

Parameters
[in]vecThresholdsThe new threshold values used for normalizing the data.

Definition at line 287 of file rtsourcedatacontroller.cpp.

◆ setTimeInterval()

void RtSourceDataController::setTimeInterval ( int  iMSec)

Set the time in MSec to wait inbetween data samples.

Parameters
[in]iMSecThe new length in milli Seconds to wait inbetween data samples.

Definition at line 219 of file rtsourcedatacontroller.cpp.

◆ setVisualizationType()

void RtSourceDataController::setVisualizationType ( int  iVisType)

Set the visualization type.

Parameters
[in]iVisTypeThe new visualization type.

Definition at line 294 of file rtsourcedatacontroller.cpp.

◆ sFreqChanged

void DISP3DLIB::RtSourceDataController::sFreqChanged ( double  dSFreq)
signal

Emit this signal whenever the sampling frequency changed.

Parameters
[in]dSFreqThe new sampling frequency.

◆ streamSmoothedDataChanged

void DISP3DLIB::RtSourceDataController::streamSmoothedDataChanged ( bool  bStreamSmoothedData)
signal

Emit this signal whenever the fiff info changed.

Parameters
[in]infoThe fiff info including the new bad channels.

◆ surfaceColorChanged

void DISP3DLIB::RtSourceDataController::surfaceColorChanged ( const Eigen::MatrixX4f &  matColorLeft,
const Eigen::MatrixX4f &  matColorRight 
)
signal

Emit this signal whenever the color of the vertices for the left and right hemisphere changed.

Parameters
[in]matColorLeftThe color of the vertices for the left hemisphere.
[in]matColorRightThe color of the vertices for the right hemisphere.

◆ thresholdsChanged

void DISP3DLIB::RtSourceDataController::thresholdsChanged ( const QVector3D &  vecThresholds)
signal

Emit this signal whenever the thresholds changed.

Parameters
[in]vecThresholdsThe new threshold values used for normalizing the data.

◆ visualizationTypeChanged

void DISP3DLIB::RtSourceDataController::visualizationTypeChanged ( int  iVisType)
signal

Emit this signal whenever the visualization type changed.

Parameters
[in]iVisTypeThe new visualization type.

Member Data Documentation

◆ m_iMSecInterval

int DISP3DLIB::RtSourceDataController::m_iMSecInterval
protected

Length in milli Seconds to wait inbetween data samples.

Definition at line 297 of file rtsourcedatacontroller.h.

◆ m_pRtInterpolationLeftWorker

QPointer<RtSourceInterpolationMatWorker> DISP3DLIB::RtSourceDataController::m_pRtInterpolationLeftWorker
protected

The pointer to the RtSourceInterpolationMatWorker, which is running in the m_rtInterpolationLeftHemiWorkerThread thread for the left hemisphere.

Definition at line 294 of file rtsourcedatacontroller.h.

◆ m_pRtInterpolationRightWorker

QPointer<RtSourceInterpolationMatWorker> DISP3DLIB::RtSourceDataController::m_pRtInterpolationRightWorker
protected

The pointer to the RtSourceInterpolationMatWorker, which is running in the m_rtInterpolationRightHemiWorkerThread thread for the right hemisphere.

Definition at line 295 of file rtsourcedatacontroller.h.

◆ m_pRtSourceDataWorker

QPointer<RtSourceDataWorker> DISP3DLIB::RtSourceDataController::m_pRtSourceDataWorker
protected

The pointer to the RtSourceDataWorker, which is running in the m_rtSourceDataWorkerThread thread.

Definition at line 293 of file rtsourcedatacontroller.h.

◆ m_rtInterpolationLeftWorkerThread

QThread DISP3DLIB::RtSourceDataController::m_rtInterpolationLeftWorkerThread
protected

The RtSourceInterpolationMatWorker thread for the left hemisphere.

Definition at line 290 of file rtsourcedatacontroller.h.

◆ m_rtInterpolationRightWorkerThread

QThread DISP3DLIB::RtSourceDataController::m_rtInterpolationRightWorkerThread
protected

The RtSourceInterpolationMatWorker thread for the right hemisphere.

Definition at line 291 of file rtsourcedatacontroller.h.

◆ m_rtSourceDataWorkerThread

QThread DISP3DLIB::RtSourceDataController::m_rtSourceDataWorkerThread
protected

The RtSourceDataWorker thread.

Definition at line 289 of file rtsourcedatacontroller.h.

◆ m_timer

QTimer DISP3DLIB::RtSourceDataController::m_timer
protected

The timer to control the streaming speed.

Definition at line 287 of file rtsourcedatacontroller.h.


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