MNE-CPP  0.1.9
A Framework for Electrophysiology
Public Types | Signals | Public Member Functions | List of all members
DISPLIB::RtFiffRawViewModel Class Reference

The RtFiffRawViewModel class implements the data access model for a real-time multi sample array data stream. More...

#include <rtfiffrawviewmodel.h>

Public Types

typedef QSharedPointer< RtFiffRawViewModelSPtr
 
typedef QSharedPointer< const RtFiffRawViewModelConstSPtr
 

Signals

void newSelection (const QList< qint32 > &selection)
 
void windowSizeChanged (int windowSize)
 
void triggerDetected (int numberDetectedTriggers, const QMap< int, QList< QPair< int, double > > > &mapDetectedTriggers)
 

Public Member Functions

 RtFiffRawViewModel (QObject *parent=0)
 
 ~RtFiffRawViewModel ()
 
virtual int rowCount (const QModelIndex &parent=QModelIndex()) const
 
virtual int columnCount (const QModelIndex &parent=QModelIndex()) const
 
virtual QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const
 
virtual QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
 
void setFiffInfo (QSharedPointer< FIFFLIB::FiffInfo > &p_pFiffInfo)
 
void setSamplingInfo (float sps, int T, bool bSetZero=false)
 
Eigen::MatrixXd getLastBlock ()
 
void addData (const QList< Eigen::MatrixXd > &data)
 
FIFFLIB::fiff_int_t getKind (qint32 row) const
 
FIFFLIB::fiff_int_t getUnit (qint32 row) const
 
FIFFLIB::fiff_int_t getCoil (qint32 row) const
 
qint32 getMaxSamples () const
 
qint32 getCurrentSampleIndex () const
 
double getLastBlockFirstValue (int row) const
 
const QMap< qint32, qint32 > & getIdxSelMap () const
 
void selectRows (const QList< qint32 > &selection)
 
void hideRows (const QList< qint32 > &selection)
 
void resetSelection ()
 
void toggleFreeze (const QModelIndex &index)
 
void setScaling (const QMap< qint32, float > &p_qMapChScaling)
 
void updateProjection (const QList< FIFFLIB::FiffProj > &projs)
 
void updateCompensator (int to)
 
void updateSpharaActivation (bool state)
 
void updateSpharaOptions (const QString &sSytemType, int nBaseFctsFirst, int nBaseFctsSecond)
 
void setFilter (QList< RTPROCESSINGLIB::FilterKernel > filterData)
 
void setFilterActive (bool state)
 
void setBackgroundColor (const QColor &color)
 
void setFilterChannelType (const QString &channelType)
 
void createFilterChannelList (QStringList channelNames)
 
void markChBad (QModelIndex ch, bool status)
 
void markChBad (QModelIndexList chlist, bool status)
 
void triggerInfoChanged (const QMap< double, QColor > &colorMap, bool active, QString triggerCh, double threshold)
 
void distanceTimeSpacerChanged (int value)
 
void resetTriggerCounter ()
 
qint32 numVLines () const
 
bool isFreezed () const
 
const QMap< qint32, float > & getScaling () const
 
QList< QPair< int, double > > getDetectedTriggers () const
 
QList< QPair< int, double > > getDetectedTriggersOld () const
 
QMap< double, QColor > getTriggerColor () const
 
int getNumberOfTimeSpacers () const
 
double getTriggerThreshold () const
 
QString getTriggerName () const
 
int getCurrentTriggerIndex () const
 
bool triggerDetectionActive () const
 
int getCurrentOverlapAddDelay () const
 
int getFirstSampleOffset () const
 
double getMaxValueFromRawViewModel (int row) const
 
void addEvent (int iSample)
 
std::unique_ptr< std::vector< EVENTSLIB::Event > > getEventsToDisplay (int iBegin, int iEnd) const
 

Detailed Description

The RtFiffRawViewModel class implements the data access model for a real-time multi sample array data stream.

DECLARE CLASS RtFiffRawViewModel

Definition at line 101 of file rtfiffrawviewmodel.h.

Inheritance diagram for DISPLIB::RtFiffRawViewModel:
Inheritance graph

Member Typedef Documentation

◆ ConstSPtr

Const shared pointer type for RtFiffRawViewModel.

Definition at line 107 of file rtfiffrawviewmodel.h.

◆ SPtr

Shared pointer type for RtFiffRawViewModel.

Definition at line 106 of file rtfiffrawviewmodel.h.

Constructor & Destructor Documentation

◆ RtFiffRawViewModel()

RtFiffRawViewModel::RtFiffRawViewModel ( QObject *  parent = 0)

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

Parameters
[in]parentparent of the table model.

Definition at line 83 of file rtfiffrawviewmodel.cpp.

◆ ~RtFiffRawViewModel()

RtFiffRawViewModel::~RtFiffRawViewModel ( )

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

Definition at line 115 of file rtfiffrawviewmodel.cpp.

Member Function Documentation

◆ addData()

void RtFiffRawViewModel::addData ( const QList< Eigen::MatrixXd > &  data)

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

Parameters
[in]datadata to add (Time points of channel samples).

Definition at line 417 of file rtfiffrawviewmodel.cpp.

◆ addEvent()

void RtFiffRawViewModel::addEvent ( int  iSample)

Adds event based on input parameters

Parameters
[in]

Definition at line 1384 of file rtfiffrawviewmodel.cpp.

◆ columnCount()

int RtFiffRawViewModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const
virtual

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

Parameters
[in]parentnot used.
Returns
number of columns.

Definition at line 133 of file rtfiffrawviewmodel.cpp.

◆ createFilterChannelList()

void RtFiffRawViewModel::createFilterChannelList ( QStringList  channelNames)

Create list of channels which are to be filtered based on channel names

Parameters
[in]channelNamesthe channel names which are to be filtered.

Definition at line 970 of file rtfiffrawviewmodel.cpp.

◆ data()

QVariant RtFiffRawViewModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const
virtual

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

Parameters
[in]indexdetermines item location.
[in]rolerole to return.
Returns
accessed data.

Definition at line 140 of file rtfiffrawviewmodel.cpp.

◆ distanceTimeSpacerChanged()

void RtFiffRawViewModel::distanceTimeSpacerChanged ( int  value)

distanceTimeSpacerChanged changes the distance of the time spacers

Parameters
[in]valuethe new distance for the time spacers.

Definition at line 1065 of file rtfiffrawviewmodel.cpp.

◆ getCoil()

fiff_int_t RtFiffRawViewModel::getCoil ( qint32  row) const

Returns the coil type of a given channel number

Parameters
[in]rowrow number which correspodns to a given channel.
Returns
coil type of given channel number.

Definition at line 598 of file rtfiffrawviewmodel.cpp.

◆ getCurrentOverlapAddDelay()

int DISPLIB::RtFiffRawViewModel::getCurrentOverlapAddDelay ( ) const
inline

Returns the current overlap add delay

Returns
the current overlap add delay.

Definition at line 826 of file rtfiffrawviewmodel.h.

◆ getCurrentSampleIndex()

qint32 DISPLIB::RtFiffRawViewModel::getCurrentSampleIndex ( ) const
inline

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

Returns
the current sample index.

Definition at line 690 of file rtfiffrawviewmodel.h.

◆ getCurrentTriggerIndex()

int DISPLIB::RtFiffRawViewModel::getCurrentTriggerIndex ( ) const
inline

Returns the current trigger channel index

Returns
the current trigger channel index.

Definition at line 812 of file rtfiffrawviewmodel.h.

◆ getDetectedTriggers()

QList< QPair< int, double > > DISPLIB::RtFiffRawViewModel::getDetectedTriggers ( ) const
inline

Returns current detected trigger flanks

Returns
the current detected trigger flanks.

Definition at line 758 of file rtfiffrawviewmodel.h.

◆ getDetectedTriggersOld()

QList< QPair< int, double > > DISPLIB::RtFiffRawViewModel::getDetectedTriggersOld ( ) const
inline

Returns old detected trigger flanks

Returns
the old detected trigger flanks.

Definition at line 774 of file rtfiffrawviewmodel.h.

◆ getEventsToDisplay()

std::unique_ptr< std::vector< EVENTSLIB::Event > > RtFiffRawViewModel::getEventsToDisplay ( int  iBegin,
int  iEnd 
) const

Returns events between two samples

Parameters
[in]iBeginLower bound for sample (inclusive).
[in]iEndUpper bound for sample (exclusive).
Returns
Pointer to a vector of events.

Definition at line 1391 of file rtfiffrawviewmodel.cpp.

◆ getFirstSampleOffset()

int DISPLIB::RtFiffRawViewModel::getFirstSampleOffset ( ) const
inline

Get offset of first drawn sample in the window

Returns
sample offset of window

Definition at line 836 of file rtfiffrawviewmodel.h.

◆ getIdxSelMap()

const QMap< qint32, qint32 > & DISPLIB::RtFiffRawViewModel::getIdxSelMap ( ) const
inline

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

Returns
the channel idx to selection status.

Definition at line 718 of file rtfiffrawviewmodel.h.

◆ getKind()

fiff_int_t RtFiffRawViewModel::getKind ( qint32  row) const

Returns the kind of a given channel number

Parameters
[in]rowrow number which correspodns to a given channel.
Returns
kind of given channel number.

Definition at line 574 of file rtfiffrawviewmodel.cpp.

◆ getLastBlock()

MatrixXd RtFiffRawViewModel::getLastBlock ( )

Returns the last received data block.

Returns
the last data block.

Definition at line 406 of file rtfiffrawviewmodel.cpp.

◆ getLastBlockFirstValue()

double DISPLIB::RtFiffRawViewModel::getLastBlockFirstValue ( int  row) const
inline

Returns the first value of the last complete data display block

Parameters
[in]rowrow for which the first value is to be returned.
Returns
the first value of the last complete data display block.

Definition at line 705 of file rtfiffrawviewmodel.h.

◆ getMaxSamples()

qint32 DISPLIB::RtFiffRawViewModel::getMaxSamples ( ) const
inline

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

Returns
the maximal number of samples.

Definition at line 683 of file rtfiffrawviewmodel.h.

◆ getMaxValueFromRawViewModel()

double RtFiffRawViewModel::getMaxValueFromRawViewModel ( int  row) const

Get maximum range of respective channel type. range value in FiffChInfo does not seem to contain a reasonable value

Parameters
[in]Rowof the model
Returns
the max value of the y axis for the channel

Definition at line 1321 of file rtfiffrawviewmodel.cpp.

◆ getNumberOfTimeSpacers()

int DISPLIB::RtFiffRawViewModel::getNumberOfTimeSpacers ( ) const
inline

Returns the current number for the time spacers

Returns
the current number for the time spacers.

Definition at line 790 of file rtfiffrawviewmodel.h.

◆ getScaling()

const QMap< qint32, float > & DISPLIB::RtFiffRawViewModel::getScaling ( ) const
inline

Returns current scaling

Returns
the current scaling.

Definition at line 739 of file rtfiffrawviewmodel.h.

◆ getTriggerColor()

QMap< double, QColor > DISPLIB::RtFiffRawViewModel::getTriggerColor ( ) const
inline

Returns current trigger color

Returns
the current trigger color map fpr each detected type.

Definition at line 746 of file rtfiffrawviewmodel.h.

◆ getTriggerName()

QString DISPLIB::RtFiffRawViewModel::getTriggerName ( ) const
inline

Returns the current trigger name

Returns
the current trigger name.

Definition at line 805 of file rtfiffrawviewmodel.h.

◆ getTriggerThreshold()

double DISPLIB::RtFiffRawViewModel::getTriggerThreshold ( ) const
inline

Returns the current trigger threshold

Returns
the current trigger threshold.

Definition at line 798 of file rtfiffrawviewmodel.h.

◆ getUnit()

fiff_int_t RtFiffRawViewModel::getUnit ( qint32  row) const

Returns the unit of a given channel number

Parameters
[in]rowrow number which correspodns to a given channel.
Returns
unit of given channel number.

Definition at line 586 of file rtfiffrawviewmodel.cpp.

◆ headerData()

QVariant RtFiffRawViewModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const
virtual

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

Parameters
[in]sectionFor horizontal headers, the section number corresponds to the column number. Similarly, for vertical headers, the section number corresponds to the row number.
[in]orientationQt::Horizontal or Qt::Vertical.
[in]rolerole to show.
Returns
accessed eader data.

Definition at line 206 of file rtfiffrawviewmodel.cpp.

◆ hideRows()

void RtFiffRawViewModel::hideRows ( const QList< qint32 > &  selection)

Hides the given list of channel

Parameters
[in]selectionchannel index list to select.

Definition at line 631 of file rtfiffrawviewmodel.cpp.

◆ isFreezed()

bool DISPLIB::RtFiffRawViewModel::isFreezed ( ) const
inline

Returns current freezing status

Returns
the current freezing status.

Definition at line 732 of file rtfiffrawviewmodel.h.

◆ markChBad() [1/2]

void RtFiffRawViewModel::markChBad ( QModelIndex  ch,
bool  status 
)

markChBad marks the selected channels as bad/good in m_chInfolist

Parameters
[in]chlistindex that is selected for marking.
[in]status,status=1-> mark as bad, status=0 -> mark as good.

Definition at line 1011 of file rtfiffrawviewmodel.cpp.

◆ markChBad() [2/2]

void RtFiffRawViewModel::markChBad ( QModelIndexList  chlist,
bool  status 
)

markChBad marks the selected channels as bad/good in m_chInfolist

Parameters
[in]chlistis the list of indices that are selected for marking.
[in]status,status=1-> mark as bad, status=0 -> mark as good.

Definition at line 1083 of file rtfiffrawviewmodel.cpp.

◆ newSelection

void DISPLIB::RtFiffRawViewModel::newSelection ( const QList< qint32 > &  selection)
signal

Emmited when new selcetion was made

Parameters
[in]selectionlist of all selected channels.

◆ numVLines()

qint32 DISPLIB::RtFiffRawViewModel::numVLines ( ) const
inline

Returns the number of vertical lines (one per second)

Returns
number of vertical lines.

Definition at line 725 of file rtfiffrawviewmodel.h.

◆ resetSelection()

void RtFiffRawViewModel::resetSelection ( )

Resets the current selection (selects all channels)

Definition at line 648 of file rtfiffrawviewmodel.cpp.

◆ resetTriggerCounter()

void RtFiffRawViewModel::resetTriggerCounter ( )

resetTriggerCounter resets the trigger counter

Definition at line 1076 of file rtfiffrawviewmodel.cpp.

◆ rowCount()

int RtFiffRawViewModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
virtual

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
[in]parentnot used.
Returns
number of rows.

Definition at line 122 of file rtfiffrawviewmodel.cpp.

◆ selectRows()

void RtFiffRawViewModel::selectRows ( const QList< qint32 > &  selection)

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

Parameters
[in]selectionchannel index list to select.

Definition at line 610 of file rtfiffrawviewmodel.cpp.

◆ setBackgroundColor()

void RtFiffRawViewModel::setBackgroundColor ( const QColor &  color)

Set the background color

Parameters
[in]colorThe background color.

Definition at line 924 of file rtfiffrawviewmodel.cpp.

◆ setFiffInfo()

void RtFiffRawViewModel::setFiffInfo ( QSharedPointer< FIFFLIB::FiffInfo > &  p_pFiffInfo)

Sets corresponding fiff information

Parameters
[in]p_pFiffInfoThe corresponding fiff information.

Definition at line 298 of file rtfiffrawviewmodel.cpp.

◆ setFilter()

void RtFiffRawViewModel::setFilter ( QList< RTPROCESSINGLIB::FilterKernel filterData)

Set new filter parameters

Parameters
[in]filterDatalist of the new filter.

Definition at line 895 of file rtfiffrawviewmodel.cpp.

◆ setFilterActive()

void RtFiffRawViewModel::setFilterActive ( bool  state)

Set filter activation

Parameters
[in]statefilter on/off flag.

Definition at line 917 of file rtfiffrawviewmodel.cpp.

◆ setFilterChannelType()

void RtFiffRawViewModel::setFilterChannelType ( const QString &  channelType)

Sets the type of channel which are to be filtered

Parameters
[in]channelTypethe channel type which is to be filtered (EEG, MEG, All).

Definition at line 931 of file rtfiffrawviewmodel.cpp.

◆ setSamplingInfo()

void RtFiffRawViewModel::setSamplingInfo ( float  sps,
int  T,
bool  bSetZero = false 
)

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

Parameters
[in]spsSamples per second of incomming data.
[in]TTime window length to display.
[in]bSetZeroIf data should be set to zero. Default is false.

Definition at line 375 of file rtfiffrawviewmodel.cpp.

◆ setScaling()

void RtFiffRawViewModel::setScaling ( const QMap< qint32, float > &  p_qMapChScaling)

Set scaling channel scaling

Parameters
[in]p_qMapChScalingMap of scaling factors.

Definition at line 686 of file rtfiffrawviewmodel.cpp.

◆ toggleFreeze()

void RtFiffRawViewModel::toggleFreeze ( const QModelIndex &  index)

Toggle freeze for all channels when a channel is double clicked

Parameters
[in]indexof the channel which has been double clicked.

Definition at line 663 of file rtfiffrawviewmodel.cpp.

◆ triggerDetected

void DISPLIB::RtFiffRawViewModel::triggerDetected ( int  numberDetectedTriggers,
const QMap< int, QList< QPair< int, double > > > &  mapDetectedTriggers 
)
signal

Emmited when trigger detection was performed

◆ triggerDetectionActive()

bool DISPLIB::RtFiffRawViewModel::triggerDetectionActive ( ) const
inline

Returns whether trigger detection is active or not

Returns
whether trigger detection is active or not.

Definition at line 819 of file rtfiffrawviewmodel.h.

◆ triggerInfoChanged()

void RtFiffRawViewModel::triggerInfoChanged ( const QMap< double, QColor > &  colorMap,
bool  active,
QString  triggerCh,
double  threshold 
)

markChBad marks the selected channels as bad/good in m_chInfolist

Parameters
[in]colorMapcolor for each trigger channel.
[in]activreal time trigger detection active.
[in]triggerChcurrent trigger channel to scan.
[in]thresholdthreshold for the detection process.

Definition at line 1038 of file rtfiffrawviewmodel.cpp.

◆ updateCompensator()

void RtFiffRawViewModel::updateCompensator ( int  to)

Update the compensator

Parameters
[in]toCompensator to use in fiff constant format FiffCtfComp.kind (NOT FiffCtfComp.ctfkind).

Definition at line 755 of file rtfiffrawviewmodel.cpp.

◆ updateProjection()

void RtFiffRawViewModel::updateProjection ( const QList< FIFFLIB::FiffProj > &  projs)

Update the SSP projection

Parameters
[in]projsThe new projectors.

Definition at line 695 of file rtfiffrawviewmodel.cpp.

◆ updateSpharaActivation()

void RtFiffRawViewModel::updateSpharaActivation ( bool  state)

Update the SPHARA operator

Parameters
[in]stateThe current state of teh SPHARA tool.

Definition at line 809 of file rtfiffrawviewmodel.cpp.

◆ updateSpharaOptions()

void RtFiffRawViewModel::updateSpharaOptions ( const QString &  sSytemType,
int  nBaseFctsFirst,
int  nBaseFctsSecond 
)

Update the SPHARA operator

Parameters
[in]sSystemTypeThe current acquisition system type (VectorView, BabyMEG, EEG).
[in]nBaseFctsFirstThe new number of basis function to use for the first SPHARA operator.
[in]nBaseFctsSecondThe new number of basis function to use for the second SPHARA operator.

Definition at line 816 of file rtfiffrawviewmodel.cpp.

◆ windowSizeChanged

void DISPLIB::RtFiffRawViewModel::windowSizeChanged ( int  windowSize)
signal

Emmited when the window size/max number of samples changed

Parameters
[in]windowSizenumber of samples in the window.

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