diff --git a/applications/mne_analyze/mne_analyze/mne_analyze.pro b/applications/mne_analyze/mne_analyze/mne_analyze.pro index bd6fe66e6d3..73aa6c40445 100644 --- a/applications/mne_analyze/mne_analyze/mne_analyze.pro +++ b/applications/mne_analyze/mne_analyze/mne_analyze.pro @@ -88,6 +88,7 @@ contains(MNECPP_CONFIG, static) { -lcontrolmanager \ -lchannelselection \ -lcoregistration \ + -ltimefrequency \ # Add Qt3D/Disp3D based plugins only if not building against WASM, which does not support Qt3D !contains(DEFINES, WASMBUILD) { diff --git a/applications/mne_analyze/plugins/timefrequency/timefrequency.h b/applications/mne_analyze/plugins/timefrequency/timefrequency.h index fe05199f9c8..bf35ecd7deb 100644 --- a/applications/mne_analyze/plugins/timefrequency/timefrequency.h +++ b/applications/mne_analyze/plugins/timefrequency/timefrequency.h @@ -32,8 +32,8 @@ * */ -#ifndef TIMEFREQUENCY_H -#define TIMEFREQUENCY_H +#ifndef TIMEFREQUENCY_AN_PLUGIN_H +#define TIMEFREQUENCY_AN_PLUGIN_H //============================================================================================================= // INCLUDES diff --git a/applications/mne_analyze/plugins/timefrequency/timefrequency.pro b/applications/mne_analyze/plugins/timefrequency/timefrequency.pro index 1ba9ac22c3f..721aa14ff09 100644 --- a/applications/mne_analyze/plugins/timefrequency/timefrequency.pro +++ b/applications/mne_analyze/plugins/timefrequency/timefrequency.pro @@ -64,6 +64,7 @@ LIBS += -L$${MNE_LIBRARY_DIR} CONFIG(debug, debug|release) { LIBS += -lanSharedd \ -lmnecppDispd \ + -lmnecppEventsd \ -lmnecppConnectivityd \ -lmnecppRtProcessingd \ -lmnecppInversed \ @@ -75,6 +76,7 @@ CONFIG(debug, debug|release) { } else { LIBS += -lanShared \ -lmnecppDisp \ + -lmnecppEvents \ -lmnecppConnectivity \ -lmnecppRtProcessing \ -lmnecppInverse \ diff --git a/applications/mne_scan/plugins/plugins.pro b/applications/mne_scan/plugins/plugins.pro index 9e3652557df..3c385c5cd34 100644 --- a/applications/mne_scan/plugins/plugins.pro +++ b/applications/mne_scan/plugins/plugins.pro @@ -77,4 +77,4 @@ SUBDIRS += \ writetofile \ hpi \ rtfwd \ - timefrequency \ + #timefrequency \ diff --git a/libraries/disp/viewers/timefrequencyview.cpp b/libraries/disp/viewers/timefrequencyview.cpp index b68c57c36d2..01e80926ae0 100644 --- a/libraries/disp/viewers/timefrequencyview.cpp +++ b/libraries/disp/viewers/timefrequencyview.cpp @@ -148,7 +148,7 @@ void TimeFrequencyView::initQMLView() void TimeFrequencyView::paintEvent(QPaintEvent *event) { - if (m_pEvokedSetModel){ +// if (m_pEvokedSetModel){ QPainter painter(this); painter.save(); @@ -170,68 +170,81 @@ void TimeFrequencyView::paintEvent(QPaintEvent *event) //paint gradient bar - painter.save(); - painter.setPen(QPen(Qt::black, 1, Qt::SolidLine)); - QRect gradientBar(chartBound.topRight().x() + m_iChartBorderSpacing, chartBound.topRight().y(), m_iChartBorderSpacing, chartBound.height()); - painter.drawRect(gradientBar); - painter.restore(); +// painter.save(); +// painter.setPen(QPen(Qt::black, 1, Qt::SolidLine)); +// QRect gradientBar(chartBound.topRight().x() + m_iChartBorderSpacing, chartBound.topRight().y(), m_iChartBorderSpacing, chartBound.height()); +// painter.drawRect(gradientBar); +// painter.restore(); + +// painter.save(); +// painter.drawPixmap(gradientBar, m_CoefficientPixmap); +// painter.restore(); painter.save(); - painter.drawPixmap(gradientBar, m_CoefficientPixmap); + + painter.drawPixmap(chartBound.topRight().x() + m_iChartBorderSpacing, chartBound.topRight().y(), m_iChartBorderSpacing, chartBound.height(), m_CoefficientPixmap); + painter.restore(); - //paint axis labels - //test - if(m_pEvokedSetModel->getNumSamples() > 0) { - painter.save(); - painter.setPen(QPen(Qt::red, 1, Qt::DashLine)); +// QLinearGradient linGrad(this->width() - m_iChartBorderSpacing * 1.5f, chartBound.topRight().y(), this->width() - m_iChartBorderSpacing * 1.5f, chartBound.bottomRight().y()); +// painter.save(); +// painter.setBrush(linGrad); +// painter.drawRect(chartBound.topRight().x() + m_iChartBorderSpacing, chartBound.topRight().y(), m_iChartBorderSpacing, chartBound.height()); - float fDx = (float)(chartBound.width()) / ((float)m_pEvokedSetModel->getNumSamples()); - float posX = fDx * ((float)m_pEvokedSetModel->getNumPreStimSamples()); - painter.drawLine(chartBound.bottomLeft().x()+posX, chartBound.bottomRight().y(), chartBound.bottomLeft().x() + posX, chartBound.topRight().y()); - painter.drawText(QPointF(posX+chartBound.bottomLeft().x(),chartBound.bottomRight().y()-5), QString("0ms / Stimulus")); - painter.restore(); +// //paint axis labels +// //test +// if(m_pEvokedSetModel->getNumSamples() > 0) { +// painter.save(); +// painter.setPen(QPen(Qt::red, 1, Qt::DashLine)); - painter.save(); - QColor colorTimeSpacer = Qt::black; - colorTimeSpacer.setAlphaF(0.5); - painter.setPen(QPen(colorTimeSpacer, 1, Qt::DashLine)); +// float fDx = (float)(chartBound.width()) / ((float)m_pEvokedSetModel->getNumSamples()); +// float posX = fDx * ((float)m_pEvokedSetModel->getNumPreStimSamples()); +// painter.drawLine(chartBound.bottomLeft().x()+posX, chartBound.bottomRight().y(), chartBound.bottomLeft().x() + posX, chartBound.topRight().y()); - float yStart = chartBound.topLeft().y(); - float yEnd = chartBound.bottomRight().y(); +// painter.drawText(QPointF(posX+chartBound.bottomLeft().x(),chartBound.bottomRight().y()-5), QString("0ms / Stimulus")); - float sampleCounter = m_pEvokedSetModel->getNumPreStimSamples(); - int counter = 1; - float timeDistanceMSec = 50.0; - float timeDistanceSamples = (timeDistanceMSec/1000.0)*m_pEvokedSetModel->getSamplingFrequency(); //time distance corresponding to sampling frequency +// painter.restore(); - //spacers before stim - while(sampleCounter-timeDistanceSamples>0) { - sampleCounter-=timeDistanceSamples; - float x = chartBound.bottomLeft().x() + fDx*sampleCounter; - painter.drawLine(x, yStart, x, yEnd); - painter.drawText(QPointF(x - m_iChartBorderSpacing/3, yEnd + m_iChartBorderSpacing/2), QString("-%1ms").arg(timeDistanceMSec*counter)); - counter++; - } +// painter.save(); +// QColor colorTimeSpacer = Qt::black; +// colorTimeSpacer.setAlphaF(0.5); +// painter.setPen(QPen(colorTimeSpacer, 1, Qt::DashLine)); - //spacers after stim - counter = 1; - sampleCounter = m_pEvokedSetModel->getNumPreStimSamples(); - while(sampleCounter+timeDistanceSamplesgetNumSamples()) { - sampleCounter+=timeDistanceSamples; - float x = chartBound.bottomLeft().x() + fDx*sampleCounter; - painter.drawLine(x, yStart, x, yEnd); - painter.drawText(QPointF(x - m_iChartBorderSpacing/3, yEnd + m_iChartBorderSpacing/2), QString("%1ms").arg(timeDistanceMSec*counter)); - counter++; - } +// float yStart = chartBound.topLeft().y(); +// float yEnd = chartBound.bottomRight().y(); - painter.restore(); +// float sampleCounter = m_pEvokedSetModel->getNumPreStimSamples(); +// int counter = 1; +// float timeDistanceMSec = 50.0; +// float timeDistanceSamples = (timeDistanceMSec/1000.0)*m_pEvokedSetModel->getSamplingFrequency(); //time distance corresponding to sampling frequency - } +// //spacers before stim +// while(sampleCounter-timeDistanceSamples>0) { +// sampleCounter-=timeDistanceSamples; +// float x = chartBound.bottomLeft().x() + fDx*sampleCounter; +// painter.drawLine(x, yStart, x, yEnd); +// painter.drawText(QPointF(x - m_iChartBorderSpacing/3, yEnd + m_iChartBorderSpacing/2), QString("-%1ms").arg(timeDistanceMSec*counter)); +// counter++; +// } - } +// //spacers after stim +// counter = 1; +// sampleCounter = m_pEvokedSetModel->getNumPreStimSamples(); +// while(sampleCounter+timeDistanceSamplesgetNumSamples()) { +// sampleCounter+=timeDistanceSamples; +// float x = chartBound.bottomLeft().x() + fDx*sampleCounter; +// painter.drawLine(x, yStart, x, yEnd); +// painter.drawText(QPointF(x - m_iChartBorderSpacing/3, yEnd + m_iChartBorderSpacing/2), QString("%1ms").arg(timeDistanceMSec*counter)); +// counter++; +// } + +// painter.restore(); + +// } + +// } return QWidget::paintEvent(event); }