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

Real-time averaging worker. More...

#include <rtaveraging.h>

Signals

void resultReady (const FIFFLIB::FiffEvokedSet &evokedStimSet, const QStringList &lResponsibleTriggerTypes)
 

Public Member Functions

 RtAveragingWorker (quint32 numAverages, quint32 iPreStimSamples, quint32 iPostStimSamples, quint32 iBaselineFromMSecs, quint32 iBaselineToMSecs, quint32 iTriggerIndex, FIFFLIB::FiffInfo::SPtr pFiffInfo)
 
void doWork (const Eigen::MatrixXd &matData)
 
void setAverageNumber (qint32 numAve)
 
void setPreStim (qint32 samples, qint32 secs)
 
void setPostStim (qint32 samples, qint32 secs)
 
void setTriggerChIndx (qint32 idx)
 
void setArtifactReduction (const QMap< QString, double > &mapThresholds)
 
void setBaselineActive (bool activate)
 
void setBaselineFrom (int fromSamp, int fromMSec)
 
void setBaselineTo (int toSamp, int toMSec)
 
void reset ()
 

Protected Member Functions

void doAveraging (const Eigen::MatrixXd &rawSegment)
 
void fillFrontBuffer (const Eigen::MatrixXd &data, double dTriggerType)
 
void emitEvoked (double dTriggerType, QStringList &lResponsibleTriggerTypes)
 
void fillBackBuffer (const Eigen::MatrixXd &data, double dTriggerType)
 
void mergeData (double dTriggerType)
 
void generateEvoked (double dTriggerType)
 
bool controlValuesChanged ()
 

Protected Attributes

qint32 m_iNumAverages
 
qint32 m_iPreStimSamples
 
qint32 m_iNewPreStimSamples
 
qint32 m_iPostStimSamples
 
qint32 m_iNewPostStimSamples
 
qint32 m_iTriggerChIndex
 
qint32 m_iNewTriggerIndex
 
float m_fTriggerThreshold
 
bool m_bActivateThreshold
 
bool m_bDoBaselineCorrection
 
QPair< float, float > m_pairBaselineSec
 
QPair< float, float > m_pairBaselineSamp
 
FIFFLIB::FiffInfo::SPtr m_pFiffInfo
 
FIFFLIB::FiffEvokedSet m_stimEvokedSet
 
QMap< QString, double > m_mapThresholds
 
QMap< double, QList< Eigen::MatrixXd > > m_mapStimAve
 
QMap< double, Eigen::MatrixXd > m_mapDataPre
 
QMap< double, Eigen::MatrixXd > m_mapDataPost
 
QMap< double, qint32 > m_mapMatDataPostIdx
 
QMap< double, bool > m_mapFillingBackBuffer
 

Detailed Description

Real-time averaging worker.

Real-time averaging worker

Definition at line 83 of file rtaveraging.h.

Inheritance diagram for RTPROCESSINGLIB::RtAveragingWorker:
Inheritance graph

Constructor & Destructor Documentation

◆ RtAveragingWorker()

RtAveragingWorker::RtAveragingWorker ( quint32  numAverages,
quint32  iPreStimSamples,
quint32  iPostStimSamples,
quint32  iBaselineFromMSecs,
quint32  iBaselineToMSecs,
quint32  iTriggerIndex,
FIFFLIB::FiffInfo::SPtr  pFiffInfo 
)

Creates the real-time averaging object.

Parameters
[in]numAveragesNumber of evkos to average.
[in]iPreStimSamplesNumber of samples averaged before the stimulus.
[in]iPostStimSamplesNumber of samples averaged after the stimulus (including the stimulus).
[in]iBaselineFromMSecsStart of baseline area which was/is used for correction in msecs.
[in]iBaselineToMSecsEnd of baseline area which was/is used for correction in msecs.
[in]iTriggerIndexRow in dex of channel which is to be scanned for triggers.
[in]pFiffInfoAssociated Fiff Information.

Definition at line 72 of file rtaveraging.cpp.

Member Function Documentation

◆ controlValuesChanged()

bool RTPROCESSINGLIB::RtAveragingWorker::controlValuesChanged ( )
inlineprotected

Check if control values have been changed

Definition at line 465 of file rtaveraging.h.

◆ doAveraging()

void RtAveragingWorker::doAveraging ( const Eigen::MatrixXd &  rawSegment)
protected

do the actual averaging here.

Definition at line 232 of file rtaveraging.cpp.

◆ doWork()

void RtAveragingWorker::doWork ( const Eigen::MatrixXd &  matData)

Perform one single HPI fit.

Parameters
[in]t_matData to estimate the HPI positions from.

Definition at line 106 of file rtaveraging.cpp.

◆ fillBackBuffer()

void RtAveragingWorker::fillBackBuffer ( const Eigen::MatrixXd &  data,
double  dTriggerType 
)
protected

Prepends incoming data to back/post stim buffer.

Definition at line 363 of file rtaveraging.cpp.

◆ fillFrontBuffer()

void RtAveragingWorker::fillFrontBuffer ( const Eigen::MatrixXd &  data,
double  dTriggerType 
)
protected

Prepends incoming data to front/pre stim buffer.

Definition at line 378 of file rtaveraging.cpp.

◆ generateEvoked()

void RtAveragingWorker::generateEvoked ( double  dTriggerType)
protected

Generates the final evoke variable.

Definition at line 457 of file rtaveraging.cpp.

◆ mergeData()

void RtAveragingWorker::mergeData ( double  dTriggerType)
protected

Packs the buffers togehter as one and calcualtes the current running average and emits the result if number of averages has been reached.

Definition at line 419 of file rtaveraging.cpp.

◆ reset()

void RtAveragingWorker::reset ( )

Resets the averaged data stored.

Definition at line 522 of file rtaveraging.cpp.

◆ resultReady

void RTPROCESSINGLIB::RtAveragingWorker::resultReady ( const FIFFLIB::FiffEvokedSet evokedStimSet,
const QStringList &  lResponsibleTriggerTypes 
)
signal

Signal which is emitted when new evoked stimulus data are available.

Parameters
[in]evokedStimSetThe evoked stimulus data set.
[in]lResponsibleTriggerTypesList of all trigger types which lead to the recent emit of a new evoked set.

◆ setArtifactReduction()

void RtAveragingWorker::setArtifactReduction ( const QMap< QString, double > &  mapThresholds)

Sets the artifact reduction

Parameters
[in]mapThresholdsThe new map including the current thresholds for the channels.

Definition at line 176 of file rtaveraging.cpp.

◆ setAverageNumber()

void RtAveragingWorker::setAverageNumber ( qint32  numAve)

Sets the number of averages

Parameters
[in]numAvenew number of averages.

Definition at line 121 of file rtaveraging.cpp.

◆ setBaselineActive()

void RtAveragingWorker::setBaselineActive ( bool  activate)

Sets the baseline correction on or off

Parameters
[in]activateactivate baseline correction.

Definition at line 189 of file rtaveraging.cpp.

◆ setBaselineFrom()

void RtAveragingWorker::setBaselineFrom ( int  fromSamp,
int  fromMSec 
)

Sets the from mSeconds of the baseline area

Parameters
[in]fromSampfrom of baseline area in samples.
[in]fromMSecfrom of baseline area in mSeconds.

Definition at line 206 of file rtaveraging.cpp.

◆ setBaselineTo()

void RtAveragingWorker::setBaselineTo ( int  toSamp,
int  toMSec 
)

Sets the to mSeconds of the baseline area

Parameters
[in]toSampto of baseline area in samples.
[in]toMSecto of baseline area in mSeconds.

Definition at line 219 of file rtaveraging.cpp.

◆ setPostStim()

void RtAveragingWorker::setPostStim ( qint32  samples,
qint32  secs 
)

Sets the number of post stimulus samples

Parameters
[in]samplesnew number of post stimulus samples.
[in]secsnew number of pre stimulus seconds.

Definition at line 160 of file rtaveraging.cpp.

◆ setPreStim()

void RtAveragingWorker::setPreStim ( qint32  samples,
qint32  secs 
)

Sets the number of pre stimulus samples

Parameters
[in]samplesnew number of pre stimulus samples.
[in]secsnew number of pre stimulus seconds.

Definition at line 151 of file rtaveraging.cpp.

◆ setTriggerChIndx()

void RtAveragingWorker::setTriggerChIndx ( qint32  idx)

Sets the index of the trigger channel which is to be scanned fo triggers

Parameters
[in]idxtrigger channel index.

Definition at line 169 of file rtaveraging.cpp.

Member Data Documentation

◆ m_bActivateThreshold

bool RTPROCESSINGLIB::RtAveragingWorker::m_bActivateThreshold
protected

Whether to do threshold artifact reduction or not.

Definition at line 249 of file rtaveraging.h.

◆ m_bDoBaselineCorrection

bool RTPROCESSINGLIB::RtAveragingWorker::m_bDoBaselineCorrection
protected

Whether to perform baseline correction.

Definition at line 251 of file rtaveraging.h.

◆ m_fTriggerThreshold

float RTPROCESSINGLIB::RtAveragingWorker::m_fTriggerThreshold
protected

Threshold to detect trigger.

Definition at line 247 of file rtaveraging.h.

◆ m_iNewPostStimSamples

qint32 RTPROCESSINGLIB::RtAveragingWorker::m_iNewPostStimSamples
protected

New amount of samples averaged after the stimulus, including the stimulus sample.

Definition at line 242 of file rtaveraging.h.

◆ m_iNewPreStimSamples

qint32 RTPROCESSINGLIB::RtAveragingWorker::m_iNewPreStimSamples
protected

New amount of samples averaged before the stimulus.

Definition at line 239 of file rtaveraging.h.

◆ m_iNewTriggerIndex

qint32 RTPROCESSINGLIB::RtAveragingWorker::m_iNewTriggerIndex
protected

Old row index of the data matrix which is to be scanned for triggers.

Definition at line 245 of file rtaveraging.h.

◆ m_iNumAverages

qint32 RTPROCESSINGLIB::RtAveragingWorker::m_iNumAverages
protected

Number of averages.

Definition at line 236 of file rtaveraging.h.

◆ m_iPostStimSamples

qint32 RTPROCESSINGLIB::RtAveragingWorker::m_iPostStimSamples
protected

Amount of samples averaged after the stimulus, including the stimulus sample.

Definition at line 241 of file rtaveraging.h.

◆ m_iPreStimSamples

qint32 RTPROCESSINGLIB::RtAveragingWorker::m_iPreStimSamples
protected

Amount of samples averaged before the stimulus.

Definition at line 238 of file rtaveraging.h.

◆ m_iTriggerChIndex

qint32 RTPROCESSINGLIB::RtAveragingWorker::m_iTriggerChIndex
protected

Current row index of the data matrix which is to be scanned for triggers.

Definition at line 244 of file rtaveraging.h.

◆ m_mapDataPost

QMap<double,Eigen::MatrixXd> RTPROCESSINGLIB::RtAveragingWorker::m_mapDataPost
protected

The matrix holding post stim data.

Definition at line 262 of file rtaveraging.h.

◆ m_mapDataPre

QMap<double,Eigen::MatrixXd> RTPROCESSINGLIB::RtAveragingWorker::m_mapDataPre
protected

The matrix holding pre stim data.

Definition at line 261 of file rtaveraging.h.

◆ m_mapFillingBackBuffer

QMap<double,bool> RTPROCESSINGLIB::RtAveragingWorker::m_mapFillingBackBuffer
protected

Whether the back buffer is currently getting filled.

Definition at line 264 of file rtaveraging.h.

◆ m_mapMatDataPostIdx

QMap<double,qint32> RTPROCESSINGLIB::RtAveragingWorker::m_mapMatDataPostIdx
protected

Current index inside of the matrix m_matDataPost.

Definition at line 263 of file rtaveraging.h.

◆ m_mapStimAve

QMap<double,QList<Eigen::MatrixXd> > RTPROCESSINGLIB::RtAveragingWorker::m_mapStimAve
protected

the current stimulus average buffer. Holds m_iNumAverages vectors.

Definition at line 260 of file rtaveraging.h.

◆ m_mapThresholds

QMap<QString,double> RTPROCESSINGLIB::RtAveragingWorker::m_mapThresholds
protected

Holds the current thresholds for artifact rejection.

Definition at line 259 of file rtaveraging.h.

◆ m_pairBaselineSamp

QPair<float,float> RTPROCESSINGLIB::RtAveragingWorker::m_pairBaselineSamp
protected

Baseline information in samples form where the seconds are seen relative to the trigger, meaning they can also be negative [from to]

Definition at line 254 of file rtaveraging.h.

◆ m_pairBaselineSec

QPair<float,float> RTPROCESSINGLIB::RtAveragingWorker::m_pairBaselineSec
protected

Baseline information in seconds form where the seconds are seen relative to the trigger, meaning they can also be negative [from to]

Definition at line 253 of file rtaveraging.h.

◆ m_pFiffInfo

FIFFLIB::FiffInfo::SPtr RTPROCESSINGLIB::RtAveragingWorker::m_pFiffInfo
protected

Holds the fiff measurement information.

Definition at line 256 of file rtaveraging.h.

◆ m_stimEvokedSet

FIFFLIB::FiffEvokedSet RTPROCESSINGLIB::RtAveragingWorker::m_stimEvokedSet
protected

Holds the evoked information.

Definition at line 257 of file rtaveraging.h.


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