56#include <QGraphicsView>
57#include <QSvgGenerator>
59#include <QGraphicsItem>
61#if !defined(NO_QOPENGLWIDGET)
62 #include <QOpenGLWidget>
69using namespace DISPLIB;
70using namespace FIFFLIB;
80, m_qMapAverageColor(QSharedPointer<QMap<QString, QColor> >::create())
81, m_qMapAverageActivation(QSharedPointer<QMap<QString, bool> >::create())
84 this->setWindowTitle(
"Average Layout");
88#if !defined(NO_QOPENGLWIDGET)
101 QVBoxLayout *neLayout =
new QVBoxLayout(
this);
102 neLayout->setContentsMargins(0,0,0,0);
104 this->setLayout(neLayout);
119#if !defined(NO_QOPENGLWIDGET)
137 if (pEvokedSetModel){
138 connect(pEvokedSetModel.data(), &EvokedSetModel::dataChanged,
150 qDebug() <<
"AverageLayoutView::setBackgroundColor - m_pAverageScene is NULL. Returning. ";
155 backgroundBrush.setColor(backgroundColor);
164 qDebug() <<
"AverageLayoutView::getBackgroundColor - m_pAverageScene is NULL. Returning. ";
176 qDebug() <<
"AverageLayoutView::takeScreenshot - m_pAverageScene is NULL. Returning. ";
180 if(fileName.contains(
".svg", Qt::CaseInsensitive))
183 QSvgGenerator svgGen;
184 svgGen.setFileName(fileName);
186 svgGen.setSize(QSize(rect.width(), rect.height()));
188 QPainter painter(&svgGen);
192 if(fileName.contains(
".png", Qt::CaseInsensitive))
195 QPixmap pixMap = QWidget::grab(rect);
196 pixMap.save(fileName);
205 qDebug() <<
"AverageLayoutView::setScaleMap - m_pAverageScene is NULL. Returning. ";
235 qDebug() <<
"AverageLayoutView::setAverageColor - m_pAverageScene is NULL. Returning. ";
260 qDebug() <<
"AverageLayoutView::setAverageActivation - m_pAverageScene is NULL. Returning. ";
273 qDebug() <<
"AverageLayoutView::channelSelectionManagerChanged - m_pAverageScene is NULL. Returning. ";
289 qDebug() <<
"AverageLayoutView::channelSelectionManagerChanged - m_pAverageScene is NULL. Returning. ";
308 QList<QGraphicsItem *> currentAverageSceneItems =
m_pAverageScene->items();
311 for(
int i = 0; i < currentAverageSceneItems.size(); i++) {
318 QList<QPair<QString, DISPLIB::RowVectorPair> > averageData =
m_pEvokedSetModel->data(0, 2, EvokedSetModelRoles::GetAverageData).value<QList<QPair<QString, DISPLIB::RowVectorPair> > >();
323 if(channelNumber != -1) {
328 if(!averageData.isEmpty()) {
344 qDebug() <<
"AverageLayoutView::updateData - m_pAverageScene, m_pEvokedSetModel or m_pChannelInfoModel are NULL. Returning. ";
348 QList<QGraphicsItem *> currentAverageSceneItems =
m_pAverageScene->items();
351 for(
int i = 0; i < currentAverageSceneItems.size(); i++) {
357 QList<QPair<QString, DISPLIB::RowVectorPair> > averageData =
m_pEvokedSetModel->data(0, 2, EvokedSetModelRoles::GetAverageData).value<QList<QPair<QString, DISPLIB::RowVectorPair> > >();
362 if(channelNumber != -1) {
369 if(!averageData.isEmpty()) {
391 QSettings settings(
"MNECPP");
402 QSettings settings(
"MNECPP");
410 case GuiMode::Clinical:
422 case ProcessingMode::Offline:
Declaration of the AverageLayoutView Class.
Contains the declaration of the AverageSceneItem class.
The declaration for ChannelInfoModel..
Contains the declaration of the AverageScene class.
Declaration of the EvokedSetModel Class.
Contains the declaration of the SelectionSceneItem class.
FiffInfo class declaration.
The AbstractView class provides the base calss for all Disp viewers.
void setBackgroundColor(const QColor &backgroundColor)
void updateGuiMode(GuiMode mode)
QMap< qint32, float > m_scaleMap
void setEvokedSetModel(QSharedPointer< EvokedSetModel > pEvokedSetModel)
void channelSelectionChanged(const QVariant &data)
void setChannelInfoModel(QSharedPointer< ChannelInfoModel > &pChannelInfoModel)
QSharedPointer< QMap< QString, bool > > getAverageActivation() const
QSharedPointer< FIFFLIB::FiffInfo > m_pFiffInfo
QSharedPointer< DISPLIB::EvokedSetModel > m_pEvokedSetModel
void setAverageColor(const QSharedPointer< QMap< QString, QColor > > qMapAverageColor)
QPointer< QGraphicsView > m_pAverageLayoutView
QSharedPointer< AverageScene > m_pAverageScene
void updateOpenGLViewport()
QSharedPointer< QMap< QString, QColor > > m_qMapAverageColor
QSharedPointer< QMap< QString, QColor > > getAverageColor() const
QSharedPointer< QMap< QString, bool > > m_qMapAverageActivation
void setScaleMap(const QMap< qint32, float > &scaleMap)
void takeScreenshot(const QString &fileName)
void setAverageActivation(const QSharedPointer< QMap< QString, bool > > qMapAverageActivation)
QSharedPointer< DISPLIB::ChannelInfoModel > m_pChannelInfoModel
void setFiffInfo(const QSharedPointer< FIFFLIB::FiffInfo > pFiffInfo)
AverageLayoutView(const QString &sSettingsPath="", QWidget *parent=0, Qt::WindowFlags f=Qt::Widget)
void updateProcessingMode(ProcessingMode mode)
void channelSelectionManagerChanged(const QList< QGraphicsItem * > &selectedChannelItems)
void setSingleAverageColor(const QColor &avgColor)
QColor getBackgroundColor()
QSharedPointer< EvokedSetModel > getEvokedSetModel()
The AverageScene class provides a reimplemented QGraphicsScene for 2D layout plotting.
QSharedPointer< AverageScene > SPtr
The AverageSceneItem class provides a new data structure for visualizing averages in a 2D layout.
QList< QPair< QString, RowVectorPair > > m_lAverageData
QPair< int, int > m_firstLastSample
int m_iTotalNumberChannels
The SelectionSceneItem class provides a new data structure for visualizing channels in a 2D layout.