v2.0.0
Loading...
Searching...
No Matches
inv_source_estimate.h
Go to the documentation of this file.
1
2//=============================================================================================================
37
38#ifndef INV_SOURCE_ESTIMATE_H
39#define INV_SOURCE_ESTIMATE_H
40
41//=============================================================================================================
42// INCLUDES
43//=============================================================================================================
44
45#include "inv_global.h"
46#include "inv_types.h"
47#include "inv_focal_dipole.h"
48#include "inv_source_coupling.h"
49#include "inv_connectivity.h"
50
51#include <fs/fs_label.h>
52
53//=============================================================================================================
54// STL INCLUDES
55//=============================================================================================================
56
57#include <vector>
58
59//=============================================================================================================
60// EIGEN INCLUDES
61//=============================================================================================================
62
63#include <Eigen/Core>
64
65//=============================================================================================================
66// QT INCLUDES
67//=============================================================================================================
68
69#include <QSharedPointer>
70#include <QList>
71#include <QIODevice>
72
73//=============================================================================================================
74// FORWARD DECLARATIONS
75//=============================================================================================================
76
77//=============================================================================================================
78// DEFINE NAMESPACE INVLIB
79//=============================================================================================================
80
81namespace INVLIB
82{
83
84//=============================================================================================================
85// MNELIB FORWARD DECLARATIONS
86//=============================================================================================================
87
88//=============================================================================================================
95{
96public:
97 typedef QSharedPointer<InvSourceEstimate> SPtr;
98 typedef QSharedPointer<const InvSourceEstimate> ConstSPtr;
99
100 //=========================================================================================================
105
106 //=========================================================================================================
115 InvSourceEstimate(const Eigen::MatrixXd &p_sol, const Eigen::VectorXi &p_vertices, float p_tmin, float p_tstep);
116
117 //=========================================================================================================
123 InvSourceEstimate(const InvSourceEstimate& p_SourceEstimate);
124
125 //=========================================================================================================
132 InvSourceEstimate(QIODevice &p_IODevice);
133
134 //=========================================================================================================
138 void clear();
139
140 //=========================================================================================================
147 InvSourceEstimate reduce(qint32 start, qint32 n);
148
149 //=========================================================================================================
160 static bool read(QIODevice &p_IODevice, InvSourceEstimate& p_stc);
161
162 //=========================================================================================================
170 bool write(QIODevice &p_IODevice);
171
172 //=========================================================================================================
178 inline bool isEmpty() const;
179
180 //=========================================================================================================
188 InvSourceEstimate& operator= (const InvSourceEstimate &rhs);
189
190 //=========================================================================================================
196 int samples() const;
197
198 //=========================================================================================================
207 Eigen::VectorXi getIndicesByLabel(const QList<FSLIB::FsLabel> &lPickedLabels, bool bIsClustered) const;
208
209public:
210 Eigen::MatrixXd data;
211 Eigen::VectorXi vertices;
212 Eigen::RowVectorXf times;
213 float tmin;
214 float tstep;
215
216 // --- Metadata ---
220
221 // --- Positions (for discrete source spaces: sEEG contacts, ECoG electrodes, custom ROIs) ---
222 Eigen::MatrixX3f positions;
223
224 // --- Coupling layer (e.g. RAP-MUSIC correlated N-tuples on the grid) ---
225 std::vector<InvSourceCoupling> couplings;
226
227 // --- Focal layer (e.g. ECD off-grid dipoles) ---
228 std::vector<InvFocalDipole> focalDipoles;
229
230 // --- Connectivity layer (pairwise source connectivity) ---
231 std::vector<InvConnectivity> connectivity;
232
233 //=========================================================================================================
239 inline bool hasGridData() const;
240
241 //=========================================================================================================
247 inline bool hasCouplings() const;
248
249 //=========================================================================================================
255 inline bool hasFocalDipoles() const;
256
257 //=========================================================================================================
263 inline bool hasPositions() const;
264
265 //=========================================================================================================
271 inline bool hasConnectivity() const;
272
273private:
274 //=========================================================================================================
278 void update_times();
279};
280
281//=============================================================================================================
282// INLINE DEFINITIONS
283//=============================================================================================================
284
285inline bool InvSourceEstimate::isEmpty() const
286{
287 return tstep == -1;
288}
289
290//=============================================================================================================
291
293{
294 return data.size() > 0;
295}
296
297//=============================================================================================================
298
300{
301 return !couplings.empty();
302}
303
304//=============================================================================================================
305
307{
308 return !focalDipoles.empty();
309}
310
311//=============================================================================================================
312
314{
315 return positions.rows() > 0;
316}
317
318//=============================================================================================================
319
321{
322 return !connectivity.empty();
323}
324} //NAMESPACE
325
326#endif // INV_SOURCE_ESTIMATE_H
InvSourceCoupling struct declaration for correlated source groups (e.g. RAP-MUSIC dipole tuples).
InvConnectivity struct for pairwise source connectivity results.
InvFocalDipole struct declaration for off-grid dipole results (e.g. ECD dipole fit).
Inverse library type enumerations.
inverse library export/import macros.
#define INVSHARED_EXPORT
Definition inv_global.h:52
FsLabel class declaration.
Inverse source estimation (MNE, dSPM, sLORETA, dipole fitting).
InvEstimateMethod
Definition inv_types.h:50
InvOrientationType
Definition inv_types.h:84
InvSourceSpaceType
Definition inv_types.h:71
std::vector< InvSourceCoupling > couplings
std::vector< InvFocalDipole > focalDipoles
Eigen::VectorXi getIndicesByLabel(const QList< FSLIB::FsLabel > &lPickedLabels, bool bIsClustered) const
static bool read(QIODevice &p_IODevice, InvSourceEstimate &p_stc)
bool write(QIODevice &p_IODevice)
QSharedPointer< InvSourceEstimate > SPtr
InvSourceSpaceType sourceSpaceType
QSharedPointer< const InvSourceEstimate > ConstSPtr
InvOrientationType orientationType
InvSourceEstimate(const Eigen::MatrixXd &p_sol, const Eigen::VectorXi &p_vertices, float p_tmin, float p_tstep)
std::vector< InvConnectivity > connectivity
InvSourceEstimate reduce(qint32 start, qint32 n)