v2.0.0
Loading...
Searching...
No Matches
sourceestimatemanager.h
Go to the documentation of this file.
1//=============================================================================================================
34
35#ifndef SOURCEESTIMATEMANAGER_H
36#define SOURCEESTIMATEMANAGER_H
37
38//=============================================================================================================
39// INCLUDES
40//=============================================================================================================
41
43
44#include <QObject>
45#include <QVector>
46#include <QMap>
47#include <QString>
48#include <Eigen/Core>
49#include <memory>
50
51//=============================================================================================================
52// FORWARD DECLARATIONS
53//=============================================================================================================
54
55class QThread;
56class BrainSurface;
60struct SubView;
61
62//=============================================================================================================
73{
74 Q_OBJECT
75
76public:
77 //=========================================================================================================
83 explicit SourceEstimateManager(QObject *parent = nullptr);
84
85 //=========================================================================================================
89 ~SourceEstimateManager() override;
90
91 // ── Loading ────────────────────────────────────────────────────────
92
102 bool load(const QString &lhPath, const QString &rhPath,
103 const QMap<QString, std::shared_ptr<BrainSurface>> &surfaces,
104 const QString &activeSurfaceType);
105
109 bool isLoading() const { return m_isLoading; }
110
114 bool isLoaded() const;
115
116 // ── Time-point navigation ──────────────────────────────────────────
117
126 void setTimePoint(int index,
127 const QMap<QString, std::shared_ptr<BrainSurface>> &surfaces,
128 const SubView &singleView,
129 const QVector<SubView> &subViews);
130
132 int currentTimePoint() const { return m_currentTimePoint; }
133
135 float tstep() const;
136
138 float tmin() const;
139
141 int numTimePoints() const;
142
144 int closestIndex(float timeSec) const;
145
146 // ── Colormap / thresholds ──────────────────────────────────────────
147
153 void setColormap(const QString &name);
154
162 void setThresholds(float min, float mid, float max);
163
164 // ── Real-time streaming ────────────────────────────────────────────
165
174 void startStreaming(const QMap<QString, std::shared_ptr<BrainSurface>> &surfaces,
175 const SubView &singleView,
176 const QVector<SubView> &subViews);
177
179 void stopStreaming();
180
182 bool isStreaming() const { return m_isStreaming; }
183
185 void pushData(const Eigen::VectorXd &data);
186
188 void setInterval(int msec);
189
191 void setLooping(bool enabled);
192
193 // ── Accessors ──────────────────────────────────────────────────────
194
196 const SourceEstimateOverlay *overlay() const;
197
198signals:
199 //=========================================================================================================
202
204 void thresholdsUpdated(float min, float mid, float max);
205
207 void timePointChanged(int index, float time);
208
210 void loadingProgress(int percent, const QString &message);
211
217 void realtimeColorsAvailable(const QVector<uint32_t> &colorsLh,
218 const QVector<uint32_t> &colorsRh);
219
220private slots:
222 void onStcLoadingFinished(bool success);
223
224private:
225 std::unique_ptr<SourceEstimateOverlay> m_overlay;
226 std::unique_ptr<RtSourceDataController> m_rtController;
227 QThread *m_loadingThread = nullptr;
228 StcLoadingWorker *m_stcWorker = nullptr;
229 int m_currentTimePoint = 0;
230 bool m_isLoading = false;
231 bool m_isStreaming = false;
232};
233
234#endif // SOURCEESTIMATEMANAGER_H
disp3D_rhi library export/import macros.
#define DISP3DRHISHARED_EXPORT
Viewport subdivision holding its own camera, projection, and scissor rectangle.
Definition viewstate.h:148
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)
void timePointChanged(int index, float time)
void loaded(int numTimePoints)
void thresholdsUpdated(float min, float mid, float max)
void realtimeColorsAvailable(const QVector< uint32_t > &colorsLh, const QVector< uint32_t > &colorsRh)
SourceEstimateManager(QObject *parent=nullptr)
Controller for real-time source estimate streaming.
Background worker that loads source estimate (STC) files and emits loaded data for visualization.