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
44namespace DISP3DLIB
45{
46
47class BrainSurface;
48
49//=============================================================================================================
57{
58 Q_OBJECT
59
60public:
61 //=========================================================================================================
72 StcLoadingWorker(const QString& lhPath,
73 const QString& rhPath,
74 BrainSurface* lhSurface,
75 BrainSurface* rhSurface,
76 double cancelDist = 0.05,
77 QObject* parent = nullptr);
78
79 //=========================================================================================================
84
85 //=========================================================================================================
92 {
93 return m_stcLh;
94 }
95
96 //=========================================================================================================
103 {
104 return m_stcRh;
105 }
106
107 //=========================================================================================================
113 QSharedPointer<Eigen::SparseMatrix<float>> interpolationMatLh() const
114 {
115 return m_interpMatLh;
116 }
117
118 //=========================================================================================================
124 QSharedPointer<Eigen::SparseMatrix<float>> interpolationMatRh() const
125 {
126 return m_interpMatRh;
127 }
128
129 //=========================================================================================================
135 bool hasLh() const
136 {
137 return m_hasLh;
138 }
139
140 //=========================================================================================================
146 bool hasRh() const
147 {
148 return m_hasRh;
149 }
150
151 //=========================================================================================================
157 {
158 m_cancelled.store(true, std::memory_order_relaxed);
159 }
160
162 bool isCancelled() const
163 {
164 return m_cancelled.load(std::memory_order_relaxed);
165 }
166
167public slots:
168 //=========================================================================================================
173 void process();
174
175signals:
176 //=========================================================================================================
183 void progress(int percent, const QString& message);
184
185 //=========================================================================================================
191 void finished(bool success);
192
193 //=========================================================================================================
199 void error(const QString& message);
200
201private:
202 QSharedPointer<Eigen::SparseMatrix<float>> computeInterpolationMatrix(
203 const Eigen::MatrixX3f& matVertices,
204 Eigen::VectorXi& vecSourceVertices,
205 double cancelDist,
206 const QString& hemiLabel,
207 int progressStart,
208 int progressEnd);
209
210 QString m_lhPath;
211 QString m_rhPath;
212 BrainSurface* m_lhSurface;
213 BrainSurface* m_rhSurface;
214 double m_cancelDist;
215
218 bool m_hasLh = false;
219 bool m_hasRh = false;
220
221 QSharedPointer<Eigen::SparseMatrix<float>> m_interpMatLh;
222 QSharedPointer<Eigen::SparseMatrix<float>> m_interpMatRh;
223 std::atomic<bool> m_cancelled{false};
224};
225
226} // namespace DISP3DLIB
227
228#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...
3-D brain visualisation using the Qt RHI rendering backend.
Renderable cortical surface mesh with per-vertex color, curvature data, and GPU buffer management.
const INVLIB::InvSourceEstimate & stcRh() const
void finished(bool success)
void progress(int percent, const QString &message)
StcLoadingWorker(const QString &lhPath, const QString &rhPath, BrainSurface *lhSurface, BrainSurface *rhSurface, double cancelDist=0.05, QObject *parent=nullptr)
QSharedPointer< Eigen::SparseMatrix< float > > interpolationMatLh() const
void error(const QString &message)
QSharedPointer< Eigen::SparseMatrix< float > > interpolationMatRh() const
const INVLIB::InvSourceEstimate & stcLh() const
Source-space inverse-solution container with dense grid plus optional focal-dipole,...