v2.0.0
Loading...
Searching...
No Matches
BrainView Class Reference

Top-level QWidget hosting the QRhi-based 3-D brain visualization with mouse interaction and multi-view support. More...

#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 ()
bool savePng (const QString &path, int width=1200, int height=800, const QString &surfaceType=QStringLiteral("pial"))
void showSingleView ()
void showMultiView ()
void setViewCount (int count)
int viewCount () const
void setViewportEnabled (int index, bool enabled)
void setViewportCameraPreset (int index, int preset)
void resetSingleViewCameraState ()
void resetViewportCameraState (int index)
void resetAllSubViewState ()
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)
QMap< int, QVector3D > cardinalFiducialsInMri () const
 Return cardinal fiducials (NAS/LPA/RPA) transformed to MRI coordinates.
bool bemTopVertexInMri (QVector3D &pos) const
 Return the highest-Z vertex of the BEM head surface in MRI coords.
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)
void clearSurfaces ()
void clearBem ()
void clearSourceEstimate ()
void clearDipoles ()
void clearSourceSpace ()
void clearSensors ()
void setLiveMarkers (const QVector< LiveMarker > &markers)
void clearLiveMarkers ()
void setLiveRay (const QVector3D &from, const QVector3D &to, const QColor &color, float radius=0.001f)
void clearLiveRay ()
void setProbeVisualization (const QVector3D &tip, const QVector3D &direction, float length, const QColor &color, const QColor &glowColor=QColor(0, 0, 0, 0), const QQuaternion &orientation=QQuaternion(0, 0, 0, 0))
void clearProbeVisualization ()
void setStaticMarkers (const QVector< LiveMarker > &markers)
void clearStaticMarkers ()
void setCameraFocusOverride (const QVector3D &center, float size)
void clearCameraFocusOverride ()
void clearEvoked ()
void clearTransformation ()
void clearNetwork ()
void stopAllStreaming ()
void setVideoOverlayEnabled (bool enabled)
bool isVideoOverlayEnabled () const
void setVideoOverlayFocusPosition (const QVector3D &position)
void setVideoOverlayUpHint (const QVector3D &dir)
void setVideoOverlaySize (float meters)
void setVideoOverlayOpacity (float opacity)
void pushVideoOverlayFrame (const QImage &frame)
void setVideoDepthEnabled (bool enabled)
void setVideoDepthScale (float scale)
void setVideoDepthSteps (int steps)
void pushVideoDepthFrame (const QImage &depthFrame)
bool intersectWorldRay (const QVector3D &origin, const QVector3D &direction, QVector3D &hitPoint) const
 Intersect a world-space ray with loaded scene geometry.
void setSlice (int slotIndex, DISP3DLIB::SliceObject *slice)
void setSliceVisible (int slotIndex, bool visible)
void setMriSlicesVisible (bool visible)

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 &regionName)
void visualizationEditTargetChanged (int target)
void viewCountChanged (int count)
void shaderModeChanged (const QString &modeName)
void surfacePointClicked (const QVector3D &worldPos)
void surfacePointDoubleClicked (const QVector3D &worldPos)

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 mouseDoubleClickEvent (QMouseEvent *event) override
void wheelEvent (QWheelEvent *event) override
void keyPressEvent (QKeyEvent *event) override
void resizeEvent (QResizeEvent *event) override

Detailed Description

Top-level QWidget hosting the QRhi-based 3-D brain visualization with mouse interaction and multi-view support.

BrainView is the main widget for the 3D brain visualization. It handles user interaction, surface loading, and coordinates with the BrainRenderer.

Definition at line 91 of file brainview.h.

Inheritance diagram for BrainView:
Inheritance graph

Member Enumeration Documentation

◆ 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 99 of file brainview.h.

Constructor & Destructor Documentation

◆ BrainView()

BrainView::BrainView ( QWidget * parent = nullptr)
explicit

Constructor

Parameters
[in]parentParent widget.

Definition at line 76 of file brainview.cpp.

◆ ~BrainView()

BrainView::~BrainView ( )

Destructor

Definition at line 201 of file brainview.cpp.

Member Function Documentation

◆ activeSurfaceForTarget

QString BrainView::activeSurfaceForTarget ( int target) const
slot

Get configured surface type for a target view.

Definition at line 601 of file brainview.cpp.

◆ bemShaderModeForTarget

QString BrainView::bemShaderModeForTarget ( int target) const
slot

Get configured BEM shader mode name for a target view.

Definition at line 615 of file brainview.cpp.

◆ bemTopVertexInMri

bool BrainView::bemTopVertexInMri ( QVector3D & pos) const
slot

Return the highest-Z vertex of the BEM head surface in MRI coords.

This is the top-of-head (vertex/CZ) reference used for orientation validation during Polhemus coregistration.

Parameters
[out]posThe vertex position (metres, MRI/surface-RAS).
Returns
True if a BEM head surface is loaded; false otherwise.

Definition at line 2596 of file brainview.cpp.

◆ cardinalFiducialsInMri

QMap< int, QVector3D > BrainView::cardinalFiducialsInMri ( ) const
slot

Return cardinal fiducials (NAS/LPA/RPA) transformed to MRI coordinates.

Returns an empty map when no cardinal dig points are loaded or when no head-to-MRI transform is available. Keys are the FIFF ident values (FIFFV_POINT_LPA=1, FIFFV_POINT_NASION=2, FIFFV_POINT_RPA=3).

Definition at line 2574 of file brainview.cpp.

◆ castRay

void BrainView::castRay ( const QPoint & pos)
slot

Cast rays from screen position to find intersected objects.

Parameters
[in]pos2D mouse position.

Definition at line 2746 of file brainview.cpp.

◆ clearBem

void BrainView::clearBem ( )
slot

Remove all BEM surfaces from the scene.

Definition at line 3065 of file brainview.cpp.

◆ clearCameraFocusOverride

void BrainView::clearCameraFocusOverride ( )
slot

Remove the camera focus override; revert to auto-computed bounds.

Definition at line 3430 of file brainview.cpp.

◆ clearDipoles

void BrainView::clearDipoles ( )
slot

Remove dipole objects from the scene.

Definition at line 3117 of file brainview.cpp.

◆ clearEvoked

void BrainView::clearEvoked ( )
slot

Remove evoked / sensor field mapping data.

Definition at line 3481 of file brainview.cpp.

◆ clearLiveMarkers

void BrainView::clearLiveMarkers ( )
slot

Remove all live overlay markers.

Definition at line 3200 of file brainview.cpp.

◆ clearLiveRay

void BrainView::clearLiveRay ( )
slot

Remove the live ray from the scene.

Definition at line 3231 of file brainview.cpp.

◆ clearNetwork

void BrainView::clearNetwork ( )
slot

Remove the connectivity network from the scene.

Definition at line 3499 of file brainview.cpp.

◆ clearProbeVisualization

void BrainView::clearProbeVisualization ( )
slot

Remove the probe visualization from the scene.

Definition at line 3360 of file brainview.cpp.

◆ clearSensors

void BrainView::clearSensors ( )
slot

Remove sensor geometry, digitizer points, and the MEG helmet surface.

Definition at line 3440 of file brainview.cpp.

◆ clearSourceEstimate

void BrainView::clearSourceEstimate ( )
slot

Remove source estimate data and restore surface colours.

Definition at line 3104 of file brainview.cpp.

◆ clearSourceSpace

void BrainView::clearSourceSpace ( )
slot

Remove source space points from the scene.

Definition at line 3137 of file brainview.cpp.

◆ clearStaticMarkers

void BrainView::clearStaticMarkers ( )
slot

Remove all static overlay markers.

Definition at line 3404 of file brainview.cpp.

◆ clearSurfaces

void BrainView::clearSurfaces ( )
slot

Remove all brain surfaces (pial, white, inflated) and their annotations.

Definition at line 3022 of file brainview.cpp.

◆ clearTransformation

void BrainView::clearTransformation ( )
slot

Remove the head-to-MRI coordinate transformation.

Definition at line 3490 of file brainview.cpp.

◆ closestSensorFieldIndex

int BrainView::closestSensorFieldIndex ( float timeSec) const
slot

Find the closest sensor field time index for a given time in seconds.

Parameters
[in]timeSecTime in seconds.
Returns
Closest sample index, or -1 if no sensor field data loaded.

Definition at line 2427 of file brainview.cpp.

◆ closestStcIndex

int BrainView::closestStcIndex ( float timeSec) const
slot

Find the closest STC time index for a given time in seconds.

Parameters
[in]timeSecTime in seconds.
Returns
Closest sample index, or -1 if no STC data loaded.

Definition at line 2447 of file brainview.cpp.

◆ hoveredRegionChanged

void BrainView::hoveredRegionChanged ( const QString & regionName)
signal

Emitted when the hovered brain region changes.

Parameters
[in]regionNameName of the region under the cursor.

◆ initialize()

void BrainView::initialize ( QRhiCommandBuffer * cb)
overrideprotected

Definition at line 1420 of file brainview.cpp.

◆ intersectWorldRay

bool BrainView::intersectWorldRay ( const QVector3D & origin,
const QVector3D & direction,
QVector3D & hitPoint ) const
slot

Intersect a world-space ray with loaded scene geometry.

Tests the ray against all visible surfaces (BEM, cortical, sensors) and returns the closest hit point.

Parameters
[in]originRay origin in world (model) space (metres).
[in]directionRay direction (unit vector).
[out]hitPointIntersection point in world (model) space.
Returns
true if the ray hits a surface; false otherwise.

Definition at line 3608 of file brainview.cpp.

◆ isInfoPanelVisible

bool BrainView::isInfoPanelVisible ( ) const
inlineslot

Whether the info panel is currently visible.

Returns
True if visible.

Definition at line 463 of file brainview.h.

◆ isRealtimeSensorStreaming

bool BrainView::isRealtimeSensorStreaming ( ) const
slot

Check whether real-time sensor streaming is active.

Returns
True if streaming.

Definition at line 2482 of file brainview.cpp.

◆ isRealtimeStreaming

bool BrainView::isRealtimeStreaming ( ) const
slot

Check whether real-time streaming is active.

Returns
True if streaming.

Definition at line 2220 of file brainview.cpp.

◆ isVideoOverlayEnabled

bool BrainView::isVideoOverlayEnabled ( ) const
slot
Returns
Whether the video overlay is currently enabled.

Definition at line 3538 of file brainview.cpp.

◆ isViewportEnabled

bool BrainView::isViewportEnabled ( int index) const
slot

Check if a multi-view viewport is enabled.

Parameters
[in]indexViewport index (0=Top, 1=Perspective, 2=Front, 3=Left).
Returns
True if enabled, false otherwise.

Definition at line 992 of file brainview.cpp.

◆ keyPressEvent()

void BrainView::keyPressEvent ( QKeyEvent * event)
overrideprotected

Definition at line 2151 of file brainview.cpp.

◆ loadDipoles

bool BrainView::loadDipoles ( const QString & dipPath)
slot

Load dipoles from a .dip or .bdip file.

Parameters
[in]dipPathPath to the dipole file.
Returns
True if successful.

Definition at line 2631 of file brainview.cpp.

◆ loadMegHelmetSurface

bool BrainView::loadMegHelmetSurface ( const QString & helmetFilePath)
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.

Parameters
[in]helmetFilePathAbsolute path to a helmet BEM FIF file.
Returns
True if the helmet surface was loaded successfully.

Definition at line 2615 of file brainview.cpp.

◆ loadNetwork

bool BrainView::loadNetwork ( const CONNECTIVITYLIB::Network & network,
const QString & name = "Network" )
slot

Load a connectivity network for visualization.

Parameters
[in]networkThe connectivity network to visualize.
[in]nameDisplay name for the network.
Returns
True if successful.

Definition at line 2641 of file brainview.cpp.

◆ loadSensorField

bool BrainView::loadSensorField ( const QString & evokedPath,
int aveIndex = 0 )
slot

Load sensor measurements from an evoked/average FIF file.

Parameters
[in]evokedPathPath to the evoked/average FIF file.
[in]aveIndexDataset index to load from the file.
Returns
True if successful.

Definition at line 2279 of file brainview.cpp.

◆ loadSensors

bool BrainView::loadSensors ( const QString & fifPath)
slot

Load sensors (MEG/EEG/Digitizers) from a FIF file.

Parameters
[in]fifPathPath to the FIF file.
Returns
True if successful.

Definition at line 2541 of file brainview.cpp.

◆ loadSourceEstimate

bool BrainView::loadSourceEstimate ( const QString & lhPath,
const QString & rhPath )
slot

Load source estimate files (.stc) for both hemispheres.

Parameters
[in]lhPathPath to left hemisphere .stc file.
[in]rhPathPath to right hemisphere .stc file.
Returns
True if successful.

Definition at line 2165 of file brainview.cpp.

◆ loadSourceSpace

bool BrainView::loadSourceSpace ( const QString & fwdPath)
slot

Load source space from a FIF file (forward solution or source space file).

Parameters
[in]fwdPathPath to the FIF file containing source space data.
Returns
True if successful.

Definition at line 2690 of file brainview.cpp.

◆ loadTransformation

bool BrainView::loadTransformation ( const QString & transPath)
slot

Load a coordinate transformation from a FIF file.

Parameters
[in]transPathPath to the transformation file.
Returns
True if successful.

Definition at line 2710 of file brainview.cpp.

◆ megFieldMapOnHeadForTarget

bool BrainView::megFieldMapOnHeadForTarget ( int target) const
slot

Check whether MEG field mapping uses head surface for a target.

Parameters
[in]target-1=Single, 0=Top, 1=Perspective, 2=Front, 3=Left.
Returns
True if MEG map uses head surface.

Definition at line 671 of file brainview.cpp.

◆ mouseDoubleClickEvent()

void BrainView::mouseDoubleClickEvent ( QMouseEvent * event)
overrideprotected

Definition at line 2119 of file brainview.cpp.

◆ mouseMoveEvent()

void BrainView::mouseMoveEvent ( QMouseEvent * event)
overrideprotected

Definition at line 2020 of file brainview.cpp.

◆ mousePressEvent()

void BrainView::mousePressEvent ( QMouseEvent * event)
overrideprotected

Definition at line 1979 of file brainview.cpp.

◆ mouseReleaseEvent()

void BrainView::mouseReleaseEvent ( QMouseEvent * event)
overrideprotected

Definition at line 2082 of file brainview.cpp.

◆ objectVisibleForTarget

bool BrainView::objectVisibleForTarget ( const QString & object,
int target ) const
slot

Check object visibility for a given target view.

Parameters
[in]objectObject key (e.g. "lh", "bem_head", "sens_meg").
[in]target-1=Single, 0=Top, 1=Perspective, 2=Front, 3=Left.
Returns
True if visible, false otherwise.

Definition at line 664 of file brainview.cpp.

◆ onDataChanged

void BrainView::onDataChanged ( const QModelIndex & topLeft,
const QModelIndex & bottomRight,
const QVector< int > & roles )
slot

Definition at line 432 of file brainview.cpp.

◆ onRowsInserted

void BrainView::onRowsInserted ( const QModelIndex & parent,
int first,
int last )
slot

Definition at line 227 of file brainview.cpp.

◆ overlayModeForTarget

QString BrainView::overlayModeForTarget ( int target) const
slot

Get configured overlay mode name for a target view.

Definition at line 622 of file brainview.cpp.

◆ probeEvokedSets

QStringList BrainView::probeEvokedSets ( const QString & evokedPath)
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.

Parameters
[in]evokedPathPath to the evoked/average FIF file.
Returns
Descriptive labels for each evoked set.

Definition at line 2313 of file brainview.cpp.

◆ pushRealtimeSensorData

void BrainView::pushRealtimeSensorData ( const Eigen::VectorXf & data)
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).

Parameters
[in]dataSensor measurement vector.

Definition at line 2489 of file brainview.cpp.

◆ pushRealtimeSourceData

void BrainView::pushRealtimeSourceData ( const Eigen::VectorXd & data)
slot

Push a single source-data vector into the real-time pipeline. The vector should contain source values for all sources (LH + RH concatenated).

Parameters
[in]dataSource activity vector.

Definition at line 2227 of file brainview.cpp.

◆ pushVideoDepthFrame

void BrainView::pushVideoDepthFrame ( const QImage & depthFrame)
slot

Push a monocular depth map corresponding to the current video frame.

Definition at line 3599 of file brainview.cpp.

◆ pushVideoOverlayFrame

void BrainView::pushVideoOverlayFrame ( const QImage & frame)
slot

Push a new video frame to the overlay (e.g. from QVideoSink).

Definition at line 3571 of file brainview.cpp.

◆ render()

void BrainView::render ( QRhiCommandBuffer * cb)
overrideprotected

Definition at line 1434 of file brainview.cpp.

◆ resetAllSubViewState

void BrainView::resetAllSubViewState ( )
slot

Reset all per-pane SubView state (camera, visibility, shaders, surface type, overlay) to its index-specific factory defaults and reset the single-view state too. Use this when an embedding application wants a clean slate that ignores any settings persisted by previous runs or other hosts of BrainView.

Definition at line 1376 of file brainview.cpp.

◆ resetMultiViewLayout

void BrainView::resetMultiViewLayout ( )
slot

Reset the multi-view splitter layout to equal-sized panes.

Definition at line 981 of file brainview.cpp.

◆ resetSingleViewCameraState

void BrainView::resetSingleViewCameraState ( )
slot

Reset single-view camera state (rotation and zoom) to defaults.

Definition at line 1351 of file brainview.cpp.

◆ resetViewportCameraState

void BrainView::resetViewportCameraState ( int index)
slot

Reset one multi-view pane's camera state (zoom, pan, perspective rotation).

Parameters
[in]indexViewport index (0–3).

Definition at line 1361 of file brainview.cpp.

◆ resizeEvent()

void BrainView::resizeEvent ( QResizeEvent * event)
overrideprotected

Definition at line 1411 of file brainview.cpp.

◆ savePng

bool BrainView::savePng ( const QString & path,
int width = 1200,
int height = 800,
const QString & surfaceType = QStringLiteral("pial") )
slot

Render the scene offscreen and save to a PNG file.

Uses Qt::WA_DontShowOnScreen so no window manager surface is created — works on headless CI runners without Xvfb. The widget is temporarily shown to trigger QRhi initialization, then grabFramebuffer() reads pixels back from the GPU.

Parameters
[in]pathOutput PNG file path.
[in]widthRender width in pixels (default 1200).
[in]heightRender height in pixels (default 800).
[in]surfaceTypeSurface type to match (default "pial").
Returns
true on success, false on failure.

Definition at line 870 of file brainview.cpp.

◆ saveSnapshot

void BrainView::saveSnapshot ( )
slot

Save a snapshot of the current view to a file.

Definition at line 860 of file brainview.cpp.

◆ sensorFieldLoaded

void BrainView::sensorFieldLoaded ( int numTimePoints,
int initialTimePoint = 0 )
signal

Emitted when sensor field data is loaded.

Parameters
[in]numTimePointsNumber of time samples.

◆ sensorFieldTimePointChanged

void BrainView::sensorFieldTimePointChanged ( int index,
float time )
signal

Emitted when the sensor field time point changes.

Parameters
[in]indexTime sample index.
[in]timeTime in seconds.

◆ sensorFieldTimeRange

bool BrainView::sensorFieldTimeRange ( float & tmin,
float & tmax ) const
slot

Get the time range of the loaded sensor field (evoked) data.

Parameters
[out]tminStart time in seconds.
[out]tmaxEnd time in seconds.
Returns
True if sensor field data is loaded, false otherwise.

Definition at line 2454 of file brainview.cpp.

◆ setActiveSurface

void BrainView::setActiveSurface ( const QString & type)
slot

Set the active surface type to search for (e.g. "pial").

Parameters
[in]typeThe surface type to activate.

Definition at line 466 of file brainview.cpp.

◆ setBemHighContrast

void BrainView::setBemHighContrast ( bool enabled)
slot

Set whether BEM surfaces should use their standard (colorful) definition or white.

Parameters
[in]enabledTrue to use standard colors (Red/Green/Blue), False for White.

Definition at line 840 of file brainview.cpp.

◆ setBemShaderMode

void BrainView::setBemShaderMode ( const QString & mode)
slot

Set the shader mode for BEM surfaces (Standard, Holographic, Atlas).

Parameters
[in]modeThe shader mode to set.

Definition at line 713 of file brainview.cpp.

◆ setBemVisible

void BrainView::setBemVisible ( const QString & name,
bool visible )
slot

Toggle visibility of a BEM surface layer.

Parameters
[in]name"head", "outer_skull", or "inner_skull".
[in]visibleVisibility state.

Definition at line 832 of file brainview.cpp.

◆ setCameraFocusOverride

void BrainView::setCameraFocusOverride ( const QVector3D & center,
float size )
slot

Override the auto-computed scene center and size. While active, updateSceneBounds() results are ignored for camera framing.

Definition at line 3421 of file brainview.cpp.

◆ setDipoleVisible

void BrainView::setDipoleVisible ( bool visible)
slot

Toggle visibility of dipoles.

Parameters
[in]visibleVisibility state.

Definition at line 782 of file brainview.cpp.

◆ setHemiVisible

void BrainView::setHemiVisible ( int hemiIdx,
bool visible )
slot

Toggle visibility of a hemisphere.

Parameters
[in]hemiIdx0 for LH, 1 for RH.
[in]visibleVisibility state.

Definition at line 818 of file brainview.cpp.

◆ setInfoPanelVisible

void BrainView::setInfoPanelVisible ( bool visible)
slot

Show or hide the info panel (FPS, vertices, shader).

Parameters
[in]visibleTrue to show, false to hide.

Definition at line 1402 of file brainview.cpp.

◆ setInitialCameraRotation()

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).

Parameters
[in]rotationInitial camera rotation quaternion.

Definition at line 220 of file brainview.cpp.

◆ setLightingEnabled

void BrainView::setLightingEnabled ( bool enabled)
slot

Enable or disable lighting for the scene.

Parameters
[in]enabledTrue to enable lighting, false to disable.

Definition at line 852 of file brainview.cpp.

◆ setLiveMarkers

void BrainView::setLiveMarkers ( const QVector< LiveMarker > & markers)
slot

Replace the set of live overlay markers.

Renders each marker as a small sphere without touching the model or recalculating scene bounds, so the camera stays locked.

Definition at line 3176 of file brainview.cpp.

◆ setLiveRay

void BrainView::setLiveRay ( const QVector3D & from,
const QVector3D & to,
const QColor & color,
float radius = 0.001f )
slot

Set a semi-transparent ray cylinder between two world-space points.

Parameters
[in]fromRay origin (metres).
[in]toRay end point (metres).
[in]colorRay color (alpha channel controls transparency).
[in]radiusCylinder radius (metres, default 0.001 = 1 mm).

Definition at line 3217 of file brainview.cpp.

◆ setMegFieldMapOnHead

void BrainView::setMegFieldMapOnHead ( bool useHead)
slot

Choose MEG mapping surface (helmet or head).

Parameters
[in]useHeadTrue to map MEG on head surface.

Definition at line 2375 of file brainview.cpp.

◆ setMegHelmetOverride

void BrainView::setMegHelmetOverride ( const QString & path)
slot

Override the auto-selected MEG helmet surface path.

Parameters
[in]pathAbsolute path to a helmet surface file. Empty to use auto selection.

Definition at line 777 of file brainview.cpp.

◆ setModel()

void BrainView::setModel ( BrainTreeModel * model)

Set the data model.

Parameters
[in]modelPointer to BrainTreeModel.

Definition at line 208 of file brainview.cpp.

◆ setMriSlicesVisible

void BrainView::setMriSlicesVisible ( bool visible)
slot

Toggle MRI slice visibility for the current edit-target viewport.

Parameters
[in]visibleWhether MRI slices should be drawn in the active viewport.

Definition at line 3668 of file brainview.cpp.

◆ setNetworkColormap

void BrainView::setNetworkColormap ( const QString & name)
slot

Set the colormap for connectivity network visualization.

Parameters
[in]nameColormap name ("Hot", "Jet", etc.).

Definition at line 2680 of file brainview.cpp.

◆ setNetworkThreshold

void BrainView::setNetworkThreshold ( double threshold)
slot

Set the threshold for connectivity network edge filtering.

Parameters
[in]thresholdThreshold value (0.0–1.0).

Definition at line 2670 of file brainview.cpp.

◆ setNetworkVisible

void BrainView::setNetworkVisible ( bool visible)
slot

Toggle visibility of connectivity network.

Parameters
[in]visibleVisibility state.

Definition at line 2658 of file brainview.cpp.

◆ setProbeVisualization

void BrainView::setProbeVisualization ( const QVector3D & tip,
const QVector3D & direction,
float length,
const QColor & color,
const QColor & glowColor = QColor(0, 0, 0, 0),
const QQuaternion & orientation = QQuaternion(0, 0, 0, 0) )
slot

Show a catheter-style probe visualization (cylinder shaft + sphere tip with an optional pulsing glow aura).

Parameters
[in]tipProbe tip position (metres, model space).
[in]directionProbe forward axis (unit vector, model space).
[in]lengthVisible shaft length behind the tip (metres).
[in]colorProbe core color.
[in]glowColorOuter glow aura color (default: transparent = no glow).
[in]orientationFull probe orientation for drawing a debug coordinate frame (X=red, Y=green, Z=blue). Pass a null quaternion to skip axes.

Definition at line 3239 of file brainview.cpp.

◆ setRealtimeInterval

void BrainView::setRealtimeInterval ( int msec)
slot

Set the streaming speed (interval between frames).

Parameters
[in]msecInterval in milliseconds.

Definition at line 2234 of file brainview.cpp.

◆ setRealtimeLooping

void BrainView::setRealtimeLooping ( bool enabled)
slot

Enable or disable looping for real-time streaming.

Parameters
[in]enabledTrue to loop.

Definition at line 2241 of file brainview.cpp.

◆ setRealtimeSensorAverages

void BrainView::setRealtimeSensorAverages ( int numAvr)
slot

Set the number of averages for sensor streaming.

Parameters
[in]numAvrNumber of averages.

Definition at line 2510 of file brainview.cpp.

◆ setRealtimeSensorColormap

void BrainView::setRealtimeSensorColormap ( const QString & name)
slot

Set the colormap used for sensor streaming visualization.

Parameters
[in]nameColormap name.

Definition at line 2517 of file brainview.cpp.

◆ setRealtimeSensorInterval

void BrainView::setRealtimeSensorInterval ( int msec)
slot

Set the streaming speed for sensor streaming (interval between frames).

Parameters
[in]msecInterval in milliseconds.

Definition at line 2496 of file brainview.cpp.

◆ setRealtimeSensorLooping

void BrainView::setRealtimeSensorLooping ( bool enabled)
slot

Enable or disable looping for real-time sensor streaming.

Parameters
[in]enabledTrue to loop.

Definition at line 2503 of file brainview.cpp.

◆ setSensorFieldColormap

void BrainView::setSensorFieldColormap ( const QString & name)
slot

Set colormap for sensor field maps.

Parameters
[in]nameColormap name.

Definition at line 2394 of file brainview.cpp.

◆ setSensorFieldContourVisible

void BrainView::setSensorFieldContourVisible ( const QString & type,
bool visible )
slot

Set contour visibility for sensor field maps.

Parameters
[in]type"MEG" or "EEG".
[in]visibleVisibility state.

Definition at line 2357 of file brainview.cpp.

◆ setSensorFieldTimePoint

void BrainView::setSensorFieldTimePoint ( int index)
slot

Set the time point for sensor field maps.

Parameters
[in]indexTime sample index.

Definition at line 2320 of file brainview.cpp.

◆ setSensorFieldVisible

void BrainView::setSensorFieldVisible ( const QString & type,
bool visible )
slot

Set visibility for sensor field maps.

Parameters
[in]type"MEG" or "EEG".
[in]visibleVisibility state.

Definition at line 2339 of file brainview.cpp.

◆ setSensorTransEnabled

void BrainView::setSensorTransEnabled ( bool enabled)
slot

Set whether sensor transformations (if loaded) should be applied.

Parameters
[in]enabledTrue to apply transformations, False to show original positions.

Definition at line 766 of file brainview.cpp.

◆ setSensorVisible

void BrainView::setSensorVisible ( const QString & type,
bool visible )
slot

Toggle visibility of sensor groups.

Parameters
[in]type"MEG", "EEG", or "Digitizer".
[in]visibleVisibility state.

Definition at line 739 of file brainview.cpp.

◆ setShaderMode

void BrainView::setShaderMode ( const QString & mode)
slot

Set the shader mode (Standard, Holographic, Atlas).

Parameters
[in]modeThe shader mode to set.

Definition at line 539 of file brainview.cpp.

◆ setSlice

void BrainView::setSlice ( int slotIndex,
DISP3DLIB::SliceObject * slice )
slot

Set an MRI slice to be rendered in the 3-D scene.

Parameters
[in]slotIndexSlot index (0=axial, 1=coronal, 2=sagittal).
[in]slicePointer to SliceObject, or nullptr to hide.

Definition at line 3650 of file brainview.cpp.

◆ setSliceVisible

void BrainView::setSliceVisible ( int slotIndex,
bool visible )
slot

Toggle visibility of an MRI slice slot.

Parameters
[in]slotIndexSlot index (0=axial, 1=coronal, 2=sagittal).
[in]visibleWhether this slice should be drawn.

Definition at line 3658 of file brainview.cpp.

◆ setSourceColormap

void BrainView::setSourceColormap ( const QString & name)
slot

Set the colormap for source estimate visualization.

Parameters
[in]nameColormap name ("Hot", "Jet", etc.).

Definition at line 2189 of file brainview.cpp.

◆ setSourceSpaceVisible

void BrainView::setSourceSpaceVisible ( bool visible)
slot

Toggle visibility of source space points.

Parameters
[in]visibleVisibility state.

Definition at line 2700 of file brainview.cpp.

◆ setSourceThresholds

void BrainView::setSourceThresholds ( float min,
float mid,
float max )
slot

Set threshold values for source estimate visualization.

Parameters
[in]minMinimum threshold.
[in]midMid-point threshold.
[in]maxMaximum threshold.

Definition at line 2197 of file brainview.cpp.

◆ setStaticMarkers

void BrainView::setStaticMarkers ( const QVector< LiveMarker > & markers)
slot

Replace the set of static overlay markers (fiducials, acquired points). These persist across frames and are always visible.

Definition at line 3384 of file brainview.cpp.

◆ setTimePoint

void BrainView::setTimePoint ( int index)
slot

Set the current time point for source estimate visualization.

Parameters
[in]indexTime sample index.

Definition at line 2181 of file brainview.cpp.

◆ setVideoDepthEnabled

void BrainView::setVideoDepthEnabled ( bool enabled)
slot

Enable or disable depth-based parallax relief on the video overlay.

Definition at line 3578 of file brainview.cpp.

◆ setVideoDepthScale

void BrainView::setVideoDepthScale ( float scale)
slot

Set the parallax occlusion displacement scale [0..1].

Definition at line 3585 of file brainview.cpp.

◆ setVideoDepthSteps

void BrainView::setVideoDepthSteps ( int steps)
slot

Set the number of POM ray-march steps (quality vs. performance).

Definition at line 3592 of file brainview.cpp.

◆ setVideoOverlayEnabled

void BrainView::setVideoOverlayEnabled ( bool enabled)
slot

Enable or disable the generic live video overlay decal that is drawn on top of the head surface at the current focus position.

Definition at line 3530 of file brainview.cpp.

◆ setVideoOverlayFocusPosition

void BrainView::setVideoOverlayFocusPosition ( const QVector3D & position)
slot

Set the world-space focus position (metres) of the overlay quad.

Definition at line 3543 of file brainview.cpp.

◆ setVideoOverlayOpacity

void BrainView::setVideoOverlayOpacity ( float opacity)
slot

Set the overall opacity of the overlay [0..1].

Definition at line 3564 of file brainview.cpp.

◆ setVideoOverlaySize

void BrainView::setVideoOverlaySize ( float meters)
slot

Set the side length of the overlay quad (metres). Default ≈ 0.06 m.

Definition at line 3557 of file brainview.cpp.

◆ setVideoOverlayUpHint

void BrainView::setVideoOverlayUpHint ( const QVector3D & dir)
slot

Set the orientation hint for the overlay quad (world-space direction).

Definition at line 3550 of file brainview.cpp.

◆ setViewCount

void BrainView::setViewCount ( int count)
slot

Set the number of visible viewport panes (1–4).

Parameters
[in]countNumber of panes: 1 = single, 2 = side-by-side, 3 = two + one, 4 = 2×2 grid.

Definition at line 950 of file brainview.cpp.

◆ setViewportCameraPreset

void BrainView::setViewportCameraPreset ( int index,
int preset )
slot

Set the camera preset for a specific viewport.

Parameters
[in]indexViewport index (0–3).
[in]presetCamera preset (0=Top, 1=Perspective, 2=Front, 3=Left, 4=Bottom, 5=Back, 6=Right).

Definition at line 1336 of file brainview.cpp.

◆ setViewportEnabled

void BrainView::setViewportEnabled ( int index,
bool enabled )
slot

Enable or disable a specific viewport in multi-view mode.

Parameters
[in]indexViewport index (0=Top, 1=Perspective, 2=Front, 3=Left).
[in]enabledTrue to enable, false to disable.

Definition at line 1323 of file brainview.cpp.

◆ setVisualizationEditTarget

void BrainView::setVisualizationEditTarget ( int target)
slot

Select which view's visualization settings are edited by UI controls.

Parameters
[in]target-1=Single, 0=Top, 1=Perspective, 2=Front, 3=Left.

Definition at line 552 of file brainview.cpp.

◆ setVisualizationMode

void BrainView::setVisualizationMode ( const QString & mode)
slot

Set the overlay mode (FsSurface, FsAnnotation, Scientific).

Parameters
[in]modeThe visualization mode to set.

Definition at line 793 of file brainview.cpp.

◆ shaderModeChanged

void BrainView::shaderModeChanged ( const QString & modeName)
signal

Emitted whenever the active brain shader mode changes — either via setShaderMode or after restoring persisted state in loadMultiViewSettings.

Parameters
[in]modeNameShader name as accepted by setShaderMode.

◆ shaderModeForTarget

QString BrainView::shaderModeForTarget ( int target) const
slot

Get configured shader mode name for a target view.

Definition at line 608 of file brainview.cpp.

◆ showMultiView

void BrainView::showMultiView ( )
slot

Switch to multi-view mode (four viewports: top, perspective, front, left).

Definition at line 939 of file brainview.cpp.

◆ showSingleView

void BrainView::showSingleView ( )
slot

Switch to single-view mode (one viewport, interactive camera).

Definition at line 925 of file brainview.cpp.

◆ sourceEstimateLoaded

void BrainView::sourceEstimateLoaded ( int numTimePoints)
signal

Emitted when a source estimate is loaded.

Parameters
[in]numTimePointsNumber of time samples in the source estimate.

◆ sourceThresholdsUpdated

void BrainView::sourceThresholdsUpdated ( float min,
float mid,
float max )
signal

Emitted when auto-thresholds are set from loaded source estimate data.

Parameters
[in]minMinimum threshold.
[in]midMid threshold.
[in]maxMaximum threshold.

◆ startRealtimeSensorStreaming

void BrainView::startRealtimeSensorStreaming ( const QString & modality = QStringLiteral("MEG"))
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.

Parameters
[in]modality"MEG" or "EEG".

Definition at line 2468 of file brainview.cpp.

◆ startRealtimeStreaming

void BrainView::startRealtimeStreaming ( )
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 2205 of file brainview.cpp.

◆ stcLoadingProgress

void BrainView::stcLoadingProgress ( int percent,
const QString & message )
signal

Emitted to report STC loading progress.

Parameters
[in]percentProgress percentage (0-100).
[in]messageStatus message.

◆ stcNumTimePoints

int BrainView::stcNumTimePoints ( ) const
slot

Get the number of time points in the loaded source estimate.

Returns
Number of time points. Returns 0 if not loaded.

Definition at line 2420 of file brainview.cpp.

◆ stcStep

float BrainView::stcStep ( ) const
slot

Get the time step of the loaded source estimate.

Returns
Time step in seconds. Returns 0 if not loaded.

Definition at line 2406 of file brainview.cpp.

◆ stcTmin

float BrainView::stcTmin ( ) const
slot

Get the start time of the loaded source estimate.

Returns
Start time in seconds. Returns 0 if not loaded.

Definition at line 2413 of file brainview.cpp.

◆ stopAllStreaming

void BrainView::stopAllStreaming ( )
slot

Stop all active background streaming (source estimate + sensor). Call before destruction to avoid blocking thread joins in destructors.

Definition at line 3519 of file brainview.cpp.

◆ stopRealtimeSensorStreaming

void BrainView::stopRealtimeSensorStreaming ( )
slot

Stop real-time sensor data streaming.

Definition at line 2475 of file brainview.cpp.

◆ stopRealtimeStreaming

void BrainView::stopRealtimeStreaming ( )
slot

Stop real-time source data streaming.

Definition at line 2213 of file brainview.cpp.

◆ surfacePointClicked

void BrainView::surfacePointClicked ( const QVector3D & worldPos)
signal

Emitted on left-click when the click hits a surface.

Parameters
[in]worldPosHit point in world (model) coordinates.

◆ surfacePointDoubleClicked

void BrainView::surfacePointDoubleClicked ( const QVector3D & worldPos)
signal

Emitted on double-click when the click hits a surface.

Parameters
[in]worldPosHit point in world (model) coordinates.

◆ syncBemShadersToBrainShaders

void BrainView::syncBemShadersToBrainShaders ( )
slot

Synchronize all BEM shader targets to their respective brain shader targets.

Definition at line 726 of file brainview.cpp.

◆ timePointChanged

void BrainView::timePointChanged ( int index,
float time )
signal

Emitted when the time point changes.

Parameters
[in]indexTime sample index.
[in]timeTime in seconds.

◆ viewCount

int BrainView::viewCount ( ) const
inlineslot
Returns
Current number of visible viewport panes (1–4).

Definition at line 337 of file brainview.h.

◆ viewCountChanged

void BrainView::viewCountChanged ( int count)
signal

Emitted whenever the number of viewports changes — either via setViewCount or after restoring persisted state in loadMultiViewSettings. UI consumers (e.g. host toolbars) should connect to this to keep their controls in sync.

Parameters
[in]countNumber of viewports (1..kDefaultViewportCount).

◆ viewMode

ViewMode BrainView::viewMode ( ) const
inlineslot

Get the current view mode.

Returns
Current ViewMode.

Definition at line 471 of file brainview.h.

◆ viewportCameraPreset

int BrainView::viewportCameraPreset ( int index) const
slot

Get the camera preset for a specific viewport.

Parameters
[in]indexViewport index (0–3).
Returns
Camera preset index (0–6), or -1 if invalid.

Definition at line 1393 of file brainview.cpp.

◆ visualizationEditTarget

int BrainView::visualizationEditTarget ( ) const
slot

Get current visualization edit target.

Returns
-1=Single, 0=Top, 1=Perspective, 2=Front, 3=Left.

Definition at line 594 of file brainview.cpp.

◆ visualizationEditTargetChanged

void BrainView::visualizationEditTargetChanged ( int target)
signal

Emitted when the active visualization edit target changes.

Parameters
[in]targetNew target index (-1 = single, 0..N-1 = multi pane).

◆ wheelEvent()

void BrainView::wheelEvent ( QWheelEvent * event)
overrideprotected

Definition at line 2133 of file brainview.cpp.


The documentation for this class was generated from the following files: