v2.0.0
Loading...
Searching...
No Matches
sss.h
Go to the documentation of this file.
1//=============================================================================================================
47
48#ifndef SSS_DSP_H
49#define SSS_DSP_H
50
51//=============================================================================================================
52// INCLUDES
53//=============================================================================================================
54
55#include "dsp_global.h"
56
57#include <fiff/fiff_info.h>
58
59//=============================================================================================================
60// EIGEN INCLUDES
61//=============================================================================================================
62
63#include <Eigen/Core>
64
65//=============================================================================================================
66// QT INCLUDES
67//=============================================================================================================
68
69#include <QVector>
70
71//=============================================================================================================
72// DEFINE NAMESPACE UTILSLIB
73//=============================================================================================================
74
75namespace UTILSLIB
76{
77
78//=============================================================================================================
100{
101 int iOrderIn = 8;
102 int iOrderOut = 3;
103 Eigen::Vector3d origin{0.0, 0.0, 0.04};
104 double dRegIn = 1e-5;
105};
106
108{
109public:
111
112 //=========================================================================================================
118 struct Basis
119 {
120 Eigen::MatrixXd matSin;
121 Eigen::MatrixXd matSout;
122 Eigen::MatrixXd matProjIn;
123 Eigen::MatrixXd matPinvAll;
124 QVector<int> megChannelIdx;
125 int iOrderIn = 8;
126 int iOrderOut = 3;
127 int iNin = 0;
128 int iNout = 0;
129 };
130
131 //=========================================================================================================
143 static Basis computeBasis(const FIFFLIB::FiffInfo& fiffInfo,
144 const Params& params = Params());
145
146 //=========================================================================================================
156 static Eigen::MatrixXd apply(const Eigen::MatrixXd& matData,
157 const Basis& basis);
158
159 //=========================================================================================================
175 static Eigen::MatrixXd applyTemporal(const Eigen::MatrixXd& matData,
176 const Basis& basis,
177 int iBufferLength = 10000,
178 double dCorrLimit = 0.98);
179
180private:
181 //=========================================================================================================
196 static void computeNormALP(int lmax,
197 double cosTheta,
198 double sinTheta,
199 Eigen::MatrixXd& P,
200 Eigen::MatrixXd& dP);
201
202 //=========================================================================================================
223 static Eigen::Vector3d basisGradCart(int l,
224 int m,
225 bool bInternal,
226 const Eigen::Vector3d& rPos,
227 const Eigen::MatrixXd& P,
228 const Eigen::MatrixXd& dP,
229 double cosTheta,
230 double sinTheta,
231 double cosPhi,
232 double sinPhi);
233};
234
235} // namespace UTILSLIB
236
237#endif // SSS_DSP_H
Full FIFF measurement metadata: everything from FIFFB_MEAS / FIFFB_MEAS_INFO needed to interpret a re...
Export/import macros and namespace declaration for the DSP library.
#define DSPSHARED_EXPORT
Definition dsp_global.h:50
Shared utilities (I/O helpers, spectral analysis, layout management, warp algorithms).
Implements Signal Space Separation (SSS) and temporal SSS (tSSS) for MEG data.
Definition sss.h:100
double dRegIn
Definition sss.h:104
Eigen::Vector3d origin
Definition sss.h:103
SSSParams Params
Definition sss.h:110
static Basis computeBasis(const FIFFLIB::FiffInfo &fiffInfo, const Params &params=Params())
Definition sss.cpp:280
static Eigen::MatrixXd apply(const Eigen::MatrixXd &matData, const Basis &basis)
Definition sss.cpp:403
static Eigen::MatrixXd applyTemporal(const Eigen::MatrixXd &matData, const Basis &basis, int iBufferLength=10000, double dCorrLimit=0.98)
Definition sss.cpp:431
Precomputed SSS basis and projectors for a given sensor array.
Definition sss.h:119
Eigen::MatrixXd matSout
Definition sss.h:121
Eigen::MatrixXd matSin
Definition sss.h:120
Eigen::MatrixXd matPinvAll
Definition sss.h:123
QVector< int > megChannelIdx
Definition sss.h:124
Eigen::MatrixXd matProjIn
Definition sss.h:122
Full FIFF measurement info: per-channel descriptors, sampling and filter setup, projectors,...
Definition fiff_info.h:88