ChannelDataView – high-performance, GPU-accelerated channel signal viewer. More...
#include <channeldataview.h>
Public Types | |
| typedef QSharedPointer< ChannelDataView > | SPtr |
| typedef QSharedPointer< const ChannelDataView > | ConstSPtr |
| Public Types inherited from DISPLIB::AbstractView | |
| enum | StyleMode { Default , Dark } |
| enum | GuiMode { Clinical , Research } |
| enum | ProcessingMode { RealTime , Offline } |
| typedef QSharedPointer< AbstractView > | SPtr |
| typedef QSharedPointer< const AbstractView > | ConstSPtr |
Signals | |
| void | sampleClicked (int sample) |
| void | scrollPositionChanged (int sample) |
| void | sampleRangeSelected (int startSample, int endSample) |
| void | annotationBoundaryMoved (int annotationIndex, bool isStartBoundary, int newSample) |
| void | referenceMarkerAddRequested (int sample) |
| void | referenceMarkerRemoveRequested (int sample) |
| void | referenceMarkersClearRequested () |
| void | crosshairToggled (bool on) |
| void | butterflyToggled (bool on) |
| void | scalebarsToggled (bool on) |
| void | eventsVisibleToggled (bool on) |
| void | annotationsVisibleToggled (bool on) |
| void | overviewBarToggled (bool on) |
| void | scrollSpeedChanged (float factor) |
| void | epochMarkersToggled (bool on) |
| void | clippingToggled (bool on) |
| void | zScoreModeToggled (bool on) |
| void | cursorDataChanged (float timeSec, float amplitude, const QString &channelName, const QString &unitLabel) |
| Signals inherited from DISPLIB::AbstractView | |
| void | guiStyleChanged (DISPLIB::AbstractView::StyleMode style) |
Public Member Functions | |
| ChannelDataView (const QString &sSettingsPath=QString(), QWidget *parent=nullptr, Qt::WindowFlags f=Qt::Widget) | |
| ~ChannelDataView () override | |
| void | init (QSharedPointer< FIFFLIB::FiffInfo > pInfo) |
| void | setData (const Eigen::MatrixXd &data, int firstSample=0) |
| void | addData (const Eigen::MatrixXd &data) |
| void | scrollToSample (int sample, bool animate=true) |
| void | setWindowSize (float seconds) |
| float | windowSize () const |
| void | setZoom (double factor) |
| double | zoom () const |
| void | setBackgroundColor (const QColor &color) |
| QColor | backgroundColor () const |
| void | setSignalColor (const QColor &color) |
| QColor | signalColor () const |
| void | setScalingMap (const QMap< qint32, float > &scaleMap) |
| QMap< qint32, float > | scalingMap () const |
| void | hideBadChannels (bool hide) |
| bool | badChannelsHidden () const |
| void | setChannelFilter (const QStringList &names) |
| void | setRemoveDC (bool dc) |
| void | setDetrendMode (DetrendMode mode) |
| DetrendMode | detrendMode () const |
| void | setFileBounds (int first, int last) |
| void | setEvents (const QVector< ChannelRhiView::EventMarker > &events) |
| void | setEpochMarkers (const QVector< int > &triggerSamples) |
| void | setEpochMarkersVisible (bool visible) |
| bool | epochMarkersVisible () const |
| void | setClippingVisible (bool visible) |
| bool | clippingVisible () const |
| void | setZScoreMode (bool enabled) |
| bool | zScoreMode () const |
| void | setReferenceMarkers (const QVector< TimeRulerReferenceMark > &markers) |
| void | setAnnotations (const QVector< ChannelRhiView::AnnotationSpan > &annotations) |
| void | setAnnotationSelectionEnabled (bool enabled) |
| void | setEventsVisible (bool visible) |
| bool | eventsVisible () const |
| void | setAnnotationsVisible (bool visible) |
| bool | annotationsVisible () const |
| void | setOverviewBarVisible (bool visible) |
| bool | overviewBarVisible () const |
| void | setScrollSpeedFactor (float factor) |
| float | scrollSpeedFactor () const |
| void | sortChannelsByType () |
| void | resetChannelOrder () |
| void | setCrosshairEnabled (bool enabled) |
| bool | crosshairEnabled () const |
| void | setScalebarsVisible (bool visible) |
| bool | scalebarsVisible () const |
| void | setButterflyMode (bool enabled) |
| bool | butterflyMode () const |
| void | toggleTimeFormat () |
| void | setClockTimeFormat (bool useClock) |
| bool | clockTimeFormat () const |
| void | saveSettings () override |
| void | loadSettings () override |
| void | clearView () override |
| int | firstVisibleSample () const |
| int | visibleSampleCount () const |
| QRect | signalViewportRect () const |
| int | sampleToViewportX (int sample) const |
| int | viewportXToSample (int x) const |
| ChannelDataModel * | model () const |
| Public Member Functions inherited from DISPLIB::AbstractView | |
| AbstractView (QWidget *parent=0, Qt::WindowFlags f=Qt::Widget) | |
| virtual void | setGuiMode (GuiMode mode) |
| virtual void | setProcessingMode (ProcessingMode mode) |
Protected Member Functions | |
| void | updateGuiMode (GuiMode mode) override |
| void | updateProcessingMode (ProcessingMode mode) override |
| void | keyPressEvent (QKeyEvent *event) override |
| void | resizeEvent (QResizeEvent *event) override |
Additional Inherited Members | |
| Protected Attributes inherited from DISPLIB::AbstractView | |
| bool | m_bResearchModeIsActive |
| bool | m_bOfflineModeIsActive |
| QString | m_sSettingsPath |
ChannelDataView – high-performance, GPU-accelerated channel signal viewer.
Drop-in companion to RtFiffRawView that replaces the QTableView + RawDelegate + QOpenGLWidget stack with a single QRhiWidget-based rendering surface.
Key features:
Typical usage:
Definition at line 119 of file channeldataview.h.

| typedef QSharedPointer<const ChannelDataView> DISPLIB::ChannelDataView::ConstSPtr |
Definition at line 125 of file channeldataview.h.
| typedef QSharedPointer<ChannelDataView> DISPLIB::ChannelDataView::SPtr |
Definition at line 124 of file channeldataview.h.
|
explicit |
Constructs a ChannelDataView.
| [in] | sSettingsPath | QSettings prefix for persistent GUI settings. |
| [in] | parent | Parent widget. |
| [in] | f | Window flags. |
Definition at line 153 of file channeldataview.cpp.
|
override |
Definition at line 166 of file channeldataview.cpp.
| void ChannelDataView::addData | ( | const Eigen::MatrixXd & | data | ) |
Append new samples (real-time streaming use-case).
| [in] | data | Channels × new-samples matrix. |
Definition at line 454 of file channeldataview.cpp.
|
signal |
Emitted when the user drags an annotation boundary to a new position.
| bool ChannelDataView::annotationsVisible | ( | ) | const |
Definition at line 717 of file channeldataview.cpp.
|
signal |
| QColor ChannelDataView::backgroundColor | ( | ) | const |
Definition at line 511 of file channeldataview.cpp.
| bool ChannelDataView::badChannelsHidden | ( | ) | const |
Definition at line 561 of file channeldataview.cpp.
| bool ChannelDataView::butterflyMode | ( | ) | const |
Definition at line 824 of file channeldataview.cpp.
|
signal |
|
overridevirtual |
Clears the view
Implements DISPLIB::AbstractView.
Definition at line 956 of file channeldataview.cpp.
|
signal |
| bool ChannelDataView::clippingVisible | ( | ) | const |
Definition at line 654 of file channeldataview.cpp.
| bool ChannelDataView::clockTimeFormat | ( | ) | const |
Definition at line 852 of file channeldataview.cpp.
| bool ChannelDataView::crosshairEnabled | ( | ) | const |
Definition at line 796 of file channeldataview.cpp.
|
signal |
|
signal |
Forwarded from the underlying ChannelRhiView when the crosshair is active.
| DetrendMode ChannelDataView::detrendMode | ( | ) | const |
Definition at line 605 of file channeldataview.cpp.
|
signal |
| bool ChannelDataView::epochMarkersVisible | ( | ) | const |
Definition at line 643 of file channeldataview.cpp.
| bool ChannelDataView::eventsVisible | ( | ) | const |
Definition at line 704 of file channeldataview.cpp.
|
signal |
| int ChannelDataView::firstVisibleSample | ( | ) | const |
Returns the first currently visible sample.
Definition at line 859 of file channeldataview.cpp.
| void ChannelDataView::hideBadChannels | ( | bool | hide | ) |
Show or hide channels marked bad.
| [in] | hide | If true, bad channels are collapsed to zero height. |
Definition at line 549 of file channeldataview.cpp.
| void ChannelDataView::init | ( | QSharedPointer< FIFFLIB::FiffInfo > | pInfo | ) |
Initialise the view from a FiffInfo (channel names, types, sampling rate).
| [in] | pInfo | Shared pointer to FiffInfo. |
Definition at line 396 of file channeldataview.cpp.
|
overrideprotected |
Definition at line 980 of file channeldataview.cpp.
|
overridevirtual |
Loads and inits all important settings of this view via QSettings.
Implements DISPLIB::AbstractView.
Definition at line 931 of file channeldataview.cpp.
|
inline |
Returns the underlying data model (non-owning pointer). Use for advanced configuration such as setMaxStoredSamples().
Definition at line 422 of file channeldataview.h.
|
signal |
| bool ChannelDataView::overviewBarVisible | ( | ) | const |
Definition at line 730 of file channeldataview.cpp.
|
signal |
Emitted when the ruler context menu requests a new sample marker.
|
signal |
Emitted when the ruler context menu requests removal of a nearby sample marker.
|
signal |
Emitted when the ruler context menu requests clearing all sample markers.
| void ChannelDataView::resetChannelOrder | ( | ) |
Definition at line 779 of file channeldataview.cpp.
|
overrideprotected |
Definition at line 1092 of file channeldataview.cpp.
|
signal |
Emitted when the user clicks on a sample position.
| [in] | sample | Absolute sample index under the cursor. |
|
signal |
Emitted when the user selected a sample range for annotation creation.
| int ChannelDataView::sampleToViewportX | ( | int | sample | ) | const |
Maps an absolute sample index to an x coordinate inside the signal viewport.
| [in] | sample | Absolute sample index. |
Definition at line 880 of file channeldataview.cpp.
|
overridevirtual |
Saves all important settings of this view via QSettings.
Implements DISPLIB::AbstractView.
Definition at line 918 of file channeldataview.cpp.
|
signal |
| bool ChannelDataView::scalebarsVisible | ( | ) | const |
Definition at line 809 of file channeldataview.cpp.
| QMap< qint32, float > ChannelDataView::scalingMap | ( | ) | const |
Definition at line 542 of file channeldataview.cpp.
|
signal |
Emitted whenever the scroll position changes.
| [in] | sample | Current left-edge sample index. |
|
signal |
| float ChannelDataView::scrollSpeedFactor | ( | ) | const |
Definition at line 743 of file channeldataview.cpp.
| void ChannelDataView::scrollToSample | ( | int | sample, |
| bool | animate = true ) |
Scroll to the given absolute sample index.
| [in] | sample | Target left-edge sample. |
| [in] | animate | If true, animate with a smooth cubic ease-out. |
Definition at line 462 of file channeldataview.cpp.
| void ChannelDataView::setAnnotations | ( | const QVector< ChannelRhiView::AnnotationSpan > & | annotations | ) |
Set the list of annotation spans to display as translucent overlays.
| [in] | annotations | List of AnnotationSpan objects. |
Definition at line 680 of file channeldataview.cpp.
| void ChannelDataView::setAnnotationSelectionEnabled | ( | bool | enabled | ) |
Enable or disable annotation span selection in the raw browser.
Definition at line 690 of file channeldataview.cpp.
| void ChannelDataView::setAnnotationsVisible | ( | bool | visible | ) |
Definition at line 711 of file channeldataview.cpp.
| void ChannelDataView::setBackgroundColor | ( | const QColor & | color | ) |
Set the background colour of the rendering surface.
| [in] | color | New background colour. |
Definition at line 501 of file channeldataview.cpp.
| void ChannelDataView::setButterflyMode | ( | bool | enabled | ) |
Toggle butterfly mode (overlay all same-type channels).
Definition at line 816 of file channeldataview.cpp.
| void ChannelDataView::setChannelFilter | ( | const QStringList & | names | ) |
Restrict the view to a named subset of channels. Channels not in names are hidden immediately. Pass an empty list to restore all channels.
| [in] | names | List of channel names to show (case-sensitive). |
Definition at line 568 of file channeldataview.cpp.
| void ChannelDataView::setClippingVisible | ( | bool | visible | ) |
Definition at line 648 of file channeldataview.cpp.
| void ChannelDataView::setClockTimeFormat | ( | bool | useClock | ) |
Set clock time format on the ruler.
Definition at line 842 of file channeldataview.cpp.
| void ChannelDataView::setCrosshairEnabled | ( | bool | enabled | ) |
Enable or disable the crosshair cursor with coordinate readout.
Definition at line 790 of file channeldataview.cpp.
| void ChannelDataView::setData | ( | const Eigen::MatrixXd & | data, |
| int | firstSample = 0 ) |
Replace all buffered data.
| [in] | data | Channels × samples matrix. |
| [in] | firstSample | Absolute sample index of column 0. |
Definition at line 446 of file channeldataview.cpp.
| void ChannelDataView::setDetrendMode | ( | DetrendMode | mode | ) |
Set the detrending mode for on-the-fly trend removal during rendering. None = raw, Mean = DC offset, Linear = least-squares linear fit.
| [in] | mode | The DetrendMode to use. |
Definition at line 598 of file channeldataview.cpp.
| void ChannelDataView::setEpochMarkers | ( | const QVector< int > & | triggerSamples | ) |
Definition at line 631 of file channeldataview.cpp.
| void ChannelDataView::setEpochMarkersVisible | ( | bool | visible | ) |
Definition at line 637 of file channeldataview.cpp.
| void ChannelDataView::setEvents | ( | const QVector< ChannelRhiView::EventMarker > & | events | ) |
Set the list of event / stimulus markers to display as coloured vertical lines. Pass an empty vector to clear all markers.
| [in] | events | List of EventMarker objects. |
Definition at line 612 of file channeldataview.cpp.
| void ChannelDataView::setEventsVisible | ( | bool | visible | ) |
Definition at line 698 of file channeldataview.cpp.
| void ChannelDataView::setFileBounds | ( | int | first, |
| int | last ) |
Set the absolute sample indices of the file's first and last samples. The scrollbar range and mouse-pan clamp use these to prevent scrolling outside the actual file boundaries regardless of the ring-buffer state.
| [in] | first | Absolute sample index of the file's first sample. |
| [in] | last | Absolute sample index of the file's last sample. |
Definition at line 427 of file channeldataview.cpp.
| void ChannelDataView::setOverviewBarVisible | ( | bool | visible | ) |
Definition at line 724 of file channeldataview.cpp.
| void ChannelDataView::setReferenceMarkers | ( | const QVector< TimeRulerReferenceMark > & | markers | ) |
Set the list of persistent sample/reference markers shown in the time ruler.
| [in] | markers | Reference markers to display in the ruler. |
Definition at line 672 of file channeldataview.cpp.
| void ChannelDataView::setRemoveDC | ( | bool | dc | ) |
Enable or disable DC (mean) removal applied at render time. Takes effect immediately — the view redraws with the current data.
| [in] | dc | true = subtract per-channel mean from each rendered window. |
Definition at line 591 of file channeldataview.cpp.
| void ChannelDataView::setScalebarsVisible | ( | bool | visible | ) |
Show or hide per-channel-type amplitude scalebars.
Definition at line 803 of file channeldataview.cpp.
| void ChannelDataView::setScalingMap | ( | const QMap< qint32, float > & | scaleMap | ) |
Set the per-channel-type amplitude scale map. Keys should be FIFF channel kind constants (FIFFV_MEG_CH, FIFFV_EEG_CH, …).
| [in] | scaleMap | Map from FIFF kind to physical amplitude (e.g. 1.2e-12 for MEG). |
Definition at line 534 of file channeldataview.cpp.
| void ChannelDataView::setScrollSpeedFactor | ( | float | factor | ) |
Definition at line 737 of file channeldataview.cpp.
| void ChannelDataView::setSignalColor | ( | const QColor & | color | ) |
Set the default signal line colour (used for channel types without a type-specific colour).
| [in] | color | New signal colour. |
Definition at line 518 of file channeldataview.cpp.
| void ChannelDataView::setWindowSize | ( | float | seconds | ) |
Set the visible time window (in seconds). This adjusts samplesPerPixel to fit the requested duration.
| [in] | seconds | Duration of the visible window. |
Definition at line 469 of file channeldataview.cpp.
| void ChannelDataView::setZoom | ( | double | factor | ) |
Set the zoom factor (> 1 = zoom in, < 1 = zoom out relative to default).
| [in] | factor | Zoom multiplier applied to the default samples-per-pixel. |
Definition at line 485 of file channeldataview.cpp.
| void ChannelDataView::setZScoreMode | ( | bool | enabled | ) |
Definition at line 659 of file channeldataview.cpp.
| QColor ChannelDataView::signalColor | ( | ) | const |
Definition at line 527 of file channeldataview.cpp.
| QRect ChannelDataView::signalViewportRect | ( | ) | const |
Returns the geometry of the actual QRHI signal viewport in ChannelDataView-local coordinates.
Definition at line 873 of file channeldataview.cpp.
| void ChannelDataView::sortChannelsByType | ( | ) |
Definition at line 750 of file channeldataview.cpp.
| void ChannelDataView::toggleTimeFormat | ( | ) |
Toggle time format between float seconds and HH:MM:SS clock time.
Definition at line 831 of file channeldataview.cpp.
|
overrideprotectedvirtual |
Update the views GUI based on the set GuiMode (Clinical=0, Research=1).
| mode | The new mode (Clinical=0, Research=1). |
Implements DISPLIB::AbstractView.
Definition at line 974 of file channeldataview.cpp.
|
overrideprotectedvirtual |
Update the views GUI based on the set ProcessingMode (RealTime=0, Offline=1).
| mode | The new mode (RealTime=0, Offline=1). |
Implements DISPLIB::AbstractView.
Definition at line 976 of file channeldataview.cpp.
| int ChannelDataView::viewportXToSample | ( | int | x | ) | const |
Maps a ChannelDataView-local x coordinate inside the signal viewport to an absolute sample index.
| [in] | x | ChannelDataView-local x coordinate. |
Definition at line 899 of file channeldataview.cpp.
| int ChannelDataView::visibleSampleCount | ( | ) | const |
Definition at line 866 of file channeldataview.cpp.
| float ChannelDataView::windowSize | ( | ) | const |
Get the current visible time window in seconds.
Definition at line 478 of file channeldataview.cpp.
| double ChannelDataView::zoom | ( | ) | const |
Return the current zoom factor.
Definition at line 494 of file channeldataview.cpp.
| bool ChannelDataView::zScoreMode | ( | ) | const |
Definition at line 665 of file channeldataview.cpp.
|
signal |