v2.0.0
Loading...
Searching...
No Matches
sourceestimatemanager.h
Go to the documentation of this file.
1//=============================================================================================================
19
20#ifndef SOURCEESTIMATEMANAGER_H
21#define SOURCEESTIMATEMANAGER_H
22
23//=============================================================================================================
24// INCLUDES
25//=============================================================================================================
26
27#include "../disp3D_global.h"
28
29#include <QObject>
30#include <QVector>
31#include <QMap>
32#include <QString>
33#include <Eigen/Core>
34#include <memory>
35
36//=============================================================================================================
37// FORWARD DECLARATIONS
38//=============================================================================================================
39
40class QThread;
41
42namespace DISP3DLIB
43{
44
45class BrainSurface;
49struct SubView;
50
51//=============================================================================================================
62{
63 Q_OBJECT
64
65public:
66 //=========================================================================================================
72 explicit SourceEstimateManager(QObject* parent = nullptr);
73
74 //=========================================================================================================
78 ~SourceEstimateManager() override;
79
80 // ── Loading ────────────────────────────────────────────────────────
81
91 bool load(const QString& lhPath, const QString& rhPath,
92 const QMap<QString, std::shared_ptr<BrainSurface>>& surfaces,
93 const QString& activeSurfaceType);
94
98 void cancelLoading();
99
103 bool isLoading() const
104 {
105 return m_isLoading;
106 }
107
111 bool isLoaded() const;
112
113 // ── Time-point navigation ──────────────────────────────────────────
114
123 void setTimePoint(int index,
124 const QMap<QString, std::shared_ptr<BrainSurface>>& surfaces,
125 const SubView& singleView,
126 const QVector<SubView>& subViews);
127
130 {
131 return m_currentTimePoint;
132 }
133
135 float tstep() const;
136
138 float tmin() const;
139
141 int numTimePoints() const;
142
147 int closestIndex(float timeSec) const;
148
149 // ── Colormap / thresholds ──────────────────────────────────────────
150
156 void setColormap(const QString& name);
157
165 void setThresholds(float min, float mid, float max);
166
167 // ── Real-time streaming ────────────────────────────────────────────
168
177 void startStreaming(const QMap<QString, std::shared_ptr<BrainSurface>>& surfaces,
178 const SubView& singleView,
179 const QVector<SubView>& subViews);
180
182 void stopStreaming();
183
185 bool isStreaming() const
186 {
187 return m_isStreaming;
188 }
189
195 void pushData(const Eigen::VectorXd& data);
196
202 void setInterval(int msec);
203
209 void setLooping(bool enabled);
210
211 // ── Accessors ──────────────────────────────────────────────────────
212
214 const SourceEstimateOverlay* overlay() const;
215
216signals:
217 //=========================================================================================================
220
222 void thresholdsUpdated(float min, float mid, float max);
223
225 void timePointChanged(int index, float time);
226
228 void loadingProgress(int percent, const QString& message);
229
235 void realtimeColorsAvailable(const QVector<uint32_t>& colorsLh,
236 const QVector<uint32_t>& colorsRh);
237
238private slots:
240 void onStcLoadingFinished(bool success);
241
242private:
243 std::unique_ptr<SourceEstimateOverlay> m_overlay;
244 std::unique_ptr<RtSourceDataController> m_rtController;
245 QThread* m_loadingThread = nullptr;
246 StcLoadingWorker* m_stcWorker = nullptr;
247 int m_currentTimePoint = 0;
248 bool m_isLoading = false;
249 bool m_isStreaming = false;
250};
251
252} // namespace DISP3DLIB
253
254#endif // SOURCEESTIMATEMANAGER_H
Library export/import macros and namespace marker for the disp3D library.
#define DISP3DSHARED_EXPORT
3-D brain visualisation using the Qt RHI rendering backend.
Viewport subdivision holding its own camera, projection, and scissor rectangle.
Definition viewstate.h:143
Renderable cortical surface mesh with per-vertex color, curvature data, and GPU buffer management.
Color-mapped source estimate overlay that interpolates activation values onto a cortical surface mesh...
bool load(const QString &lhPath, const QString &rhPath, const QMap< QString, std::shared_ptr< BrainSurface > > &surfaces, const QString &activeSurfaceType)
void loadingProgress(int percent, const QString &message)
SourceEstimateManager(QObject *parent=nullptr)
void loaded(int numTimePoints)
void realtimeColorsAvailable(const QVector< uint32_t > &colorsLh, const QVector< uint32_t > &colorsRh)
void timePointChanged(int index, float time)
void thresholdsUpdated(float min, float mid, float max)
Controller for real-time source estimate streaming.
Background worker that loads source estimate (STC) files and emits loaded data for visualization.