v2.0.0
Loading...
Searching...
No Matches
stcloadingworker.h
Go to the documentation of this file.
1//=============================================================================================================
23
24#ifndef STCLOADINGWORKER_H
25#define STCLOADINGWORKER_H
26
27//=============================================================================================================
28// INCLUDES
29//=============================================================================================================
30
31#include "../disp3D_global.h"
32
34#include <QObject>
35#include <QString>
36#include <QSharedPointer>
37#include <Eigen/Sparse>
38#include <atomic>
39
40//=============================================================================================================
41// FORWARD DECLARATIONS
42//=============================================================================================================
43
44class BrainSurface;
45
46//=============================================================================================================
54{
55 Q_OBJECT
56
57public:
58 //=========================================================================================================
69 StcLoadingWorker(const QString &lhPath,
70 const QString &rhPath,
71 BrainSurface *lhSurface,
72 BrainSurface *rhSurface,
73 double cancelDist = 0.05,
74 QObject *parent = nullptr);
75
76 //=========================================================================================================
81
82 //=========================================================================================================
88 const INVLIB::InvSourceEstimate& stcLh() const { return m_stcLh; }
89
90 //=========================================================================================================
96 const INVLIB::InvSourceEstimate& stcRh() const { return m_stcRh; }
97
98 //=========================================================================================================
104 QSharedPointer<Eigen::SparseMatrix<float>> interpolationMatLh() const { return m_interpMatLh; }
105
106 //=========================================================================================================
112 QSharedPointer<Eigen::SparseMatrix<float>> interpolationMatRh() const { return m_interpMatRh; }
113
114 //=========================================================================================================
120 bool hasLh() const { return m_hasLh; }
121
122 //=========================================================================================================
128 bool hasRh() const { return m_hasRh; }
129
130 //=========================================================================================================
135 void requestCancel() { m_cancelled.store(true, std::memory_order_relaxed); }
136
138 bool isCancelled() const { return m_cancelled.load(std::memory_order_relaxed); }
139
140public slots:
141 //=========================================================================================================
146 void process();
147
148signals:
149 //=========================================================================================================
156 void progress(int percent, const QString &message);
157
158 //=========================================================================================================
164 void finished(bool success);
165
166 //=========================================================================================================
172 void error(const QString &message);
173
174private:
175 QSharedPointer<Eigen::SparseMatrix<float>> computeInterpolationMatrix(
176 const Eigen::MatrixX3f &matVertices,
177 Eigen::VectorXi &vecSourceVertices,
178 double cancelDist,
179 const QString &hemiLabel,
180 int progressStart,
181 int progressEnd);
182
183 QString m_lhPath;
184 QString m_rhPath;
185 BrainSurface *m_lhSurface;
186 BrainSurface *m_rhSurface;
187 double m_cancelDist;
188
191 bool m_hasLh = false;
192 bool m_hasRh = false;
193
194 QSharedPointer<Eigen::SparseMatrix<float>> m_interpMatLh;
195 QSharedPointer<Eigen::SparseMatrix<float>> m_interpMatRh;
196 std::atomic<bool> m_cancelled{false};
197};
198
199#endif // STCLOADINGWORKER_H
Library export/import macros and namespace marker for the disp3D library.
#define DISP3DSHARED_EXPORT
InvSourceEstimate value type — central source-space data container produced by every INVLIB inverse s...
Renderable cortical surface mesh with per-vertex color, curvature data, and GPU buffer management.
QSharedPointer< Eigen::SparseMatrix< float > > interpolationMatLh() const
void error(const QString &message)
void progress(int percent, const QString &message)
QSharedPointer< Eigen::SparseMatrix< float > > interpolationMatRh() const
const INVLIB::InvSourceEstimate & stcLh() const
void finished(bool success)
bool isCancelled() const
const INVLIB::InvSourceEstimate & stcRh() const
StcLoadingWorker(const QString &lhPath, const QString &rhPath, BrainSurface *lhSurface, BrainSurface *rhSurface, double cancelDist=0.05, QObject *parent=nullptr)
Source-space inverse-solution container with dense grid plus optional focal-dipole,...