v2.0.0
Loading...
Searching...
No Matches
RTPROCESSINGLIB Namespace Reference

Classes

class  RtAveragingWorker
 Background worker thread that accumulates and averages epochs in real time. More...
class  RtAveraging
 Controller that manages RtAveragingWorker for online epoch averaging with baseline correction. More...
class  RtConnectivityWorker
 Background worker thread that computes functional connectivity metrics in real time. More...
class  RtConnectivity
 Controller that manages RtConnectivityWorker for online connectivity computation. More...
struct  RtCovComputeResult
 Bundled output of a real-time covariance computation step containing the covariance matrix and sample count. More...
class  RtCov
 Controller that manages background covariance matrix estimation from streaming data. More...
struct  FilterObject
 Lightweight filter configuration holding kernel coefficients and overlap-add state for one channel. More...
class  FilterOverlapAdd
 Applies FIR filtering via FFT-based overlap-add convolution for continuous data streams. More...
class  RtHpiWorker
 Background worker thread that runs continuous HPI coil localization. More...
class  RtHpi
 Controller that manages RtHpiWorker for continuous head position tracking. More...
struct  RtInvOpInput
 Input bundle for the real-time inverse operator worker containing noise covariance, forward solution, and settings. More...
class  RtInvOpWorker
 Background worker thread that recomputes the MNE inverse operator when covariance updates arrive. More...
class  RtInvOp
 Controller that manages RtInvOpWorker for online inverse operator updates. More...
class  RtNoiseWorker
 Background worker that computes a noise power spectral density estimate from accumulated data blocks. More...
class  RtNoise
 Controller that manages RtNoiseWorker for real-time noise spectrum estimation. More...

Functions

DSPSHARED_EXPORT QList< Eigen::MatrixXi > toEventMatrix (QMap< int, QList< QPair< int, double > > > mapTriggers)
DSPSHARED_EXPORT QMap< int, QList< QPair< int, double > > > detectTriggerFlanksMax (const Eigen::MatrixXd &data, const QList< int > &lTriggerChannels, int iOffsetIndex, double dThreshold, bool bRemoveOffset, int iBurstLengthSamp=100)
DSPSHARED_EXPORT QList< QPair< int, double > > detectTriggerFlanksMax (const Eigen::MatrixXd &data, int iTriggerChannelIdx, int iOffsetIndex, double dThreshold, bool bRemoveOffset, int iBurstLengthSamp=100)
DSPSHARED_EXPORT QMap< int, QList< QPair< int, double > > > detectTriggerFlanksGrad (const Eigen::MatrixXd &data, const QList< int > &lTriggerChannels, int iOffsetIndex, double dThreshold, bool bRemoveOffset, const QString &type, int iBurstLengthSamp=100)
DSPSHARED_EXPORT QList< QPair< int, double > > detectTriggerFlanksGrad (const Eigen::MatrixXd &data, int iTriggerChannelIdx, int iOffsetIndex, double dThreshold, bool bRemoveOffset, const QString &type, int iBurstLengthSamp=100)
DSPSHARED_EXPORT bool filterFile (QIODevice &pIODevice, QSharedPointer< FIFFLIB::FiffRawData > pFiffRawData, int type, double dCenterfreq, double dBandwidth, double dTransition, double dSFreq, int iOrder=4096, int designMethod=UTILSLIB::FilterKernel::m_designMethods.indexOf(UTILSLIB::FilterParameter("Cosine")), const Eigen::RowVectorXi &vecPicks=Eigen::RowVectorXi(), bool bUseThreads=true)
DSPSHARED_EXPORT bool filterFile (QIODevice &pIODevice, QSharedPointer< FIFFLIB::FiffRawData > pFiffRawData, const UTILSLIB::FilterKernel &filterKernel, const Eigen::RowVectorXi &vecPicks=Eigen::RowVectorXi(), bool bUseThreads=false)
DSPSHARED_EXPORT Eigen::MatrixXd filterData (const Eigen::MatrixXd &matData, int type, double dCenterfreq, double dBandwidth, double dTransition, double dSFreq, int iOrder=1024, int designMethod=UTILSLIB::FilterKernel::m_designMethods.indexOf(UTILSLIB::FilterParameter("Cosine")), const Eigen::RowVectorXi &vecPicks=Eigen::RowVectorXi(), bool bUseThreads=true, bool bKeepOverhead=false)
DSPSHARED_EXPORT Eigen::MatrixXd filterData (const Eigen::MatrixXd &matData, const UTILSLIB::FilterKernel &filterKernel, const Eigen::RowVectorXi &vecPicks=Eigen::RowVectorXi(), bool bUseThreads=true, bool bKeepOverhead=false)
DSPSHARED_EXPORT Eigen::MatrixXd filterDataBlock (const Eigen::MatrixXd &matData, const Eigen::RowVectorXi &vecPicks, const UTILSLIB::FilterKernel &filterKernel, bool bUseThreads=true)
DSPSHARED_EXPORT void filterChannel (FilterObject &channelDataTime)
DSPSHARED_EXPORT FIFFLIB::FiffEvoked computeFilteredAverage (const FIFFLIB::FiffRawData &raw, const Eigen::MatrixXi &matEvents, float fTMinS, float fTMaxS, qint32 eventType, bool bApplyBaseline, float fTBaselineFromS, float fTBaselineToS, const QMap< QString, double > &mapReject, const UTILSLIB::FilterKernel &filterKernel, const QStringList &lExcludeChs=QStringList(), const Eigen::RowVectorXi &vecPicks=Eigen::RowVectorXi())

Function Documentation

◆ computeFilteredAverage()

DSPSHARED_EXPORT FIFFLIB::FiffEvoked RTPROCESSINGLIB::computeFilteredAverage ( const FIFFLIB::FiffRawData & raw,
const Eigen::MatrixXi & matEvents,
float fTMinS,
float fTMaxS,
qint32 eventType,
bool bApplyBaseline,
float fTBaselineFromS,
float fTBaselineToS,
const QMap< QString, double > & mapReject,
const UTILSLIB::FilterKernel & filterKernel,
const QStringList & lExcludeChs = QStringList(),
const Eigen::RowVectorXi & vecPicks = Eigen::RowVectorXi() )

Computes the filtered average for given fiff raw data. Reads epochs, filters each one, applies baseline correction and artifact rejection, then returns the averaged evoked response.

Parameters
[in]rawThe raw data.
[in]matEventsThe events provided in samples and event kinds.
[in]fTMinSThe start time relative to the event in seconds.
[in]fTMaxSThe end time relative to the event in seconds.
[in]eventTypeThe event type.
[in]bApplyBaselineWhether to use baseline correction (mode=mean).
[in]fTBaselineFromSThe start baseline correction time relative to the event in seconds.
[in]fTBaselineToSThe end baseline correction time relative to the event in seconds.
[in]mapRejectThe thresholds per channel type to reject epochs.
[in]filterKernelThe filter kernel to use when reading the fiff raw data.
[in]lExcludeChsList of channel names to exclude.
[in]vecPicksWhich channels to pick.
Returns
The filtered, averaged evoked data.

◆ detectTriggerFlanksGrad() [1/2]

DSPSHARED_EXPORT QMap< int, QList< QPair< int, double > > > RTPROCESSINGLIB::detectTriggerFlanksGrad ( const Eigen::MatrixXd & data,
const QList< int > & lTriggerChannels,
int iOffsetIndex,
double dThreshold,
bool bRemoveOffset,
const QString & type,
int iBurstLengthSamp = 100 )

detectTriggerFlanksGrad detects flanks from a given data matrix in row wise order. This function uses a simple gradient to locate the triggers.

Parameters
[in]datathe data used to find the trigger flanks.
[in]lTriggerChannelsThe indeces of the trigger channels.
[in]iOffsetIndexthe offset index gets added to the found trigger flank index.
[in]iThresholdthe gradient threshold value used to find the trigger flank.
[in]bRemoveOffsetremove the first sample as offset.
[in]typedetect rising or falling flank. Use "Rising" or "Falling" as input.
[in]iBurstLengthMsThe length in samples which is skipped after a trigger was found.
Returns
This map holds the indices of the channels which are to be read from data. For each index/channel the found triggers and corresponding signal values are written to the value of the map.

◆ detectTriggerFlanksGrad() [2/2]

DSPSHARED_EXPORT QList< QPair< int, double > > RTPROCESSINGLIB::detectTriggerFlanksGrad ( const Eigen::MatrixXd & data,
int iTriggerChannelIdx,
int iOffsetIndex,
double dThreshold,
bool bRemoveOffset,
const QString & type,
int iBurstLengthSamp = 100 )

detectTriggerFlanksGrad detects flanks from a given data matrix in row wise order. This function uses a simple gradient to locate the triggers.

Parameters
[in]datathe data used to find the trigger flanks.
[in]iTriggerChannelIdxthe index of the trigger channel in the matrix.
[in]iOffsetIndexthe offset index gets added to the found trigger flank index.
[in]iThresholdthe gradient threshold value used to find the trigger flank.
[in]bRemoveOffsetremove the first sample as offset.
[in]typedetect rising or falling flank. Use "Rising" or "Falling" as input.
[in]iBurstLengthMsThe length in samples which is skipped after a trigger was found.
Returns
This list holds the found trigger indices and corresponding signal values.

◆ detectTriggerFlanksMax() [1/2]

DSPSHARED_EXPORT QMap< int, QList< QPair< int, double > > > RTPROCESSINGLIB::detectTriggerFlanksMax ( const Eigen::MatrixXd & data,
const QList< int > & lTriggerChannels,
int iOffsetIndex,
double dThreshold,
bool bRemoveOffset,
int iBurstLengthSamp = 100 )

detectTriggerFlanks detects flanks from a given data matrix in row wise order. This function uses a simple maxCoeff function implemented by eigen to locate the triggers.

Parameters
[in]datathe data used to find the trigger flanks.
[in]lTriggerChannelsThe indeces of the trigger channels.
[in]iOffsetIndexthe offset index gets added to the found trigger flank index.
[in]dThresholdthe signal threshold value used to find the trigger flank.
[in]bRemoveOffsetremove the first sample as offset.
[in]iBurstLengthMsThe length in samples which is skipped after a trigger was found.
Returns
This map holds the indices of the channels which are to be read from data. For each index/channel the found triggersand corresponding signal values are written to the value of the map.

◆ detectTriggerFlanksMax() [2/2]

DSPSHARED_EXPORT QList< QPair< int, double > > RTPROCESSINGLIB::detectTriggerFlanksMax ( const Eigen::MatrixXd & data,
int iTriggerChannelIdx,
int iOffsetIndex,
double dThreshold,
bool bRemoveOffset,
int iBurstLengthSamp = 100 )

detectTriggerFlanks detects flanks from a given data matrix in row wise order. This function uses a simple maxCoeff function implemented by eigen to locate the triggers.

Parameters
[in]datathe data used to find the trigger flanks.
[in]iTriggerChannelIdxthe index of the trigger channel in the matrix.
[in]iOffsetIndexthe offset index gets added to the found trigger flank index.
[in]dThresholdthe signal threshold value used to find the trigger flank.
[in]bRemoveOffsetremove the first sample as offset.
[in]iBurstLengthMsThe length in samples which is skipped after a trigger was found.
Returns
This list holds the found trigger indices and corresponding signal values.

◆ filterChannel()

void RTPROCESSINGLIB::filterChannel ( RTPROCESSINGLIB::FilterObject & channelDataTime)

This function is used to filter row-wise in parallel threads

Parameters
[in]channelDataTimeThe channel data to perform the filtering on.

Definition at line 378 of file rt_filter.cpp.

◆ filterData() [1/2]

DSPSHARED_EXPORT Eigen::MatrixXd RTPROCESSINGLIB::filterData ( const Eigen::MatrixXd & matData,
const UTILSLIB::FilterKernel & filterKernel,
const Eigen::RowVectorXi & vecPicks = Eigen::RowVectorXi(),
bool bUseThreads = true,
bool bKeepOverhead = false )

Calculates the filtered version of the raw input data based on a given list filters. The data needs to be present all at once. For continuous filtering via overlap add use the FilterOverlapAdd class.

Parameters
[in]matDataThe data which is to be filtered.
[in]filterKernelThe list of filter kernels to use.
[in]vecPicksChannel indexes to filter. Default is filter all channels.
[in]bUseThreadsWhether to use multiple threads. Default is set to true.
[in]bKeepOverheadWhether to keep the delayed part of the data after filtering. Default is set to false .
Returns
The filtered data in form of a matrix.

◆ filterData() [2/2]

DSPSHARED_EXPORT Eigen::MatrixXd RTPROCESSINGLIB::filterData ( const Eigen::MatrixXd & matData,
int type,
double dCenterfreq,
double dBandwidth,
double dTransition,
double dSFreq,
int iOrder = 1024,
int designMethod = UTILSLIB::FilterKernel::m_designMethods.indexOf(UTILSLIB::FilterParameter("Cosine")),
const Eigen::RowVectorXi & vecPicks = Eigen::RowVectorXi(),
bool bUseThreads = true,
bool bKeepOverhead = false )

Creates a user designed filter kernel and filters the raw input data. The data needs to be present all at once. For continuous filtering via overlap add use the FilterOverlapAdd class.

Parameters
[in]matDataThe data which is to be filtered.
[in]typeThe type of the filter: LPF, HPF, BPF, NOTCH (from enum FilterType).
[in]dCenterfreqThe center of the frequency.
[in]dBandwidthThe filter bandwidth. Ignored if FilterType is set to LPF,HPF. If NOTCH/BPF: bandwidth of stop-/passband.
[in]dTransitionThe transition band determines the width of the filter slopes (steepness).
[in]dSFreqThe input data sampling frequency.
[in]iOrderRepresents the order of the filter, the higher the higher is the stopband attenuation. Default is 1024 taps.
[in]designMethodThe design method to use. Choose between Cosine and Tschebyscheff. Default is set to Cosine.
[in]vecPicksChannel indexes to filter. Default is filter all channels.
[in]bUseThreadsWhether to use multiple threads. Default is set to true.
[in]bKeepOverheadWhether to keep the delayed part of the data after filtering. Default is set to false .
Returns
The filtered data in form of a matrix.

◆ filterDataBlock()

DSPSHARED_EXPORT Eigen::MatrixXd RTPROCESSINGLIB::filterDataBlock ( const Eigen::MatrixXd & matData,
const Eigen::RowVectorXi & vecPicks,
const UTILSLIB::FilterKernel & filterKernel,
bool bUseThreads = true )

Calculates the filtered version of the raw input data block. Always returns the data with half the filter length delay in the front and back.

Parameters
[in]matDataThe data which is to be filtered.
[in]vecPicksThe used channel as index in RowVector.
[in]filterKernelThe FilterKernel to filter the data with.
[in]bUseThreadsWhether to use multiple threads.
Returns
The filtered data in form of a matrix with half the filter length delay in the front and back.

◆ filterFile() [1/2]

DSPSHARED_EXPORT bool RTPROCESSINGLIB::filterFile ( QIODevice & pIODevice,
QSharedPointer< FIFFLIB::FiffRawData > pFiffRawData,
const UTILSLIB::FilterKernel & filterKernel,
const Eigen::RowVectorXi & vecPicks = Eigen::RowVectorXi(),
bool bUseThreads = false )

Filters data from an input file based on an existing filter kernel and writes the filtered data to a pIODevice.

Parameters
[in]pIODeviceThe IO device to write to.
[in]pFiffRawDataThe fiff raw data object to read from.
[in]filterKernelThe list of filter kernels to use.
[in]vecPicksChannel indexes to filter. Default is filter all channels.
[in]bUseThreadsWhether to use multiple threads. Default is set to true.
Returns
Returns true if successful, false otherwise.

◆ filterFile() [2/2]

DSPSHARED_EXPORT bool RTPROCESSINGLIB::filterFile ( QIODevice & pIODevice,
QSharedPointer< FIFFLIB::FiffRawData > pFiffRawData,
int type,
double dCenterfreq,
double dBandwidth,
double dTransition,
double dSFreq,
int iOrder = 4096,
int designMethod = UTILSLIB::FilterKernel::m_designMethods.indexOf(UTILSLIB::FilterParameter("Cosine")),
const Eigen::RowVectorXi & vecPicks = Eigen::RowVectorXi(),
bool bUseThreads = true )

Creates a user designed filter kernel, filters data from an input file and writes the filtered data to a pIODevice.

Parameters
[in]pIODeviceThe IO device to write to.
[in]pFiffRawDataThe fiff raw data object to read from.
[in]typeThe type of the filter: LPF, HPF, BPF, NOTCH (from enum FilterType).
[in]dCenterfreqThe center of the frequency.
[in]dBandwidthThe filter bandwidth. Ignored if FilterType is set to LPF,HPF. If NOTCH/BPF: bandwidth of stop-/passband.
[in]dTransitionThe transition band determines the width of the filter slopes (steepness).
[in]dSFreqThe input data sampling frequency.
[in]iOrderRepresents the order of the filter, the higher the higher is the stopband attenuation. Default is 4096 taps.
[in]designMethodThe design method to use. Choose between Cosine and Tschebyscheff. Default is set to Cosine.
[in]vecPicksChannel indexes to filter. Default is filter all channels.
[in]bUseThreadsWhether to use multiple threads. Default is set to true.
Returns
Returns true if successful, false otherwise.

◆ toEventMatrix()

QList< MatrixXi > RTPROCESSINGLIB::toEventMatrix ( QMap< int, QList< QPair< int, double > > > mapTriggers)

Transforms QMap with stored information about events per stim channel to a list of event matrices.

Parameters
[in]mapTriggersThe QMap to be transformed.
[in]Alist of transformed Eigen matrices.

Definition at line 58 of file rt_detect_trigger.cpp.