Skip to main content

RtFiffRawViewModel

Namespace: DISPLIB  ·  Library: Display Library

#include <disp/rtfiffrawviewmodel.h>

class DISPLIB::RtFiffRawViewModel

Circular-buffer QAbstractTableModel feeding the real-time FIFF raw browser.

Keeps the last few seconds of streaming FIFF data in a per-channel ring buffer and forwards bad-channel flips, trigger detections and annotation edits back to the underlying FiffInfo / event list.

Inheritance​


Public Methods​

RtFiffRawViewModel(parent)​

Constructs an real-time multi sample array table model for the given parent.

Parameters:

  • parent : *QObject ** parent of the table model.

~RtFiffRawViewModel()​

Destructs RtFiffRawViewModel and stops the use of Shared Memory within the Event Manager.


rowCount(parent)​

Returns the number of rows under the given parent.

When the parent is valid it means that rowCount is returning the number of children of parent.

Parameters:

  • parent : const QModelIndex & not used.

Returns:

  • int — number of rows.

columnCount(parent)​

Returns the number of columns for the children of the given parent.

Parameters:

  • parent : const QModelIndex & not used.

Returns:

  • int — number of columns.

data(index, role)​

Returns the data stored under the given role for the item referred to by the index.

Parameters:

  • index : const QModelIndex & determines item location.

  • role : int role to return.

Returns:

  • QVariant — accessed data.

headerData(section, orientation, role)​

Returns the data for the given role and section in the header with the specified orientation.

Parameters:

  • section : int For horizontal headers, the section number corresponds to the column number. Similarly, for vertical headers, the section number corresponds to the row number.

  • orientation : Qt::Orientation Qt::Horizontal or Qt::Vertical.

  • role : int role to show.

Returns:

  • QVariant — accessed eader data.

setFiffInfo(p_pFiffInfo)​

Sets corresponding fiff information.

Parameters:

  • p_pFiffInfo : QSharedPointer<FiffInfo> & The corresponding fiff information.

setSamplingInfo(sps, T, bSetZero)​

Sets the sampling information and calculates the resulting downsampling factor between actual sps and desired sps.

Parameters:

  • sps : float Samples per second of incomming data.

  • T : int Time window length to display.

  • bSetZero : bool If data should be set to zero. Default is false.


getLastBlock()​

Returns the last received data block.

Returns:

  • Eigen::MatrixXd — the last data block.

addData(data)​

Adds multiple time points (QVector) for a channel set (VectorXd).

Parameters:

  • data : const QList< Eigen::MatrixXd > & data to add (Time points of channel samples).

getKind(row)​

Returns the kind of a given channel number.

Parameters:

  • row : qint32 row number which correspodns to a given channel.

Returns:

  • FIFFLIB::fiff_int_t — kind of given channel number.

getUnit(row)​

Returns the unit of a given channel number.

Parameters:

  • row : qint32 row number which correspodns to a given channel.

Returns:

  • FIFFLIB::fiff_int_t — unit of given channel number.

getCoil(row)​

Returns the coil type of a given channel number.

Parameters:

  • row : qint32 row number which correspodns to a given channel.

Returns:

  • FIFFLIB::fiff_int_t — coil type of given channel number.

getMaxSamples()​

Returns the maximal number of samples of the downsampled data to display.

Returns:

  • qint32 — the maximal number of samples.

getCurrentSampleIndex()​

Returns the current sample index which represents the index which the next incoming data will be stored at in the data.

Returns:

  • qint32 — the current sample index.

getLastBlockFirstValue(row)​

Returns the first value of the last complete data display block.

Parameters:

  • row : int row for which the first value is to be returned.

Returns:

  • double — the first value of the last complete data display block.

getIdxSelMap()​

Returns a map which conatins the channel idx and its corresponding selection status.

Returns:

  • const QMap< qint32, qint32 > & — the channel idx to selection status.

selectRows(selection)​

Selects the given list of channel indeces and unselect all other channels.

Parameters:

  • selection : const QList< qint32 > & channel index list to select.

hideRows(selection)​

Hides the given list of channel.

Parameters:

  • selection : const QList< qint32 > & channel index list to select.

resetSelection()​

Resets the current selection (selects all channels).


toggleFreeze(index)​

Toggle freeze for all channels when a channel is double clicked.

Parameters:

  • index : const QModelIndex & of the channel which has been double clicked.

setScaling(p_qMapChScaling)​

Set scaling channel scaling.

Parameters:

  • p_qMapChScaling : const QMap< qint32, float > & Map of scaling factors.

updateProjection(projs)​

Update the SSP projection.

Parameters:

  • projs : const QList< FiffProj > & The new projectors.

updateCompensator(to)​

Update the compensator.

Parameters:

  • to : int Compensator to use in fiff constant format FiffCtfComp.kind (NOT FiffCtfComp.ctfkind).

updateSpharaActivation(state)​

Update the SPHARA operator.

Parameters:

  • state : bool The current state of teh SPHARA tool.

updateSpharaOptions(sSytemType, nBaseFctsFirst, nBaseFctsSecond)​

Update the SPHARA operator.

Parameters:

  • sSytemType : const QString & The current acquisition system type (VectorView, BabyMEG, EEG).

  • nBaseFctsFirst : int The new number of basis function to use for the first SPHARA operator.

  • nBaseFctsSecond : int The new number of basis function to use for the second SPHARA operator.


setFilter(filterData)​

Set new filter parameters.

Parameters:

  • filterData : QList< FilterKernel > list of the new filter.

setFilterActive(state)​

Set filter activation.

Parameters:

  • state : bool filter on/off flag.

setBackgroundColor(color)​

Set the background color.

Parameters:

  • color : const QColor & The background color.

setFilterChannelType(channelType)​

Sets the type of channel which are to be filtered.

Parameters:

  • channelType : const QString & the channel type which is to be filtered (EEG, MEG, All).

markChBad(ch, status)​

markChBad marks the selected channels as bad/good in m_chInfolist

Parameters:

  • ch : QModelIndex index that is selected for marking.

  • status : bool Mark as bad when true, as good when false.


markChBad(chlist, status)​

markChBad marks the selected channels as bad/good in m_chInfolist

Parameters:

  • chlist : QModelIndexList is the list of indices that are selected for marking.

  • status : bool Mark as bad when true, as good when false.


triggerInfoChanged(colorMap, active, triggerCh, threshold)​

markChBad marks the selected channels as bad/good in m_chInfolist

Parameters:

  • colorMap : const QMap< double, QColor > & color for each trigger channel.

  • active : bool real time trigger detection active.

  • triggerCh : QString current trigger channel to scan.

  • threshold : double threshold for the detection process.


distanceTimeSpacerChanged(value)​

distanceTimeSpacerChanged changes the distance of the time spacers

Parameters:

  • value : int the new distance for the time spacers.

resetTriggerCounter()​

resetTriggerCounter resets the trigger counter


numVLines()​

Returns the number of vertical lines (one per second).

Returns:

  • qint32 — number of vertical lines.

isFreezed()​

Returns current freezing status.

Returns:

  • bool — the current freezing status.

getScaling()​

Returns current scaling.

Returns:

  • const QMap< qint32, float > & — the current scaling.

getDetectedTriggers()​

Returns current detected trigger flanks.

Returns:

  • QList< QPair< int, double > > — the current detected trigger flanks.

getDetectedTriggersOld()​

Returns old detected trigger flanks.

Returns:

  • QList< QPair< int, double > > — the old detected trigger flanks.

getTriggerColor()​

Returns current trigger color.

Returns:

  • QMap< double, QColor > — the current trigger color map fpr each detected type.

getNumberOfTimeSpacers()​

Returns the current number for the time spacers.

Returns:

  • int — the current number for the time spacers.

getTriggerThreshold()​

Returns the current trigger threshold.

Returns:

  • double — the current trigger threshold.

getTriggerName()​

Returns the current trigger name.

Returns:

  • QString — the current trigger name.

getCurrentTriggerIndex()​

Returns the current trigger channel index.

Returns:

  • int — the current trigger channel index.

triggerDetectionActive()​

Returns whether trigger detection is active or not.

Returns:

  • bool — whether trigger detection is active or not.

getCurrentOverlapAddDelay()​

Returns the current overlap add delay.

Returns:

  • int — the current overlap add delay.

getFirstSampleOffset()​

Get offset of first drawn sample in the window.

Returns:

  • int — sample offset of window

getSampleAtColumn(iColumn)​

Maps a displayed buffer column to the sample it shows.

Parameters:

  • iColumn : int Buffer column, 0 .. getMaxSamples() - 1.

Returns:

  • int — The sample index since the start of the stream, or -1 if the column holds no data yet.

getValueAtColumn(iRow, iColumn)​

Returns the displayed value of a row at a buffer column, i.e.

after projectors, compensators and filters.

Parameters:

  • iRow : int Row of the model.

  • iColumn : int Buffer column, 0 .. getMaxSamples() - 1.

Returns:

  • double — The value in SI units, 0 for an invalid row or column.

getMaxValueFromRawViewModel(row)​

Get maximum range of respective channel type.

range value in FiffChInfo does not seem to contain a reasonable value

Parameters:

  • row : int Row of the model.

Returns:

  • double — the max value of the y axis for the channel

addEvent(iSample)​

Adds event based on input parameters.

Parameters:

  • iSample : int Sample of the new event.

getEventsToDisplay(iBegin, iEnd)​

Returns event sample positions between two samples.

Parameters:

  • iBegin : int Lower bound for sample (inclusive).

  • iEnd : int Upper bound for sample (exclusive).

Returns:

  • std::vector< int > — Vector of event sample positions.

setEventCallbacks(addFn, getFn)​

Sets callbacks for adding and querying events.

Parameters:

  • addFn : std::function< void(int)> Callback invoked when an event is added.

  • getFn : std::function< std::vector< int >(int, int)> Callback returning event sample positions in a range.


Authors of this file​