#include <brainview.h>
Public Types | |
| enum | ViewMode { SingleView , MultiView } |
Public Slots | |
| void | onRowsInserted (const QModelIndex &parent, int first, int last) |
| void | onDataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector< int > &roles) |
| void | setActiveSurface (const QString &type) |
| void | setShaderMode (const QString &mode) |
| void | setBemShaderMode (const QString &mode) |
| void | syncBemShadersToBrainShaders () |
| void | setVisualizationMode (const QString &mode) |
| void | setHemiVisible (int hemiIdx, bool visible) |
| void | setBemVisible (const QString &name, bool visible) |
| void | setBemHighContrast (bool enabled) |
| void | setSensorVisible (const QString &type, bool visible) |
| void | setSensorTransEnabled (bool enabled) |
| void | setMegHelmetOverride (const QString &path) |
| bool | loadMegHelmetSurface (const QString &helmetFilePath) |
| void | setDipoleVisible (bool visible) |
| bool | loadNetwork (const CONNECTIVITYLIB::Network &network, const QString &name="Network") |
| void | setNetworkVisible (bool visible) |
| void | setNetworkThreshold (double threshold) |
| void | setNetworkColormap (const QString &name) |
| void | setLightingEnabled (bool enabled) |
| void | saveSnapshot () |
| void | showSingleView () |
| void | showMultiView () |
| void | setViewCount (int count) |
| int | viewCount () const |
| void | setViewportEnabled (int index, bool enabled) |
| void | setViewportCameraPreset (int index, int preset) |
| int | viewportCameraPreset (int index) const |
| void | resetMultiViewLayout () |
| void | setVisualizationEditTarget (int target) |
| int | visualizationEditTarget () const |
| QString | activeSurfaceForTarget (int target) const |
| QString | shaderModeForTarget (int target) const |
| QString | bemShaderModeForTarget (int target) const |
| QString | overlayModeForTarget (int target) const |
| bool | objectVisibleForTarget (const QString &object, int target) const |
| bool | megFieldMapOnHeadForTarget (int target) const |
| bool | isViewportEnabled (int index) const |
| void | setInfoPanelVisible (bool visible) |
| bool | isInfoPanelVisible () const |
| ViewMode | viewMode () const |
| bool | loadSourceEstimate (const QString &lhPath, const QString &rhPath) |
| bool | loadSensors (const QString &fifPath) |
| bool | loadDipoles (const QString &dipPath) |
| bool | loadSourceSpace (const QString &fwdPath) |
| static QStringList | probeEvokedSets (const QString &evokedPath) |
| bool | loadSensorField (const QString &evokedPath, int aveIndex=0) |
| void | setSourceSpaceVisible (bool visible) |
| bool | loadTransformation (const QString &transPath) |
| void | setTimePoint (int index) |
| void | castRay (const QPoint &pos) |
| void | setSourceColormap (const QString &name) |
| void | setSourceThresholds (float min, float mid, float max) |
| void | setSensorFieldTimePoint (int index) |
| void | setSensorFieldVisible (const QString &type, bool visible) |
| void | setSensorFieldContourVisible (const QString &type, bool visible) |
| void | setMegFieldMapOnHead (bool useHead) |
| void | setSensorFieldColormap (const QString &name) |
| float | stcStep () const |
| float | stcTmin () const |
| int | stcNumTimePoints () const |
| int | closestSensorFieldIndex (float timeSec) const |
| int | closestStcIndex (float timeSec) const |
| void | startRealtimeStreaming () |
| void | stopRealtimeStreaming () |
| bool | isRealtimeStreaming () const |
| void | pushRealtimeSourceData (const Eigen::VectorXd &data) |
| void | setRealtimeInterval (int msec) |
| void | setRealtimeLooping (bool enabled) |
| bool | sensorFieldTimeRange (float &tmin, float &tmax) const |
| void | startRealtimeSensorStreaming (const QString &modality=QStringLiteral("MEG")) |
| void | stopRealtimeSensorStreaming () |
| bool | isRealtimeSensorStreaming () const |
| void | pushRealtimeSensorData (const Eigen::VectorXf &data) |
| void | setRealtimeSensorInterval (int msec) |
| void | setRealtimeSensorLooping (bool enabled) |
| void | setRealtimeSensorAverages (int numAvr) |
| void | setRealtimeSensorColormap (const QString &name) |
Signals | |
| void | timePointChanged (int index, float time) |
| void | sourceEstimateLoaded (int numTimePoints) |
| void | sensorFieldLoaded (int numTimePoints, int initialTimePoint=0) |
| void | sourceThresholdsUpdated (float min, float mid, float max) |
| void | stcLoadingProgress (int percent, const QString &message) |
| void | sensorFieldTimePointChanged (int index, float time) |
| void | hoveredRegionChanged (const QString ®ionName) |
| void | visualizationEditTargetChanged (int target) |
Public Member Functions | |
| BrainView (QWidget *parent=nullptr) | |
| ~BrainView () | |
| void | setModel (BrainTreeModel *model) |
| void | setInitialCameraRotation (const QQuaternion &rotation) |
Protected Member Functions | |
| void | initialize (QRhiCommandBuffer *cb) override |
| void | render (QRhiCommandBuffer *cb) override |
| void | mousePressEvent (QMouseEvent *event) override |
| void | mouseMoveEvent (QMouseEvent *event) override |
| void | mouseReleaseEvent (QMouseEvent *event) override |
| void | wheelEvent (QWheelEvent *event) override |
| void | keyPressEvent (QKeyEvent *event) override |
| void | resizeEvent (QResizeEvent *event) override |
BrainView class.
BrainView is the main widget for the 3D brain visualization. It handles user interaction, surface loading, and coordinates with the BrainRenderer.
Definition at line 85 of file brainview.h.

| enum BrainView::ViewMode |
View mode for single or multi-viewport display.
| Enumerator | |
|---|---|
| SingleView | Single viewport with interactive camera |
| MultiView | Three viewports with fixed cameras (top, left, front) |
Definition at line 93 of file brainview.h.
|
explicit |
| BrainView::~BrainView | ( | ) |
Destructor
Definition at line 211 of file brainview.cpp.
|
slot |
Get configured surface type for a target view.
Definition at line 608 of file brainview.cpp.
|
slot |
Get configured BEM shader mode name for a target view.
Definition at line 622 of file brainview.cpp.
|
slot |
Cast rays from screen position to find intersected objects.
| [in] | pos | 2D mouse position. |
Definition at line 2385 of file brainview.cpp.
|
slot |
Find the closest sensor field time index for a given time in seconds.
| [in] | timeSec | Time in seconds. |
Definition at line 2119 of file brainview.cpp.
|
slot |
Find the closest STC time index for a given time in seconds.
| [in] | timeSec | Time in seconds. |
Definition at line 2139 of file brainview.cpp.
|
signal |
Emitted when the hovered brain region changes.
| [in] | regionName | Name of the region under the cursor. |
|
overrideprotected |
Definition at line 1326 of file brainview.cpp.
|
inlineslot |
Whether the info panel is currently visible.
Definition at line 418 of file brainview.h.
|
slot |
Check whether real-time sensor streaming is active.
Definition at line 2174 of file brainview.cpp.
|
slot |
Check whether real-time streaming is active.
Definition at line 1912 of file brainview.cpp.
|
slot |
Check if a multi-view viewport is enabled.
| [in] | index | Viewport index (0=Top, 1=Perspective, 2=Front, 3=Left). |
Definition at line 943 of file brainview.cpp.
|
overrideprotected |
Definition at line 1843 of file brainview.cpp.
|
slot |
Load dipoles from a .dip or .bdip file.
| [in] | dipPath | Path to the dipole file. |
Definition at line 2269 of file brainview.cpp.
|
slot |
Load a standalone MEG helmet surface, replacing the current one.
The Device→Head transform from the last loadSensors() call is applied automatically when available.
| [in] | helmetFilePath | Absolute path to a helmet BEM FIF file. |
Definition at line 2256 of file brainview.cpp.
|
slot |
Load a connectivity network for visualization.
| [in] | network | The connectivity network to visualize. |
| [in] | name | Display name for the network. |
Definition at line 2279 of file brainview.cpp.
|
slot |
Load sensor measurements from an evoked/average FIF file.
| [in] | evokedPath | Path to the evoked/average FIF file. |
| [in] | aveIndex | Dataset index to load from the file. |
Definition at line 1971 of file brainview.cpp.
|
slot |
Load sensors (MEG/EEG/Digitizers) from a FIF file.
| [in] | fifPath | Path to the FIF file. |
Definition at line 2233 of file brainview.cpp.
|
slot |
Load source estimate files (.stc) for both hemispheres.
| [in] | lhPath | Path to left hemisphere .stc file. |
| [in] | rhPath | Path to right hemisphere .stc file. |
Definition at line 1857 of file brainview.cpp.
|
slot |
Load source space from a FIF file (forward solution or source space file).
| [in] | fwdPath | Path to the FIF file containing source space data. |
Definition at line 2331 of file brainview.cpp.
|
slot |
Load a coordinate transformation from a FIF file.
| [in] | transPath | Path to the transformation file. |
Definition at line 2351 of file brainview.cpp.
|
slot |
Check whether MEG field mapping uses head surface for a target.
| [in] | target | -1=Single, 0=Top, 1=Perspective, 2=Front, 3=Left. |
Definition at line 678 of file brainview.cpp.
|
overrideprotected |
Definition at line 1734 of file brainview.cpp.
|
overrideprotected |
Definition at line 1693 of file brainview.cpp.
|
overrideprotected |
Definition at line 1796 of file brainview.cpp.
|
slot |
Check object visibility for a given target view.
| [in] | object | Object key (e.g. "lh", "bem_head", "sens_meg"). |
| [in] | target | -1=Single, 0=Top, 1=Perspective, 2=Front, 3=Left. |
Definition at line 671 of file brainview.cpp.
|
slot |
Definition at line 439 of file brainview.cpp.
|
slot |
Definition at line 237 of file brainview.cpp.
|
slot |
Get configured overlay mode name for a target view.
Definition at line 629 of file brainview.cpp.
|
staticslot |
Probe evoked data sets in a FIF file.
Returns a list of descriptive strings for each evoked set found (e.g. "0: Left Auditory (Average, nave=55)"). The list is empty if the file cannot be read.
| [in] | evokedPath | Path to the evoked/average FIF file. |
Definition at line 2005 of file brainview.cpp.
|
slot |
Push a single sensor measurement vector into the real-time sensor pipeline. The vector should contain one value per picked channel (matching the active mapping matrix column count).
| [in] | data | Sensor measurement vector. |
Definition at line 2181 of file brainview.cpp.
|
slot |
Push a single source-data vector into the real-time pipeline. The vector should contain source values for all sources (LH + RH concatenated).
| [in] | data | Source activity vector. |
Definition at line 1919 of file brainview.cpp.
|
overrideprotected |
Definition at line 1335 of file brainview.cpp.
|
slot |
Reset the multi-view splitter layout to equal-sized panes.
Definition at line 932 of file brainview.cpp.
|
overrideprotected |
Definition at line 1317 of file brainview.cpp.
|
slot |
Save a snapshot of the current view to a file.
Definition at line 867 of file brainview.cpp.
|
signal |
Emitted when sensor field data is loaded.
| [in] | numTimePoints | Number of time samples. |
|
signal |
Emitted when the sensor field time point changes.
| [in] | index | Time sample index. |
| [in] | time | Time in seconds. |
|
slot |
Get the time range of the loaded sensor field (evoked) data.
| [out] | tmin | Start time in seconds. |
| [out] | tmax | End time in seconds. |
Definition at line 2146 of file brainview.cpp.
|
slot |
Set the active surface type to search for (e.g. "pial").
| [in] | type | The surface type to activate. |
Definition at line 472 of file brainview.cpp.
|
slot |
Set whether BEM surfaces should use their standard (colorful) definition or white.
| [in] | enabled | True to use standard colors (Red/Green/Blue), False for White. |
Definition at line 847 of file brainview.cpp.
|
slot |
Set the shader mode for BEM surfaces (Standard, Holographic, Atlas).
| [in] | mode | The shader mode to set. |
Definition at line 720 of file brainview.cpp.
|
slot |
Toggle visibility of a BEM surface layer.
| [in] | name | "head", "outer_skull", or "inner_skull". |
| [in] | visible | Visibility state. |
Definition at line 839 of file brainview.cpp.
|
slot |
Toggle visibility of dipoles.
| [in] | visible | Visibility state. |
Definition at line 789 of file brainview.cpp.
|
slot |
Toggle visibility of a hemisphere.
| [in] | hemiIdx | 0 for LH, 1 for RH. |
| [in] | visible | Visibility state. |
Definition at line 825 of file brainview.cpp.
|
slot |
Show or hide the info panel (FPS, vertices, shader).
| [in] | visible | True to show, false to hide. |
Definition at line 1308 of file brainview.cpp.
| void BrainView::setInitialCameraRotation | ( | const QQuaternion & | rotation | ) |
Set the initial camera rotation for this view. Each view can start from a different orientation (e.g., top, front, left).
| [in] | rotation | Initial camera rotation quaternion. |
Definition at line 230 of file brainview.cpp.
|
slot |
Enable or disable lighting for the scene.
| [in] | enabled | True to enable lighting, false to disable. |
Definition at line 859 of file brainview.cpp.
|
slot |
Choose MEG mapping surface (helmet or head).
| [in] | useHead | True to map MEG on head surface. |
Definition at line 2067 of file brainview.cpp.
|
slot |
Override the auto-selected MEG helmet surface path.
| [in] | path | Absolute path to a helmet surface file. Empty to use auto selection. |
Definition at line 784 of file brainview.cpp.
| void BrainView::setModel | ( | BrainTreeModel * | model | ) |
Set the data model.
| [in] | model | Pointer to BrainTreeModel. |
Definition at line 218 of file brainview.cpp.
|
slot |
Set the colormap for connectivity network visualization.
| [in] | name | Colormap name ("Hot", "Jet", etc.). |
Definition at line 2321 of file brainview.cpp.
|
slot |
Set the threshold for connectivity network edge filtering.
| [in] | threshold | Threshold value (0.0–1.0). |
Definition at line 2311 of file brainview.cpp.
|
slot |
Toggle visibility of connectivity network.
| [in] | visible | Visibility state. |
Definition at line 2299 of file brainview.cpp.
|
slot |
Set the streaming speed (interval between frames).
| [in] | msec | Interval in milliseconds. |
Definition at line 1926 of file brainview.cpp.
|
slot |
Enable or disable looping for real-time streaming.
| [in] | enabled | True to loop. |
Definition at line 1933 of file brainview.cpp.
|
slot |
Set the number of averages for sensor streaming.
| [in] | numAvr | Number of averages. |
Definition at line 2202 of file brainview.cpp.
|
slot |
Set the colormap used for sensor streaming visualization.
| [in] | name | Colormap name. |
Definition at line 2209 of file brainview.cpp.
|
slot |
Set the streaming speed for sensor streaming (interval between frames).
| [in] | msec | Interval in milliseconds. |
Definition at line 2188 of file brainview.cpp.
|
slot |
Enable or disable looping for real-time sensor streaming.
| [in] | enabled | True to loop. |
Definition at line 2195 of file brainview.cpp.
|
slot |
Set colormap for sensor field maps.
| [in] | name | Colormap name. |
Definition at line 2086 of file brainview.cpp.
|
slot |
Set contour visibility for sensor field maps.
| [in] | type | "MEG" or "EEG". |
| [in] | visible | Visibility state. |
Definition at line 2049 of file brainview.cpp.
|
slot |
Set the time point for sensor field maps.
| [in] | index | Time sample index. |
Definition at line 2012 of file brainview.cpp.
|
slot |
Set visibility for sensor field maps.
| [in] | type | "MEG" or "EEG". |
| [in] | visible | Visibility state. |
Definition at line 2031 of file brainview.cpp.
|
slot |
Set whether sensor transformations (if loaded) should be applied.
| [in] | enabled | True to apply transformations, False to show original positions. |
Definition at line 773 of file brainview.cpp.
|
slot |
Toggle visibility of sensor groups.
| [in] | type | "MEG", "EEG", or "Digitizer". |
| [in] | visible | Visibility state. |
Definition at line 746 of file brainview.cpp.
|
slot |
Set the shader mode (Standard, Holographic, Atlas).
| [in] | mode | The shader mode to set. |
Definition at line 547 of file brainview.cpp.
|
slot |
Set the colormap for source estimate visualization.
| [in] | name | Colormap name ("Hot", "Jet", etc.). |
Definition at line 1881 of file brainview.cpp.
|
slot |
Toggle visibility of source space points.
| [in] | visible | Visibility state. |
Definition at line 2341 of file brainview.cpp.
|
slot |
Set threshold values for source estimate visualization.
| [in] | min | Minimum threshold. |
| [in] | mid | Mid-point threshold. |
| [in] | max | Maximum threshold. |
Definition at line 1889 of file brainview.cpp.
|
slot |
Set the current time point for source estimate visualization.
| [in] | index | Time sample index. |
Definition at line 1873 of file brainview.cpp.
|
slot |
Set the number of visible viewport panes (1–4).
| [in] | count | Number of panes: 1 = single, 2 = side-by-side, 3 = two + one, 4 = 2×2 grid. |
Definition at line 902 of file brainview.cpp.
|
slot |
Set the camera preset for a specific viewport.
| [in] | index | Viewport index (0–3). |
| [in] | preset | Camera preset (0=Top, 1=Perspective, 2=Front, 3=Left, 4=Bottom, 5=Back, 6=Right). |
Definition at line 1284 of file brainview.cpp.
|
slot |
Enable or disable a specific viewport in multi-view mode.
| [in] | index | Viewport index (0=Top, 1=Perspective, 2=Front, 3=Left). |
| [in] | enabled | True to enable, false to disable. |
Definition at line 1271 of file brainview.cpp.
|
slot |
Select which view's visualization settings are edited by UI controls.
| [in] | target | -1=Single, 0=Top, 1=Perspective, 2=Front, 3=Left. |
Definition at line 559 of file brainview.cpp.
|
slot |
Set the overlay mode (Surface, Annotation, Scientific).
| [in] | mode | The visualization mode to set. |
Definition at line 800 of file brainview.cpp.
|
slot |
Get configured shader mode name for a target view.
Definition at line 615 of file brainview.cpp.
|
slot |
Switch to multi-view mode (four viewports: top, perspective, front, left).
Definition at line 891 of file brainview.cpp.
|
slot |
Switch to single-view mode (one viewport, interactive camera).
Definition at line 877 of file brainview.cpp.
|
signal |
Emitted when a source estimate is loaded.
| [in] | numTimePoints | Number of time samples in the source estimate. |
|
signal |
Emitted when auto-thresholds are set from loaded source estimate data.
| [in] | min | Minimum threshold. |
| [in] | mid | Mid threshold. |
| [in] | max | Maximum threshold. |
|
slot |
Start real-time sensor data streaming for the specified modality. Creates the controller (if needed), feeds the loaded evoked data column-by-column, and begins the timer-driven streaming loop.
Requires that sensor field data (evoked) has been loaded and the mapping matrix is built.
| [in] | modality | "MEG" or "EEG". |
Definition at line 2160 of file brainview.cpp.
|
slot |
Start real-time source data streaming. Creates the controller (if needed), feeds the loaded STC data column-by-column, and begins the timer-driven streaming loop.
Definition at line 1897 of file brainview.cpp.
|
signal |
Emitted to report STC loading progress.
| [in] | percent | Progress percentage (0-100). |
| [in] | message | Status message. |
|
slot |
Get the number of time points in the loaded source estimate.
Definition at line 2112 of file brainview.cpp.
|
slot |
Get the time step of the loaded source estimate.
Definition at line 2098 of file brainview.cpp.
|
slot |
Get the start time of the loaded source estimate.
Definition at line 2105 of file brainview.cpp.
|
slot |
Stop real-time sensor data streaming.
Definition at line 2167 of file brainview.cpp.
|
slot |
Stop real-time source data streaming.
Definition at line 1905 of file brainview.cpp.
|
slot |
Synchronize all BEM shader targets to their respective brain shader targets.
Definition at line 733 of file brainview.cpp.
|
signal |
Emitted when the time point changes.
| [in] | index | Time sample index. |
| [in] | time | Time in seconds. |
|
inlineslot |
Definition at line 313 of file brainview.h.
|
inlineslot |
|
slot |
Get the camera preset for a specific viewport.
| [in] | index | Viewport index (0–3). |
Definition at line 1299 of file brainview.cpp.
|
slot |
Get current visualization edit target.
Definition at line 601 of file brainview.cpp.
|
signal |
Emitted when the active visualization edit target changes.
| [in] | target | New target index (-1 = single, 0..N-1 = multi pane). |
|
overrideprotected |
Definition at line 1825 of file brainview.cpp.