v2.0.0
Loading...
Searching...
No Matches
DISPLIB::ChannelDataView Class Reference

Composite real-time multi-channel raw scroller assembling label panel, table view, time ruler and scrollbars. More...

#include <channeldataview.h>

Public Types

typedef QSharedPointer< ChannelDataViewSPtr
typedef QSharedPointer< const ChannelDataViewConstSPtr
Public Types inherited from DISPLIB::AbstractView
enum  StyleMode { Default , Dark }
enum  GuiMode { Clinical , Research }
enum  ProcessingMode { RealTime , Offline }
typedef QSharedPointer< AbstractViewSPtr
typedef QSharedPointer< const AbstractViewConstSPtr

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
ChannelDataModelmodel () 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

Detailed Description

Composite real-time multi-channel raw scroller assembling label panel, table view, time ruler and scrollbars.

Acts as the user-facing host of the ChannelDataModel and RtFiffRawViewDelegate pair, exposing playback / zoom / channel-selection signals consumed by the surrounding plugin GUI.

Definition at line 88 of file channeldataview.h.

Inheritance diagram for DISPLIB::ChannelDataView:
Inheritance graph

Member Typedef Documentation

◆ ConstSPtr

Definition at line 94 of file channeldataview.h.

◆ SPtr

Definition at line 93 of file channeldataview.h.

Constructor & Destructor Documentation

◆ ChannelDataView()

ChannelDataView::ChannelDataView ( const QString & sSettingsPath = QString(),
QWidget * parent = nullptr,
Qt::WindowFlags f = Qt::Widget )
explicit

Constructs a ChannelDataView.

Parameters
[in]sSettingsPathQSettings prefix for persistent GUI settings.
[in]parentParent widget.
[in]fWindow flags.

Definition at line 132 of file channeldataview.cpp.

◆ ~ChannelDataView()

ChannelDataView::~ChannelDataView ( )
override

Definition at line 145 of file channeldataview.cpp.

Member Function Documentation

◆ addData()

void ChannelDataView::addData ( const Eigen::MatrixXd & data)

Append new samples (real-time streaming use-case).

Parameters
[in]dataChannels × new-samples matrix.

Definition at line 433 of file channeldataview.cpp.

◆ annotationBoundaryMoved

void DISPLIB::ChannelDataView::annotationBoundaryMoved ( int annotationIndex,
bool isStartBoundary,
int newSample )
signal

Emitted when the user drags an annotation boundary to a new position.

◆ annotationsVisible()

bool ChannelDataView::annotationsVisible ( ) const

Definition at line 696 of file channeldataview.cpp.

◆ annotationsVisibleToggled

void DISPLIB::ChannelDataView::annotationsVisibleToggled ( bool on)
signal

◆ backgroundColor()

QColor ChannelDataView::backgroundColor ( ) const

Definition at line 490 of file channeldataview.cpp.

◆ badChannelsHidden()

bool ChannelDataView::badChannelsHidden ( ) const

Definition at line 540 of file channeldataview.cpp.

◆ butterflyMode()

bool ChannelDataView::butterflyMode ( ) const

Definition at line 803 of file channeldataview.cpp.

◆ butterflyToggled

void DISPLIB::ChannelDataView::butterflyToggled ( bool on)
signal

◆ clearView()

void ChannelDataView::clearView ( )
overridevirtual

Clears the view

Implements DISPLIB::AbstractView.

Definition at line 935 of file channeldataview.cpp.

◆ clippingToggled

void DISPLIB::ChannelDataView::clippingToggled ( bool on)
signal

◆ clippingVisible()

bool ChannelDataView::clippingVisible ( ) const

Definition at line 633 of file channeldataview.cpp.

◆ clockTimeFormat()

bool ChannelDataView::clockTimeFormat ( ) const

Definition at line 831 of file channeldataview.cpp.

◆ crosshairEnabled()

bool ChannelDataView::crosshairEnabled ( ) const

Definition at line 775 of file channeldataview.cpp.

◆ crosshairToggled

void DISPLIB::ChannelDataView::crosshairToggled ( bool on)
signal

◆ cursorDataChanged

void DISPLIB::ChannelDataView::cursorDataChanged ( float timeSec,
float amplitude,
const QString & channelName,
const QString & unitLabel )
signal

Forwarded from the underlying ChannelRhiView when the crosshair is active.

◆ detrendMode()

DetrendMode ChannelDataView::detrendMode ( ) const

Definition at line 584 of file channeldataview.cpp.

◆ epochMarkersToggled

void DISPLIB::ChannelDataView::epochMarkersToggled ( bool on)
signal

◆ epochMarkersVisible()

bool ChannelDataView::epochMarkersVisible ( ) const

Definition at line 622 of file channeldataview.cpp.

◆ eventsVisible()

bool ChannelDataView::eventsVisible ( ) const

Definition at line 683 of file channeldataview.cpp.

◆ eventsVisibleToggled

void DISPLIB::ChannelDataView::eventsVisibleToggled ( bool on)
signal

◆ firstVisibleSample()

int ChannelDataView::firstVisibleSample ( ) const

Returns the first currently visible sample.

Definition at line 838 of file channeldataview.cpp.

◆ hideBadChannels()

void ChannelDataView::hideBadChannels ( bool hide)

Show or hide channels marked bad.

Parameters
[in]hideIf true, bad channels are collapsed to zero height.

Definition at line 528 of file channeldataview.cpp.

◆ init()

void ChannelDataView::init ( QSharedPointer< FIFFLIB::FiffInfo > pInfo)

Initialise the view from a FiffInfo (channel names, types, sampling rate).

Parameters
[in]pInfoShared pointer to FiffInfo.

Definition at line 375 of file channeldataview.cpp.

◆ keyPressEvent()

void ChannelDataView::keyPressEvent ( QKeyEvent * event)
overrideprotected

Definition at line 959 of file channeldataview.cpp.

◆ loadSettings()

void ChannelDataView::loadSettings ( )
overridevirtual

Loads and inits all important settings of this view via QSettings.

Implements DISPLIB::AbstractView.

Definition at line 910 of file channeldataview.cpp.

◆ model()

ChannelDataModel * DISPLIB::ChannelDataView::model ( ) const
inline

Returns the underlying data model (non-owning pointer). Use for advanced configuration such as setMaxStoredSamples().

Definition at line 391 of file channeldataview.h.

◆ overviewBarToggled

void DISPLIB::ChannelDataView::overviewBarToggled ( bool on)
signal

◆ overviewBarVisible()

bool ChannelDataView::overviewBarVisible ( ) const

Definition at line 709 of file channeldataview.cpp.

◆ referenceMarkerAddRequested

void DISPLIB::ChannelDataView::referenceMarkerAddRequested ( int sample)
signal

Emitted when the ruler context menu requests a new sample marker.

◆ referenceMarkerRemoveRequested

void DISPLIB::ChannelDataView::referenceMarkerRemoveRequested ( int sample)
signal

Emitted when the ruler context menu requests removal of a nearby sample marker.

◆ referenceMarkersClearRequested

void DISPLIB::ChannelDataView::referenceMarkersClearRequested ( )
signal

Emitted when the ruler context menu requests clearing all sample markers.

◆ resetChannelOrder()

void ChannelDataView::resetChannelOrder ( )

Definition at line 758 of file channeldataview.cpp.

◆ resizeEvent()

void ChannelDataView::resizeEvent ( QResizeEvent * event)
overrideprotected

Definition at line 1071 of file channeldataview.cpp.

◆ sampleClicked

void DISPLIB::ChannelDataView::sampleClicked ( int sample)
signal

Emitted when the user clicks on a sample position.

Parameters
[in]sampleAbsolute sample index under the cursor.

◆ sampleRangeSelected

void DISPLIB::ChannelDataView::sampleRangeSelected ( int startSample,
int endSample )
signal

Emitted when the user selected a sample range for annotation creation.

◆ sampleToViewportX()

int ChannelDataView::sampleToViewportX ( int sample) const

Maps an absolute sample index to an x coordinate inside the signal viewport.

Parameters
[in]sampleAbsolute sample index.
Returns
x position in ChannelDataView-local coordinates.

Definition at line 859 of file channeldataview.cpp.

◆ saveSettings()

void ChannelDataView::saveSettings ( )
overridevirtual

Saves all important settings of this view via QSettings.

Implements DISPLIB::AbstractView.

Definition at line 897 of file channeldataview.cpp.

◆ scalebarsToggled

void DISPLIB::ChannelDataView::scalebarsToggled ( bool on)
signal

◆ scalebarsVisible()

bool ChannelDataView::scalebarsVisible ( ) const

Definition at line 788 of file channeldataview.cpp.

◆ scalingMap()

QMap< qint32, float > ChannelDataView::scalingMap ( ) const

Definition at line 521 of file channeldataview.cpp.

◆ scrollPositionChanged

void DISPLIB::ChannelDataView::scrollPositionChanged ( int sample)
signal

Emitted whenever the scroll position changes.

Parameters
[in]sampleCurrent left-edge sample index.

◆ scrollSpeedChanged

void DISPLIB::ChannelDataView::scrollSpeedChanged ( float factor)
signal

◆ scrollSpeedFactor()

float ChannelDataView::scrollSpeedFactor ( ) const

Definition at line 722 of file channeldataview.cpp.

◆ scrollToSample()

void ChannelDataView::scrollToSample ( int sample,
bool animate = true )

Scroll to the given absolute sample index.

Parameters
[in]sampleTarget left-edge sample.
[in]animateIf true, animate with a smooth cubic ease-out.

Definition at line 441 of file channeldataview.cpp.

◆ setAnnotations()

void ChannelDataView::setAnnotations ( const QVector< ChannelRhiView::AnnotationSpan > & annotations)

Set the list of annotation spans to display as translucent overlays.

Parameters
[in]annotationsList of AnnotationSpan objects.

Definition at line 659 of file channeldataview.cpp.

◆ setAnnotationSelectionEnabled()

void ChannelDataView::setAnnotationSelectionEnabled ( bool enabled)

Enable or disable annotation span selection in the raw browser.

Definition at line 669 of file channeldataview.cpp.

◆ setAnnotationsVisible()

void ChannelDataView::setAnnotationsVisible ( bool visible)

Definition at line 690 of file channeldataview.cpp.

◆ setBackgroundColor()

void ChannelDataView::setBackgroundColor ( const QColor & color)

Set the background colour of the rendering surface.

Parameters
[in]colorNew background colour.

Definition at line 480 of file channeldataview.cpp.

◆ setButterflyMode()

void ChannelDataView::setButterflyMode ( bool enabled)

Toggle butterfly mode (overlay all same-type channels).

Definition at line 795 of file channeldataview.cpp.

◆ setChannelFilter()

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.

Parameters
[in]namesList of channel names to show (case-sensitive).

Definition at line 547 of file channeldataview.cpp.

◆ setClippingVisible()

void ChannelDataView::setClippingVisible ( bool visible)

Definition at line 627 of file channeldataview.cpp.

◆ setClockTimeFormat()

void ChannelDataView::setClockTimeFormat ( bool useClock)

Set clock time format on the ruler.

Definition at line 821 of file channeldataview.cpp.

◆ setCrosshairEnabled()

void ChannelDataView::setCrosshairEnabled ( bool enabled)

Enable or disable the crosshair cursor with coordinate readout.

Definition at line 769 of file channeldataview.cpp.

◆ setData()

void ChannelDataView::setData ( const Eigen::MatrixXd & data,
int firstSample = 0 )

Replace all buffered data.

Parameters
[in]dataChannels × samples matrix.
[in]firstSampleAbsolute sample index of column 0.

Definition at line 425 of file channeldataview.cpp.

◆ setDetrendMode()

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.

Parameters
[in]modeThe DetrendMode to use.

Definition at line 577 of file channeldataview.cpp.

◆ setEpochMarkers()

void ChannelDataView::setEpochMarkers ( const QVector< int > & triggerSamples)

Definition at line 610 of file channeldataview.cpp.

◆ setEpochMarkersVisible()

void ChannelDataView::setEpochMarkersVisible ( bool visible)

Definition at line 616 of file channeldataview.cpp.

◆ setEvents()

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.

Parameters
[in]eventsList of EventMarker objects.

Definition at line 591 of file channeldataview.cpp.

◆ setEventsVisible()

void ChannelDataView::setEventsVisible ( bool visible)

Definition at line 677 of file channeldataview.cpp.

◆ setFileBounds()

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.

Parameters
[in]firstAbsolute sample index of the file's first sample.
[in]lastAbsolute sample index of the file's last sample.

Definition at line 406 of file channeldataview.cpp.

◆ setOverviewBarVisible()

void ChannelDataView::setOverviewBarVisible ( bool visible)

Definition at line 703 of file channeldataview.cpp.

◆ setReferenceMarkers()

void ChannelDataView::setReferenceMarkers ( const QVector< TimeRulerReferenceMark > & markers)

Set the list of persistent sample/reference markers shown in the time ruler.

Parameters
[in]markersReference markers to display in the ruler.

Definition at line 651 of file channeldataview.cpp.

◆ setRemoveDC()

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.

Parameters
[in]dctrue = subtract per-channel mean from each rendered window.

Definition at line 570 of file channeldataview.cpp.

◆ setScalebarsVisible()

void ChannelDataView::setScalebarsVisible ( bool visible)

Show or hide per-channel-type amplitude scalebars.

Definition at line 782 of file channeldataview.cpp.

◆ setScalingMap()

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

Parameters
[in]scaleMapMap from FIFF kind to physical amplitude (e.g. 1.2e-12 for MEG).

Definition at line 513 of file channeldataview.cpp.

◆ setScrollSpeedFactor()

void ChannelDataView::setScrollSpeedFactor ( float factor)

Definition at line 716 of file channeldataview.cpp.

◆ setSignalColor()

void ChannelDataView::setSignalColor ( const QColor & color)

Set the default signal line colour (used for channel types without a type-specific colour).

Parameters
[in]colorNew signal colour.

Definition at line 497 of file channeldataview.cpp.

◆ setWindowSize()

void ChannelDataView::setWindowSize ( float seconds)

Set the visible time window (in seconds). This adjusts samplesPerPixel to fit the requested duration.

Parameters
[in]secondsDuration of the visible window.

Definition at line 448 of file channeldataview.cpp.

◆ setZoom()

void ChannelDataView::setZoom ( double factor)

Set the zoom factor (> 1 = zoom in, < 1 = zoom out relative to default).

Parameters
[in]factorZoom multiplier applied to the default samples-per-pixel.

Definition at line 464 of file channeldataview.cpp.

◆ setZScoreMode()

void ChannelDataView::setZScoreMode ( bool enabled)

Definition at line 638 of file channeldataview.cpp.

◆ signalColor()

QColor ChannelDataView::signalColor ( ) const

Definition at line 506 of file channeldataview.cpp.

◆ signalViewportRect()

QRect ChannelDataView::signalViewportRect ( ) const

Returns the geometry of the actual QRHI signal viewport in ChannelDataView-local coordinates.

Definition at line 852 of file channeldataview.cpp.

◆ sortChannelsByType()

void ChannelDataView::sortChannelsByType ( )

Definition at line 729 of file channeldataview.cpp.

◆ toggleTimeFormat()

void ChannelDataView::toggleTimeFormat ( )

Toggle time format between float seconds and HH:MM:SS clock time.

Definition at line 810 of file channeldataview.cpp.

◆ updateGuiMode()

void ChannelDataView::updateGuiMode ( GuiMode mode)
overrideprotectedvirtual

Update the views GUI based on the set GuiMode (Clinical=0, Research=1).

Parameters
modeThe new mode (Clinical=0, Research=1).

Implements DISPLIB::AbstractView.

Definition at line 953 of file channeldataview.cpp.

◆ updateProcessingMode()

void ChannelDataView::updateProcessingMode ( ProcessingMode mode)
overrideprotectedvirtual

Update the views GUI based on the set ProcessingMode (RealTime=0, Offline=1).

Parameters
modeThe new mode (RealTime=0, Offline=1).

Implements DISPLIB::AbstractView.

Definition at line 955 of file channeldataview.cpp.

◆ viewportXToSample()

int ChannelDataView::viewportXToSample ( int x) const

Maps a ChannelDataView-local x coordinate inside the signal viewport to an absolute sample index.

Parameters
[in]xChannelDataView-local x coordinate.
Returns
Absolute sample index at the requested x position.

Definition at line 878 of file channeldataview.cpp.

◆ visibleSampleCount()

int ChannelDataView::visibleSampleCount ( ) const

Definition at line 845 of file channeldataview.cpp.

◆ windowSize()

float ChannelDataView::windowSize ( ) const

Get the current visible time window in seconds.

Definition at line 457 of file channeldataview.cpp.

◆ zoom()

double ChannelDataView::zoom ( ) const

Return the current zoom factor.

Definition at line 473 of file channeldataview.cpp.

◆ zScoreMode()

bool ChannelDataView::zScoreMode ( ) const

Definition at line 644 of file channeldataview.cpp.

◆ zScoreModeToggled

void DISPLIB::ChannelDataView::zScoreModeToggled ( bool on)
signal

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