v2.0.0
Loading...
Searching...
No Matches
sss.h
Go to the documentation of this file.
1//=============================================================================================================
50
51#ifndef SSS_DSP_H
52#define SSS_DSP_H
53
54//=============================================================================================================
55// INCLUDES
56//=============================================================================================================
57
58#include "dsp_global.h"
59
60#include <fiff/fiff_info.h>
61
62//=============================================================================================================
63// EIGEN INCLUDES
64//=============================================================================================================
65
66#include <Eigen/Core>
67
68//=============================================================================================================
69// QT INCLUDES
70//=============================================================================================================
71
72#include <QVector>
73
74//=============================================================================================================
75// DEFINE NAMESPACE UTILSLIB
76//=============================================================================================================
77
78namespace UTILSLIB
79{
80
81//=============================================================================================================
103{
104 int iOrderIn = 8;
105 int iOrderOut = 3;
106 Eigen::Vector3d origin{0.0, 0.0, 0.04};
107 double dRegIn = 1e-5;
108};
109
111{
112public:
114
115 //=========================================================================================================
121 struct Basis
122 {
123 Eigen::MatrixXd matSin;
124 Eigen::MatrixXd matSout;
125 Eigen::MatrixXd matProjIn;
126 Eigen::MatrixXd matPinvAll;
127 QVector<int> megChannelIdx;
128 int iOrderIn = 8;
129 int iOrderOut = 3;
130 int iNin = 0;
131 int iNout = 0;
132 };
133
134 //=========================================================================================================
146 static Basis computeBasis(const FIFFLIB::FiffInfo& fiffInfo,
147 const Params& params = Params());
148
149 //=========================================================================================================
159 static Eigen::MatrixXd apply(const Eigen::MatrixXd& matData,
160 const Basis& basis);
161
162 //=========================================================================================================
178 static Eigen::MatrixXd applyTemporal(const Eigen::MatrixXd& matData,
179 const Basis& basis,
180 int iBufferLength = 10000,
181 double dCorrLimit = 0.98);
182
183private:
184 //=========================================================================================================
199 static void computeNormALP(int lmax,
200 double cosTheta,
201 double sinTheta,
202 Eigen::MatrixXd& P,
203 Eigen::MatrixXd& dP);
204
205 //=========================================================================================================
226 static Eigen::Vector3d basisGradCart(int l,
227 int m,
228 bool bInternal,
229 const Eigen::Vector3d& rPos,
230 const Eigen::MatrixXd& P,
231 const Eigen::MatrixXd& dP,
232 double cosTheta,
233 double sinTheta,
234 double cosPhi,
235 double sinPhi);
236};
237
238} // namespace UTILSLIB
239
240#endif // SSS_DSP_H
FiffInfo class declaration.
dsp library export/import macros.
#define DSPSHARED_EXPORT
Definition dsp_global.h:56
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:103
double dRegIn
Definition sss.h:107
Eigen::Vector3d origin
Definition sss.h:106
SSSParams Params
Definition sss.h:113
static Basis computeBasis(const FIFFLIB::FiffInfo &fiffInfo, const Params &params=Params())
Definition sss.cpp:301
static Eigen::MatrixXd apply(const Eigen::MatrixXd &matData, const Basis &basis)
Definition sss.cpp:424
static Eigen::MatrixXd applyTemporal(const Eigen::MatrixXd &matData, const Basis &basis, int iBufferLength=10000, double dCorrLimit=0.98)
Definition sss.cpp:452
Precomputed SSS basis and projectors for a given sensor array.
Definition sss.h:122
Eigen::MatrixXd matSout
Definition sss.h:124
Eigen::MatrixXd matSin
Definition sss.h:123
Eigen::MatrixXd matPinvAll
Definition sss.h:126
QVector< int > megChannelIdx
Definition sss.h:127
Eigen::MatrixXd matProjIn
Definition sss.h:125
FIFF measurement file information.
Definition fiff_info.h:86