57#include <QSvgGenerator>
62#if !defined(NO_QOPENGLWIDGET)
63 #include <QOpenGLWidget>
94#if !defined(NO_QOPENGLWIDGET)
103 QVBoxLayout *neLayout =
new QVBoxLayout(
this);
105 neLayout->setContentsMargins(0,0,0,0);
106 this->setLayout(neLayout);
122#if !defined(NO_QOPENGLWIDGET)
155 for(
int i = 0; i<
m_pModel->rowCount(); i++) {
171 m_pTableView->setContextMenuPolicy(Qt::CustomContextMenu);
173 connect(
m_pTableView.data(), &QTableView::doubleClicked,
176 connect(
m_pTableView.data(), &QTableView::customContextMenuRequested,
180 m_pTableView->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
182 m_pTableView->horizontalHeader()->setSectionResizeMode(1, QHeaderView::Stretch);
189 m_pTableView->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
191 connect(
m_pTableView->verticalScrollBar(), &QScrollBar::valueChanged,
199 if(!data.isEmpty()) {
204 for(
int i = 0; i<
m_pModel->rowCount(); i++) {
220 qWarning() <<
"[RtFiffRawView::addData] Received data list is empty.";
241 return QWidget::eventFilter(
object, event);
333 for(
int i = 0; i<
m_pModel->rowCount(); i++) {
334 QString channel =
m_pModel->data(
m_pModel->index(i, 0), Qt::DisplayRole).toString();
391 if(fileName.contains(
".svg", Qt::CaseInsensitive)) {
393 QSvgGenerator svgGen;
394 svgGen.setFileName(fileName);
401 if(fileName.contains(
".png", Qt::CaseInsensitive)) {
403 pixMap.save(fileName);
425 m_pModel->updateSpharaActivation(state);
432 m_pModel->updateSpharaOptions(sSytemType, nBaseFctsFirst, nBaseFctsSecond);
453 m_pModel->setFilterChannelType(channelType);
460 const QString &triggerCh,
463 m_pModel->triggerInfoChanged(colorMap, active, triggerCh, threshold);
471 m_pModel->distanceTimeSpacerChanged(value);
496 QSettings settings(
"MNECPP");
507 QSettings settings(
"MNECPP");
544 QModelIndexList selected =
m_pTableView->selectionModel()->selectedIndexes();
547 QMenu *menu =
new QMenu(
this);
549 menu->addSection(
"Events");
551 QAction* addEventMarker = menu->addAction(tr(
"Add event"));
552 connect(addEventMarker, &QAction::triggered,
557 menu->addSection(
"Channel Marking");
560 QAction* doMarkChBad = menu->addAction(tr(
"Mark as bad"));
561 connect(doMarkChBad, &QAction::triggered,
564 QAction* doMarkChGood = menu->addAction(tr(
"Mark as good"));
565 connect(doMarkChGood, &QAction::triggered,
571 for(qint32 i = 0; i < selected.size(); ++i)
572 if(selected[i].column() == 1)
575 menu->addSection(
"Selection");
577 QAction* doSelection = menu->addAction(tr(
"Only show selection"));
578 connect(doSelection, &QAction::triggered,
582 QAction*
hideSelection = menu->addAction(tr(
"Hide selection"));
587 QAction* resetAppliedSelection = menu->addAction(tr(
"Reset selection"));
588 connect(resetAppliedSelection, &QAction::triggered,
590 connect(resetAppliedSelection, &QAction::triggered,
594 menu->popup(
m_pTableView->viewport()->mapToGlobal(pos));
602 for(
int i = 0; i<
m_pModel->rowCount(); i++) {
634 for(qint32 i = 0; i <
m_pFiffInfo->chs.size(); ++i) {
685 QModelIndexList selected =
m_pTableView->selectionModel()->selectedIndexes();
687 for(
int i=0; i<selected.size(); i++) {
689 m_pModel->markChBad(selected[i],
false);
693 m_pModel->markChBad(selected[i],
true);
724 double dDx =
static_cast<double>(
m_pTableView->columnWidth(1)) /
static_cast<double>(
m_pModel->getMaxSamples());
725 double dSample =
static_cast<double>(
m_iClickPosX) / dDx;
727 int iFirstSampleOffset =
m_pModel->getFirstSampleOffset();
730 if (dSample >
m_pModel->getCurrentSampleIndex() && iFirstSampleOffset == 0){
735 int iAbsoluteSample =
static_cast<int>(dSample) + iFirstSampleOffset;
738 if (dSample >
m_pModel->getCurrentSampleIndex()){
739 iAbsoluteSample -=
m_pModel->getMaxSamples();
742 qDebug() <<
"EVENT SAMPLE:" << iAbsoluteSample;
Declaration of the RtFiffRawView Class.
Declaration of the RtFiffRawViewModel Class.
Declaration of the RtFiffRawViewDelegate Class.
FiffInfo class declaration.
The FilterKernel class represents a filter object that generates the FIR filter coefficients using Pa...
FIFF file I/O and data structures (raw, epochs, evoked, covariance, forward).
2-D display widgets and visualisation helpers (charts, topography, colour maps).
DSPSHARED_EXPORT Eigen::MatrixXd filterData(const Eigen::MatrixXd &matData, int type, double dCenterfreq, double dBandwidth, double dTransition, double dSFreq, int iOrder=1024, int designMethod=UTILSLIB::FilterKernel::m_designMethods.indexOf(UTILSLIB::FilterParameter("Cosine")), const Eigen::RowVectorXi &vecPicks=Eigen::RowVectorXi(), bool bUseThreads=true, bool bKeepOverhead=false)
Shared utilities (I/O helpers, spectral analysis, layout management, warp algorithms).
AbstractView(QWidget *parent=0, Qt::WindowFlags f=Qt::Widget)
The RtFiffRawViewDelegate class represents a RTMSA delegate which creates the plot paths.
void markerMoved(QPoint position, int activeRow)
The RtFiffRawViewModel class implements the data access model for a real-time multi sample array data...
void addEvent(int iSample)
void toggleFreeze(const QModelIndex &index)
void triggerDetected(int numberDetectedTriggers, const QMap< int, QList< QPair< int, double > > > &mapDetectedTriggers)
void setFilterChannelType(const QString &channelType)
QPointer< DISPLIB::RtFiffRawViewModel > m_pModel
QMap< qint32, float > m_qMapChScaling
void init(QSharedPointer< FIFFLIB::FiffInfo > &info)
QMap< qint32, float > getScalingMap()
RtFiffRawView(const QString &sSettingsPath="", QWidget *parent=0, Qt::WindowFlags f=Qt::Widget)
void takeScreenshot(const QString &fileName)
void updateGuiMode(GuiMode mode)
void setWindowSize(int T)
void visibleRowsChanged()
void updateCompensator(int to)
bool eventFilter(QObject *object, QEvent *event)
void triggerDetected(int numberDetectedTriggers, const QMap< int, QList< QPair< int, double > > > &mapDetectedTriggers)
void setBackgroundColor(const QColor &backgroundColor)
void addSampleAsEvent(int iSample)
void updateSpharaOptions(const QString &sSytemType, int nBaseFctsFirst, int nBaseFctsSecond)
void setDistanceTimeSpacer(int value)
QList< qint32 > m_qListBadChannels
float getSamplingFreq() const
QStringList m_slSelectedChannels
void channelContextMenu(QPoint pos)
Eigen::MatrixXd getLastBlock()
QPointer< QTableView > m_pTableView
void channelMarkingChanged()
void markerMoved(QPoint position, int activeRow)
void addData(const QList< Eigen::MatrixXd > &data)
void updateProcessingMode(ProcessingMode mode)
int m_iDistanceTimeSpacer
void showSelectedChannelsOnly(const QStringList &selectedChannels)
void updateSpharaActivation(bool state)
QSharedPointer< FIFFLIB::FiffInfo > m_pFiffInfo
void triggerInfoChanged(const QMap< double, QColor > &colorMap, bool active, const QString &triggerCh, double threshold)
void setSignalColor(const QColor &signalColor)
QColor getBackgroundColor()
void setSettingsPath(const QString &sSettingsPath)
QPointer< DISPLIB::RtFiffRawViewDelegate > m_pDelegate
void onAddEvent(bool bChecked)
bool getBadChannelHideStatus()
void resetTriggerCounter()
void setFilterActive(bool state)
void setFilter(const UTILSLIB::FilterKernel &filterData)
void updateOpenGLViewport()
QList< qint32 > m_qListCurrentSelection
void updateProjection(const QList< FIFFLIB::FiffProj > &projs)
int getDistanceTimeSpacer()
void setZoom(double zoomFac)
void setScalingMap(const QMap< qint32, float > &scaleMap)
The FilterKernel class provides methods to create/design a FIR filter kernel.