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::RtSensorDataController 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 <rtsensordatacontroller.h>

Public Types

typedef QSharedPointer< RtSensorDataControllerSPtr
 
typedef QSharedPointer< const RtSensorDataControllerConstSPtr
 

Signals

void interpolationInfoChanged (const Eigen::MatrixX3f &matVertices, const QVector< QVector< int > > &vecNeighborVertices, const QVector< Eigen::Vector3f > &vecSensorPos, const FIFFLIB::FiffInfo &fiffInfo, int iSensorType)
 
void numberVerticesChanged (int iNumberVerts)
 
void badChannelsChanged (const FIFFLIB::FiffInfo &info)
 
void streamSmoothedDataChanged (bool bStreamSmoothedData)
 
void interpolationFunctionChanged (const QString &sInterpolationFunction)
 
void cancelDistanceChanged (double dCancelDist)
 
void surfaceColorChanged (const Eigen::MatrixX3f &matSurfaceVertColor)
 
void thresholdsChanged (const QVector3D &vecThresholds)
 
void sFreqChanged (double dSFreq)
 
void numberAveragesChanged (int iNumAvr)
 
void loopStateChanged (bool bLoopState)
 
void colormapTypeChanged (const QString &sColormapType)
 
void rawDataChanged (const Eigen::MatrixXd &data)
 
void newInterpolationMatrixAvailable (QSharedPointer< Eigen::SparseMatrix< float > > pMatInterpolationMatrix)
 
void newRtRawDataAvailable (const Eigen::VectorXd &vecDataVector)
 
void newRtSmoothedDataAvailable (const Eigen::MatrixX4f &matColorMatrix)
 

Public Member Functions

 RtSensorDataController ()
 
 ~RtSensorDataController ()
 
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 &matVertices, const QVector< QVector< int > > &vecNeighborVertices, const QVector< Eigen::Vector3f > &vecSensorPos, const FIFFLIB::FiffInfo &fiffInfo, int iSensorType)
 
void setThresholds (const QVector3D &vecThresholds)
 
void setColormapType (const QString &sColormapType)
 
void setNumberAverages (int iNumAvr)
 
void setSFreq (double dSFreq)
 
void setBadChannels (const FIFFLIB::FiffInfo &info)
 
void setStreamSmoothedData (bool bStreamSmoothedData)
 
void addData (const Eigen::MatrixXd &data)
 

Protected Member Functions

void onNewRtRawData (const Eigen::VectorXd &vecDataVector)
 
void onNewSmoothedRtRawData (const Eigen::MatrixX4f &matColorMatrix)
 
void onNewInterpolationMatrixCalculated (QSharedPointer< Eigen::SparseMatrix< float > > pMatInterpolationMatrix)
 

Protected Attributes

QTimer m_timer
 
QThread m_rtSensorDataWorkerThread
 
QThread m_rtInterpolationWorkerThread
 
QPointer< RtSensorDataWorkerm_pRtSensorDataWorker
 
QPointer< RtSensorInterpolationMatWorkerm_pRtInterpolationWorker
 
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 86 of file rtsensordatacontroller.h.

Inheritance diagram for DISP3DLIB::RtSensorDataController:
Inheritance graph

Member Typedef Documentation

◆ ConstSPtr

Const shared pointer type for RtSensorDataController class.

Definition at line 92 of file rtsensordatacontroller.h.

◆ SPtr

Shared pointer type for RtSensorDataController class.

Definition at line 91 of file rtsensordatacontroller.h.

Constructor & Destructor Documentation

◆ RtSensorDataController()

RtSensorDataController::RtSensorDataController ( )

Default constructor.

Definition at line 65 of file rtsensordatacontroller.cpp.

◆ ~RtSensorDataController()

RtSensorDataController::~RtSensorDataController ( )

Default destructor.

Definition at line 140 of file rtsensordatacontroller.cpp.

Member Function Documentation

◆ addData()

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

Add data which is to be streamed.

Parameters
[in]dataThe new data.

Definition at line 254 of file rtsensordatacontroller.cpp.

◆ badChannelsChanged

void DISP3DLIB::RtSensorDataController::badChannelsChanged ( const FIFFLIB::FiffInfo info)
signal

Emit this signal whenever the bad channels changed.

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

◆ cancelDistanceChanged

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

Emit this signal whenever the cancel distance changed.

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

◆ colormapTypeChanged

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

Emit this signal whenever the colormap changed.

Parameters
[in]sColormapTypeThe new colormap type.

◆ interpolationFunctionChanged

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

Emit this signal whenever the interpolation function changed.

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

◆ interpolationInfoChanged

void DISP3DLIB::RtSensorDataController::interpolationInfoChanged ( const Eigen::MatrixX3f &  matVertices,
const QVector< QVector< int > > &  vecNeighborVertices,
const QVector< Eigen::Vector3f > &  vecSensorPos,
const FIFFLIB::FiffInfo fiffInfo,
int  iSensorType 
)
signal

Emit this signal whenever the interpolation info changed.

Parameters
[in]matVerticesThe vertex information.
[in]vecNeighborVerticesThe neighbor vertex information.
[in]vecSensorPosThe QVector that holds the sensor positons in x, y and z coordinates.
[in]fiffEvokedHolds all information about the sensors.
[in]iSensorTypeType of the sensor: FIFFV_EEG_CH or FIFFV_MEG_CH.

◆ loopStateChanged

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

Emit this signal whenever the loop state changed.

Parameters
[in]bLoopStateThe new looping state.

◆ newInterpolationMatrixAvailable

void DISP3DLIB::RtSensorDataController::newInterpolationMatrixAvailable ( QSharedPointer< Eigen::SparseMatrix< float > >  pMatInterpolationMatrix)
signal

Emit this signal whenever a new interpolation matrix is available.

Parameters
[in]pMatInterpolationMatrixThe new interpolation matrix.

◆ newRtRawDataAvailable

void DISP3DLIB::RtSensorDataController::newRtRawDataAvailable ( const Eigen::VectorXd &  vecDataVector)
signal

Emit this signal whenever a new raw data is streamed.

Parameters
[in]vecDataVectorThe new streamed raw data.

◆ newRtSmoothedDataAvailable

void DISP3DLIB::RtSensorDataController::newRtSmoothedDataAvailable ( const Eigen::MatrixX4f &  matColorMatrix)
signal

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

Parameters
[in]matColorMatrixThe new streamed interpolated raw data in form of RGB colors per vertex.

◆ numberAveragesChanged

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

Emit this signal whenever the number of averages changed.

Parameters
[in]iNumAvrThe new number of averages.

◆ numberVerticesChanged

void DISP3DLIB::RtSensorDataController::numberVerticesChanged ( int  iNumberVerts)
signal

Emit this signal whenever the number of vertices changed.

Parameters
[in]iNumberVertsThe new number of vertices.

◆ onNewInterpolationMatrixCalculated()

void RtSensorDataController::onNewInterpolationMatrixCalculated ( QSharedPointer< Eigen::SparseMatrix< float > >  pMatInterpolationMatrix)
protected

Call this function whenever a new interpolation matrix is available to be dispatched.

Parameters
[in]pMatInterpolationMatrixThe new interpolation matrix data.

Definition at line 275 of file rtsensordatacontroller.cpp.

◆ onNewRtRawData()

void RtSensorDataController::onNewRtRawData ( const Eigen::VectorXd &  vecDataVector)
protected

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

Parameters
[in]vecDataVectorThe new raw data.

Definition at line 261 of file rtsensordatacontroller.cpp.

◆ onNewSmoothedRtRawData()

void RtSensorDataController::onNewSmoothedRtRawData ( const Eigen::MatrixX4f &  matColorMatrix)
protected

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

Parameters
[in]matColorMatrixThe new interpolated data as RGB colors per vertex.

Definition at line 268 of file rtsensordatacontroller.cpp.

◆ rawDataChanged

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

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

Parameters
[in]dataThe new data.

◆ setBadChannels()

void RtSensorDataController::setBadChannels ( const FIFFLIB::FiffInfo info)

Sets bad channels and recalculate interpolation matrix.

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

Definition at line 240 of file rtsensordatacontroller.cpp.

◆ setCancelDistance()

void RtSensorDataController::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 175 of file rtsensordatacontroller.cpp.

◆ setColormapType()

void RtSensorDataController::setColormapType ( const QString &  sColormapType)

Set the type of the colormap.

Parameters
[in]sColormapTypeThe new colormap type.

Definition at line 219 of file rtsensordatacontroller.cpp.

◆ setInterpolationFunction()

void RtSensorDataController::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 161 of file rtsensordatacontroller.cpp.

◆ setInterpolationInfo()

void RtSensorDataController::setInterpolationInfo ( const Eigen::MatrixX3f &  matVertices,
const QVector< QVector< int > > &  vecNeighborVertices,
const QVector< Eigen::Vector3f > &  vecSensorPos,
const FIFFLIB::FiffInfo fiffInfo,
int  iSensorType 
)

Sets the members InterpolationData.bemSurface, InterpolationData.vecSensorPos and m_numSensors. Warning: Using this function can take some seconds because recalculation are required.

Parameters
[in]matVerticesThe vertex information.
[in]vecNeighborVerticesThe neighbor vertex information.
[in]vecSensorPosThe QVector that holds the sensor positons in x, y and z coordinates.
[in]fiffEvokedHolds all information about the sensors.
[in]iSensorTypeType of the sensor: FIFFV_EEG_CH or FIFFV_MEG_CH.
Returns
Returns the created interpolation matrix.

Definition at line 195 of file rtsensordatacontroller.cpp.

◆ setLoopState()

void RtSensorDataController::setLoopState ( bool  bLoopState)

Set the loop functionality on or off.

Parameters
[in]bLoopStateThe new looping state.

Definition at line 168 of file rtsensordatacontroller.cpp.

◆ setNumberAverages()

void RtSensorDataController::setNumberAverages ( int  iNumAvr)

Set the number of averages.

Parameters
[in]iNumAvrThe new number of averages.

Definition at line 226 of file rtsensordatacontroller.cpp.

◆ setSFreq()

void RtSensorDataController::setSFreq ( double  dSFreq)

Set the sampling frequency.

Parameters
[in]dSFreqThe new sampling frequency.

Definition at line 233 of file rtsensordatacontroller.cpp.

◆ setStreamingState()

void RtSensorDataController::setStreamingState ( bool  bStreamingState)

Set the streaming state (start/stop streaming).

Parameters
[in]bStreamingStateThe new straming state.

Definition at line 150 of file rtsensordatacontroller.cpp.

◆ setStreamSmoothedData()

void RtSensorDataController::setStreamSmoothedData ( bool  bStreamSmoothedData)

Sets the state whether to stream smoothed or raw data

Parameters
[in]bStreamSmoothedDataThe new state.

Definition at line 247 of file rtsensordatacontroller.cpp.

◆ setThresholds()

void RtSensorDataController::setThresholds ( const QVector3D &  vecThresholds)

Set the normalization value.

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

Definition at line 212 of file rtsensordatacontroller.cpp.

◆ setTimeInterval()

void RtSensorDataController::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 182 of file rtsensordatacontroller.cpp.

◆ sFreqChanged

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

Emit this signal whenever the sampling frequency changed.

Parameters
[in]dSFreqThe new sampling frequency.

◆ streamSmoothedDataChanged

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

Emit this signal whenever the state to whether stream smoothed/interpolated or raw data changed.

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

◆ surfaceColorChanged

void DISP3DLIB::RtSensorDataController::surfaceColorChanged ( const Eigen::MatrixX3f &  matSurfaceVertColor)
signal

Emit this signal whenever the surface color changed.

Parameters
[in]matSurfaceVertColorThe vertex colors on which the streamed data should be plotted.

◆ thresholdsChanged

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

Emit this signal whenever the thresholds changed.

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

Member Data Documentation

◆ m_iMSecInterval

int DISP3DLIB::RtSensorDataController::m_iMSecInterval
protected

Length in milli Seconds to wait inbetween data samples.

Definition at line 257 of file rtsensordatacontroller.h.

◆ m_pRtInterpolationWorker

QPointer<RtSensorInterpolationMatWorker> DISP3DLIB::RtSensorDataController::m_pRtInterpolationWorker
protected

The pointer to the RtSensorInterpolationMatWorker, which is running in the RtSensorInterpolationMatWorker thread.

Definition at line 255 of file rtsensordatacontroller.h.

◆ m_pRtSensorDataWorker

QPointer<RtSensorDataWorker> DISP3DLIB::RtSensorDataController::m_pRtSensorDataWorker
protected

The pointer to the RtSensorDataWorker, which is running in the RtSensorDataWorker thread.

Definition at line 254 of file rtsensordatacontroller.h.

◆ m_rtInterpolationWorkerThread

QThread DISP3DLIB::RtSensorDataController::m_rtInterpolationWorkerThread
protected

The RtSensorInterpolationMatWorker thread.

Definition at line 252 of file rtsensordatacontroller.h.

◆ m_rtSensorDataWorkerThread

QThread DISP3DLIB::RtSensorDataController::m_rtSensorDataWorkerThread
protected

The RtSensorDataWorker thread.

Definition at line 251 of file rtsensordatacontroller.h.

◆ m_timer

QTimer DISP3DLIB::RtSensorDataController::m_timer
protected

The timer to control the streaming speed.

Definition at line 249 of file rtsensordatacontroller.h.


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