Real-time signal processing (filtering, averaging, HPI fitting, noise reduction). More...
Classes | |
| struct | FilterObject |
| class | FilterOverlapAdd |
| Filtering with FFT convolution and the overlap add method for continous data streams. More... | |
| class | CosineFilter |
| Creates a cosine filter response in the frequency domain. More... | |
| class | FilterIO |
| Processes txt files which hold filter coefficients. More... | |
| class | FilterParameter |
| The FilterParameter class. More... | |
| class | FilterKernel |
| The FilterKernel class provides methods to create/design a FIR filter kernel. More... | |
| class | ParksMcClellan |
| The ParksMcClellan class provides the ParksMcClellan filter desing algorithm. More... | |
| class | RtAveragingWorker |
| Real-time averaging worker. More... | |
| class | RtAveraging |
| Real-time averaging. More... | |
| class | RtConnectivityWorker |
| Real-time connectivity worker. More... | |
| class | RtConnectivity |
| Real-time connectivity estimation. More... | |
| struct | RtCovComputeResult |
| class | RtCov |
| Real-time covariance worker. More... | |
| class | RtHpiWorker |
| Real-time HPI worker. More... | |
| class | RtHpi |
| Real-time Head Coil Positions estimation. More... | |
| struct | RtInvOpInput |
| class | RtInvOpWorker |
| Real-time inverse operator worker. More... | |
| class | RtInvOp |
| Real-time inverse operator estimation. More... | |
| class | RtNoise |
| Real-time Noise estimation. More... | |
Functions | |
| FIFFLIB::FiffEvoked | computeAverage (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 QStringList &lExcludeChs=QStringList(), const Eigen::RowVectorXi &vecPicks=Eigen::RowVectorXi()) |
| 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 FilterKernel &filterKernel, const QStringList &lExcludeChs=QStringList(), const Eigen::RowVectorXi &vecPicks=Eigen::RowVectorXi()) |
| QList< Eigen::MatrixXi > | toEventMatrix (QMap< int, QList< QPair< int, double > > > mapTriggers) |
| QMap< int, QList< QPair< int, double > > > | detectTriggerFlanksMax (const Eigen::MatrixXd &data, const QList< int > &lTriggerChannels, int iOffsetIndex, double dThreshold, bool bRemoveOffset, int iBurstLengthSamp=100) |
| QList< QPair< int, double > > | detectTriggerFlanksMax (const Eigen::MatrixXd &data, int iTriggerChannelIdx, int iOffsetIndex, double dThreshold, bool bRemoveOffset, int iBurstLengthSamp=100) |
| 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) |
| QList< QPair< int, double > > | detectTriggerFlanksGrad (const Eigen::MatrixXd &data, int iTriggerChannelIdx, int iOffsetIndex, double dThreshold, bool bRemoveOffset, const QString &type, int iBurstLengthSamp=100) |
| bool | filterFile (QIODevice &pIODevice, QSharedPointer< FIFFLIB::FiffRawData > pFiffRawData, int type, double dCenterfreq, double dBandwidth, double dTransition, double dSFreq, int iOrder=4096, int designMethod=FilterKernel::m_designMethods.indexOf(FilterParameter("Cosine")), const Eigen::RowVectorXi &vecPicks=Eigen::RowVectorXi(), bool bUseThreads=true) |
| bool | filterFile (QIODevice &pIODevice, QSharedPointer< FIFFLIB::FiffRawData > pFiffRawData, const RTPROCESSINGLIB::FilterKernel &filterKernel, const Eigen::RowVectorXi &vecPicks=Eigen::RowVectorXi(), bool bUseThreads=false) |
| Eigen::MatrixXd | filterData (const Eigen::MatrixXd &matData, int type, double dCenterfreq, double dBandwidth, double dTransition, double dSFreq, int iOrder=1024, int designMethod=FilterKernel::m_designMethods.indexOf(FilterParameter("Cosine")), const Eigen::RowVectorXi &vecPicks=Eigen::RowVectorXi(), bool bUseThreads=true, bool bKeepOverhead=false) |
| Eigen::MatrixXd | filterData (const Eigen::MatrixXd &mataData, const RTPROCESSINGLIB::FilterKernel &filterKernel, const Eigen::RowVectorXi &vecPicks=Eigen::RowVectorXi(), bool bUseThreads=true, bool bKeepOverhead=false) |
| Eigen::MatrixXd | filterDataBlock (const Eigen::MatrixXd &mataData, const Eigen::RowVectorXi &vecPicks, const RTPROCESSINGLIB::FilterKernel &filterKernel, bool bUseThreads=true) |
| void | filterChannel (FilterObject &channelDataTime) |
| bool | performIcp (const QSharedPointer< MNELIB::MNEProjectToSurface > mneSurfacePoints, const Eigen::MatrixXf &matPointCloud, FIFFLIB::FiffCoordTrans &transFromTo, float &fRMSE, bool bScale=false, int iMaxIter=20, float fTol=0.001, const Eigen::VectorXf &vecWeitgths=vecDefaultWeigths) |
| bool | fitMatchedPoints (const Eigen::MatrixXf &matSrcPoint, const Eigen::MatrixXf &matDstPoint, Eigen::Matrix4f &matTrans, float fScale=1.0, bool bScale=false, const Eigen::VectorXf &vecWeitgths=vecDefaultWeigths) |
| bool | discard3DPointOutliers (const QSharedPointer< MNELIB::MNEProjectToSurface > mneSurfacePoints, const Eigen::MatrixXf &matPointCloud, const FIFFLIB::FiffCoordTrans &transFromTo, Eigen::VectorXi &vecTake, Eigen::MatrixXf &matTakePoint, float fMaxDist=0.0) |
| const char * | buildDateTime () |
| const char * | buildHash () |
| const char * | buildHashLong () |
| Eigen::MatrixXd | makeSpharaProjector (const Eigen::MatrixXd &matBaseFct, const Eigen::VectorXi &vecIndices, int iOperatorDim, int iNBaseFct, int iSkip=0) |
Variables | |
| const Eigen::VectorXf | vecDefaultWeigths |
Real-time signal processing (filtering, averaging, HPI fitting, noise reduction).
| const char * RTPROCESSINGLIB::buildDateTime | ( | ) |
Returns build date and time.
Definition at line 46 of file rtprocessing_global.cpp.
| const char * RTPROCESSINGLIB::buildHash | ( | ) |
Returns abbreviated build git hash.
Definition at line 50 of file rtprocessing_global.cpp.
| const char * RTPROCESSINGLIB::buildHashLong | ( | ) |
Returns full build git hash.
Definition at line 54 of file rtprocessing_global.cpp.
| FIFFLIB::FiffEvoked RTPROCESSINGLIB::computeAverage | ( | 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 QStringList & | lExcludeChs = QStringList(), | ||
| const Eigen::RowVectorXi & | vecPicks = Eigen::RowVectorXi() ) |
Computes the average for given fiff raw data.
| [in] | raw | The raw data. |
| [in] | matEvents | The events provided in samples and event kinds. |
| [in] | fTMinS | The start time relative to the event in seconds. |
| [in] | fTMaxS | The end time relative to the event in seconds. |
| [in] | eventType | The event type. |
| [in] | bApplyBaseline | Whether to use baseline correction (mode=mean). |
| [in] | fTBaselineFromS | The start baseline correction time relative to the event in seconds. |
| [in] | fTBaselineToS | The end baseline correction time relative to the event in seconds. |
| [in] | mapReject | The thresholds per channel type to reject epochs. |
| [in] | lExcludeChs | List of channel names to exclude. |
| [in] | vecPicks | Which channels to pick. |
| 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 FilterKernel & | filterKernel, | ||
| const QStringList & | lExcludeChs = QStringList(), | ||
| const Eigen::RowVectorXi & | vecPicks = Eigen::RowVectorXi() ) |
Computes the filtered average for given fiff raw data.
| [in] | raw | The raw data. |
| [in] | matEvents | The events provided in samples and event kinds. |
| [in] | fTMinS | The start time relative to the event in seconds. |
| [in] | fTMaxS | The end time relative to the event in seconds. |
| [in] | eventType | The event type. |
| [in] | bApplyBaseline | Whether to use baseline correction (mode=mean). |
| [in] | fTBaselineFromS | The start baseline correction time relative to the event in seconds. |
| [in] | fTBaselineToS | The end baseline correction time relative to the event in seconds. |
| [in] | filterKernel | The filter kernel to use when reading the fiff raw data. |
| [in] | mapReject | The thresholds per channel type to reject epochs. |
| [in] | lExcludeChs | List of channel names to exclude. |
| [in] | vecPicks | Which channels to pick. |
| 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.
| [in] | data | the data used to find the trigger flanks. |
| [in] | lTriggerChannels | The indeces of the trigger channels. |
| [in] | iOffsetIndex | the offset index gets added to the found trigger flank index. |
| [in] | iThreshold | the gradient threshold value used to find the trigger flank. |
| [in] | bRemoveOffset | remove the first sample as offset. |
| [in] | type | detect rising or falling flank. Use "Rising" or "Falling" as input. |
| [in] | iBurstLengthMs | The length in samples which is skipped after a trigger was found. |
| 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.
| [in] | data | the data used to find the trigger flanks. |
| [in] | iTriggerChannelIdx | the index of the trigger channel in the matrix. |
| [in] | iOffsetIndex | the offset index gets added to the found trigger flank index. |
| [in] | iThreshold | the gradient threshold value used to find the trigger flank. |
| [in] | bRemoveOffset | remove the first sample as offset. |
| [in] | type | detect rising or falling flank. Use "Rising" or "Falling" as input. |
| [in] | iBurstLengthMs | The length in samples which is skipped after a trigger was found. |
| 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.
| [in] | data | the data used to find the trigger flanks. |
| [in] | lTriggerChannels | The indeces of the trigger channels. |
| [in] | iOffsetIndex | the offset index gets added to the found trigger flank index. |
| [in] | dThreshold | the signal threshold value used to find the trigger flank. |
| [in] | bRemoveOffset | remove the first sample as offset. |
| [in] | iBurstLengthMs | The length in samples which is skipped after a trigger was found. |
| 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.
| [in] | data | the data used to find the trigger flanks. |
| [in] | iTriggerChannelIdx | the index of the trigger channel in the matrix. |
| [in] | iOffsetIndex | the offset index gets added to the found trigger flank index. |
| [in] | dThreshold | the signal threshold value used to find the trigger flank. |
| [in] | bRemoveOffset | remove the first sample as offset. |
| [in] | iBurstLengthMs | The length in samples which is skipped after a trigger was found. |
| bool RTPROCESSINGLIB::discard3DPointOutliers | ( | const QSharedPointer< MNELIB::MNEProjectToSurface > | mneSurfacePoints, |
| const Eigen::MatrixXf & | matPointCloud, | ||
| const FIFFLIB::FiffCoordTrans & | transFromTo, | ||
| Eigen::VectorXi & | vecTake, | ||
| Eigen::MatrixXf & | matTakePoint, | ||
| float | fMaxDist = 0.0 ) |
Discard outliers compared to a given 3D surface
| [in] | mneSurfacePoints | The MNEProjectToSurface object that contains the surface triangles etc. (To). |
| [in] | matPointCloud | The destination point set to be registrated (From). |
| [in,out] | transFromTo | The forward transformation matrix. |
| [in] | vecTake | The index of taken digitizers. |
| [in] | matTakePoint | The the digitizer points to take. |
| [in] | fMaxDist | The maximum distance to the surface in mm, defaults to 0 mm. |
| void RTPROCESSINGLIB::filterChannel | ( | RTPROCESSINGLIB::FilterObject & | channelDataTime | ) |
This function is used to filter row-wise in parallel threads
| [in] | channelDataTime | The channel data to perform the filtering on. |
Definition at line 376 of file filter.cpp.
| Eigen::MatrixXd RTPROCESSINGLIB::filterData | ( | const Eigen::MatrixXd & | mataData, |
| const RTPROCESSINGLIB::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 continous filtering via overlap add use the FilterOverlapAdd class.
| [in] | mataData | The data which is to be filtered. |
| [in] | filterKernel | The list of filter kernels to use. |
| [in] | vecPicks | Channel indexes to filter. Default is filter all channels. |
| [in] | bUseThreads | Whether to use multiple threads. Default is set to true. |
| [in] | bKeepOverhead | Whether to keep the delayed part of the data after filtering. Default is set to false . |
| Eigen::MatrixXd RTPROCESSINGLIB::filterData | ( | const Eigen::MatrixXd & | matData, |
| int | type, | ||
| double | dCenterfreq, | ||
| double | dBandwidth, | ||
| double | dTransition, | ||
| double | dSFreq, | ||
| int | iOrder = 1024, | ||
| int | designMethod = FilterKernel::m_designMethods.indexOf(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 continous filtering via overlap add use the FilterOverlapAdd class.
| [in] | matData | The data which is to be filtered. |
| [in] | type | The type of the filter: LPF, HPF, BPF, NOTCH (from enum FilterType). |
| [in] | dCenterfreq | The center of the frequency. |
| [in] | dBandwidth | The filter bandwidth. Ignored if FilterType is set to LPF,HPF. If NOTCH/BPF: bandwidth of stop-/passband. |
| [in] | dTransition | The transistion band determines the width of the filter slopes (steepness). |
| [in] | dSFreq | The input data sampling frequency. |
| [in] | iOrder | Represents the order of the filter, the higher the higher is the stopband attenuation. Default is 1024 taps. |
| [in] | designMethod | The design method to use. Choose between Cosine and Tschebyscheff. Defaul is set to Cosine. |
| [in] | vecPicks | Channel indexes to filter. Default is filter all channels. |
| [in] | bUseThreads | Whether to use multiple threads. Default is set to true. |
| [in] | bKeepOverhead | Whether to keep the delayed part of the data after filtering. Default is set to false . |
| Eigen::MatrixXd RTPROCESSINGLIB::filterDataBlock | ( | const Eigen::MatrixXd & | mataData, |
| const Eigen::RowVectorXi & | vecPicks, | ||
| const RTPROCESSINGLIB::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.
| [in] | mataData | The data which is to be filtered. |
| [in] | vecPicks | The used channel as index in RowVector. |
| [in] | filterKernel | The FilterKernel to to filter the data with. |
| [in] | bUseThreads | Whether to use multiple threads. |
| bool RTPROCESSINGLIB::filterFile | ( | QIODevice & | pIODevice, |
| QSharedPointer< FIFFLIB::FiffRawData > | pFiffRawData, | ||
| const RTPROCESSINGLIB::FilterKernel & | filterKernel, | ||
| const Eigen::RowVectorXi & | vecPicks = Eigen::RowVectorXi(), | ||
| bool | bUseThreads = false ) |
Filters data from an input file based on an exisiting filter kernel and writes the filtered data to a pIODevice.
| [in] | pIODevice | The IO device to write to. |
| [in] | pFiffRawData | The fiff raw data object to read from. |
| [in] | filterKernel | The list of filter kernels to use. |
| [in] | vecPicks | Channel indexes to filter. Default is filter all channels. |
| [in] | bUseThreads | hether to use multiple threads. Default is set to true. |
| bool RTPROCESSINGLIB::filterFile | ( | QIODevice & | pIODevice, |
| QSharedPointer< FIFFLIB::FiffRawData > | pFiffRawData, | ||
| int | type, | ||
| double | dCenterfreq, | ||
| double | dBandwidth, | ||
| double | dTransition, | ||
| double | dSFreq, | ||
| int | iOrder = 4096, | ||
| int | designMethod = FilterKernel::m_designMethods.indexOf(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.
| [in] | pIODevice | The IO device to write to. |
| [in] | pFiffRawData | The fiff raw data object to read from. |
| [in] | type | The type of the filter: LPF, HPF, BPF, NOTCH (from enum FilterType). |
| [in] | dCenterfreq | The center of the frequency. |
| [in] | dBandwidth | The filter bandwidth. Ignored if FilterType is set to LPF,HPF. If NOTCH/BPF: bandwidth of stop-/passband. |
| [in] | dTransition | The transistion band determines the width of the filter slopes (steepness). |
| [in] | dSFreq | The input data sampling frequency. |
| [in] | iOrder | Represents the order of the filter, the higher the higher is the stopband attenuation. Default is 4096 taps. |
| [in] | designMethod | The design method to use. Choose between Cosine and Tschebyscheff. Defaul is set to Cosine. |
| [in] | vecPicks | Channel indexes to filter. Default is filter all channels. |
| [in] | bUseThreads | hether to use multiple threads. Default is set to true. |
| bool RTPROCESSINGLIB::fitMatchedPoints | ( | const Eigen::MatrixXf & | matSrcPoint, |
| const Eigen::MatrixXf & | matDstPoint, | ||
| Eigen::Matrix4f & | matTrans, | ||
| float | fScale = 1.0, | ||
| bool | bScale = false, | ||
| const Eigen::VectorXf & | vecWeitgths = vecDefaultWeigths ) |
Corresponding point set registration using quaternions.
| [in] | matSrcPoint | The source point set. |
| [in] | matDstPoint | The destination point set. |
| [in,out] | matTrans | The forward transformation matrix. |
| [in,out] | fScale | The scaling parameter, defaults to 1.0. |
| [in] | bScale | Wether to apply scaling or not. Should be false for matching data sets, defaults to false. |
| [in] | vecWeitgths | The weitghts to apply , defaults to zeros. |
| Eigen::MatrixXd RTPROCESSINGLIB::makeSpharaProjector | ( | const Eigen::MatrixXd & | matBaseFct, |
| const Eigen::VectorXi & | vecIndices, | ||
| int | iOperatorDim, | ||
| int | iNBaseFct, | ||
| int | iSkip = 0 ) |
Constructs a SPHARA operator.
| [in] | matBaseFct | The SPHARA basis functions. |
| [in] | vecIndices | The indices of the positions in the final oeprator which are to be filled with the basis functions weights (i.e. these indices could respond to the indices of gradioemteres in a VectorView system). |
| [in] | iOperatorDim | The dimensions of the final SPHARA operator. Make sure that these correspond to the dimensions of the data matrix you want tol multiply with the SPHARA operator. |
| [in] | iNBaseFct | The number of SPHARA basis functions to take. |
| [in] | iSkip | The value to skip when reading the vecIndices variabel. I.e. use this when dealing with VectorView triplets, which include two gradiometers. |
| bool RTPROCESSINGLIB::performIcp | ( | const QSharedPointer< MNELIB::MNEProjectToSurface > | mneSurfacePoints, |
| const Eigen::MatrixXf & | matPointCloud, | ||
| FIFFLIB::FiffCoordTrans & | transFromTo, | ||
| float & | fRMSE, | ||
| bool | bScale = false, | ||
| int | iMaxIter = 20, | ||
| float | fTol = 0.001, | ||
| const Eigen::VectorXf & | vecWeitgths = vecDefaultWeigths ) |
The ICP algorithm to register a point cloud with a surface.
| [in] | mneSurfacePoints | The MNEProjectToSurface object that contains the surface triangles etc. (To). |
| [in] | matPointCloud | The point cloud to be registrated (From). |
| [in,out] | transFromTo | The forward transformation matrix. It can contain an initial transformatin (e.g. from fiducial alignment). |
| [in,out] | fRMSE | The resulting Root-Mean-Square-Error in m. |
| [in] | bScale | Wether to apply scaling or not. Should be false for matching data sets, defaults to false. |
| [in] | iMaxIter | The maximum number of iterations for the icp algorithms, defaults to 20. |
| [in] | fTol | The destination point set to be reistrated, defaults to 0.001. |
| [in] | vecWeitgths | The weitghts to apply, defaults to zeros. |
| 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.
| [in] | mapTriggers | The QMap to be transformed. |
| [in] | A | list of transformed Eigen matrices. |
Definition at line 58 of file detecttrigger.cpp.