35 #ifndef EVOKEDSETMODEL_H
36 #define EVOKEDSETMODEL_H
42 #include "../../disp_global.h"
51 #include <QAbstractTableModel>
52 #include <QSharedPointer>
60 #include <Eigen/SparseCore>
82 namespace EvokedSetModelRoles {
83 enum ItemRole{GetAverageData = Qt::UserRole + 1020};
90 typedef Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic,Eigen::RowMajor> MatrixXdR;
91 typedef QPair<const double*,qint32> RowVectorPair;
92 typedef QPair<QString, Eigen::RowVectorXd> AvrTypeRowVector;
93 typedef QPair<QString, DISPLIB::RowVectorPair> AvrTypeRowVectorPair;
106 typedef QSharedPointer<EvokedSetModel>
SPtr;
133 qint32 getNumSamples()
const;
143 virtual int rowCount(
const QModelIndex &parent = QModelIndex())
const ;
153 virtual int columnCount(
const QModelIndex &parent = QModelIndex())
const;
165 QVariant data(
int row,
167 int role = Qt::DisplayRole)
const;
178 virtual QVariant data(
const QModelIndex &index,
179 int role = Qt::DisplayRole)
const;
191 virtual QVariant headerData(
int section,
192 Qt::Orientation orientation,
193 int role = Qt::DisplayRole)
const;
203 void setEvokedSet(QSharedPointer<FIFFLIB::FiffEvokedSet> pEvokedSet);
206 QSharedPointer<FIFFLIB::FiffEvokedSet> getEvokedSet();
220 QSharedPointer<QMap<QString, QColor> > getAverageColor()
const;
228 QSharedPointer<QMap<QString, bool> > getAverageActivation()
const;
236 void setAverageColor(
const QSharedPointer<QMap<QString, QColor> > qMapAverageColor);
244 void setAverageActivation(
const QSharedPointer<QMap<QString, bool> > qMapAverageActivation);
254 FIFFLIB::fiff_int_t getKind(qint32 row)
const;
264 bool getIsChannelBad(qint32 row)
const;
274 FIFFLIB::fiff_int_t getUnit(qint32 row)
const;
284 FIFFLIB::fiff_int_t getCoil(qint32 row)
const;
292 const QMap<qint32,qint32>& getIdxSelMap()
const;
300 int getNumberOfTimeSpacers()
const;
308 QPair<QVariant,QVariant> getBaselineInfo()
const;
316 int getNumAverages()
const;
324 qint32 getNumPreStimSamples()
const;
332 float getSamplingFrequency()
const;
340 void selectRows(
const QList<qint32> &selection);
346 void resetSelection();
354 qint32 numVLines()
const;
362 bool isFreezed()
const;
368 void updateProjection(
const QList<FIFFLIB::FiffProj>& projs);
376 void updateCompensator(
int to);
385 QSharedPointer<FIFFLIB::FiffEvokedSet> m_pEvokedSet;
387 QMap<qint32,qint32> m_qMapIdxRowSelection;
388 QSharedPointer<QMap<QString, QColor> > m_qMapAverageColor;
389 QSharedPointer<QMap<QString, bool> > m_qMapAverageActivation;
390 QSharedPointer<QMap<QString, QColor> > m_qMapAverageColorOld;
391 QSharedPointer<QMap<QString, bool> > m_qMapAverageActivationOld;
393 QList<Eigen::MatrixXd> m_matData;
394 QList<Eigen::MatrixXd> m_matDataFreeze;
395 QStringList m_lAvrTypes;
397 Eigen::MatrixXd m_matProj;
398 Eigen::MatrixXd m_matComp;
399 Eigen::SparseMatrix<double> m_matSparseProjCompMult;
400 Eigen::SparseMatrix<double> m_matSparseProjMult;
401 Eigen::SparseMatrix<double> m_matSparseCompMult;
403 Eigen::RowVectorXi m_vecBadIdcs;
405 QPair<QVariant,QVariant> m_pairBaseline;
409 bool m_bProjActivated;
410 bool m_bCompActivated;
420 void newSelection(QList<qint32> selection);
428 void newAverageColorMap(
const QSharedPointer<QMap<QString, QColor> > qMapAverageColor);
436 void newAverageActivationMap(
const QSharedPointer<QMap<QString, bool> > qMapAverageActivation);
444 #ifndef metatype_listrowvectorxd
445 #define metatype_listrowvectorxd
449 #ifndef metatype_listrowvectorpair
450 #define metatype_listrowvectorpair
454 #endif // EVOKEDSETMODEL_H