Skip to content

Commit e58927c

Browse files
committed
Add disp params, remove scan plugin from loading, add libs to static build
1 parent dfb76b2 commit e58927c

File tree

5 files changed

+67
-51
lines changed

5 files changed

+67
-51
lines changed

applications/mne_analyze/mne_analyze/mne_analyze.pro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ contains(MNECPP_CONFIG, static) {
8888
-lcontrolmanager \
8989
-lchannelselection \
9090
-lcoregistration \
91+
-ltimefrequency \
9192

9293
# Add Qt3D/Disp3D based plugins only if not building against WASM, which does not support Qt3D
9394
!contains(DEFINES, WASMBUILD) {

applications/mne_analyze/plugins/timefrequency/timefrequency.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
*
3333
*/
3434

35-
#ifndef TIMEFREQUENCY_H
36-
#define TIMEFREQUENCY_H
35+
#ifndef TIMEFREQUENCY_AN_PLUGIN_H
36+
#define TIMEFREQUENCY_AN_PLUGIN_H
3737

3838
//=============================================================================================================
3939
// INCLUDES

applications/mne_analyze/plugins/timefrequency/timefrequency.pro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ LIBS += -L$${MNE_LIBRARY_DIR}
6464
CONFIG(debug, debug|release) {
6565
LIBS += -lanSharedd \
6666
-lmnecppDispd \
67+
-lmnecppEventsd \
6768
-lmnecppConnectivityd \
6869
-lmnecppRtProcessingd \
6970
-lmnecppInversed \
@@ -75,6 +76,7 @@ CONFIG(debug, debug|release) {
7576
} else {
7677
LIBS += -lanShared \
7778
-lmnecppDisp \
79+
-lmnecppEvents \
7880
-lmnecppConnectivity \
7981
-lmnecppRtProcessing \
8082
-lmnecppInverse \

applications/mne_scan/plugins/plugins.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,4 @@ SUBDIRS += \
7777
writetofile \
7878
hpi \
7979
rtfwd \
80-
timefrequency \
80+
#timefrequency \

libraries/disp/viewers/timefrequencyview.cpp

Lines changed: 61 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ void TimeFrequencyView::initQMLView()
148148

149149
void TimeFrequencyView::paintEvent(QPaintEvent *event)
150150
{
151-
if (m_pEvokedSetModel){
151+
// if (m_pEvokedSetModel){
152152
QPainter painter(this);
153153

154154
painter.save();
@@ -170,68 +170,81 @@ void TimeFrequencyView::paintEvent(QPaintEvent *event)
170170

171171
//paint gradient bar
172172

173-
painter.save();
174-
painter.setPen(QPen(Qt::black, 1, Qt::SolidLine));
175-
QRect gradientBar(chartBound.topRight().x() + m_iChartBorderSpacing, chartBound.topRight().y(), m_iChartBorderSpacing, chartBound.height());
176-
painter.drawRect(gradientBar);
177-
painter.restore();
173+
// painter.save();
174+
// painter.setPen(QPen(Qt::black, 1, Qt::SolidLine));
175+
// QRect gradientBar(chartBound.topRight().x() + m_iChartBorderSpacing, chartBound.topRight().y(), m_iChartBorderSpacing, chartBound.height());
176+
// painter.drawRect(gradientBar);
177+
// painter.restore();
178+
179+
// painter.save();
180+
// painter.drawPixmap(gradientBar, m_CoefficientPixmap);
181+
// painter.restore();
178182

179183
painter.save();
180-
painter.drawPixmap(gradientBar, m_CoefficientPixmap);
184+
185+
painter.drawPixmap(chartBound.topRight().x() + m_iChartBorderSpacing, chartBound.topRight().y(), m_iChartBorderSpacing, chartBound.height(), m_CoefficientPixmap);
186+
181187
painter.restore();
182188

183-
//paint axis labels
184-
//test
185-
if(m_pEvokedSetModel->getNumSamples() > 0) {
186-
painter.save();
187-
painter.setPen(QPen(Qt::red, 1, Qt::DashLine));
189+
// QLinearGradient linGrad(this->width() - m_iChartBorderSpacing * 1.5f, chartBound.topRight().y(), this->width() - m_iChartBorderSpacing * 1.5f, chartBound.bottomRight().y());
190+
// painter.save();
191+
// painter.setBrush(linGrad);
192+
// painter.drawRect(chartBound.topRight().x() + m_iChartBorderSpacing, chartBound.topRight().y(), m_iChartBorderSpacing, chartBound.height());
188193

189-
float fDx = (float)(chartBound.width()) / ((float)m_pEvokedSetModel->getNumSamples());
190-
float posX = fDx * ((float)m_pEvokedSetModel->getNumPreStimSamples());
191-
painter.drawLine(chartBound.bottomLeft().x()+posX, chartBound.bottomRight().y(), chartBound.bottomLeft().x() + posX, chartBound.topRight().y());
192194

193-
painter.drawText(QPointF(posX+chartBound.bottomLeft().x(),chartBound.bottomRight().y()-5), QString("0ms / Stimulus"));
194195

195-
painter.restore();
196+
// //paint axis labels
197+
// //test
198+
// if(m_pEvokedSetModel->getNumSamples() > 0) {
199+
// painter.save();
200+
// painter.setPen(QPen(Qt::red, 1, Qt::DashLine));
196201

197-
painter.save();
198-
QColor colorTimeSpacer = Qt::black;
199-
colorTimeSpacer.setAlphaF(0.5);
200-
painter.setPen(QPen(colorTimeSpacer, 1, Qt::DashLine));
202+
// float fDx = (float)(chartBound.width()) / ((float)m_pEvokedSetModel->getNumSamples());
203+
// float posX = fDx * ((float)m_pEvokedSetModel->getNumPreStimSamples());
204+
// painter.drawLine(chartBound.bottomLeft().x()+posX, chartBound.bottomRight().y(), chartBound.bottomLeft().x() + posX, chartBound.topRight().y());
201205

202-
float yStart = chartBound.topLeft().y();
203-
float yEnd = chartBound.bottomRight().y();
206+
// painter.drawText(QPointF(posX+chartBound.bottomLeft().x(),chartBound.bottomRight().y()-5), QString("0ms / Stimulus"));
204207

205-
float sampleCounter = m_pEvokedSetModel->getNumPreStimSamples();
206-
int counter = 1;
207-
float timeDistanceMSec = 50.0;
208-
float timeDistanceSamples = (timeDistanceMSec/1000.0)*m_pEvokedSetModel->getSamplingFrequency(); //time distance corresponding to sampling frequency
208+
// painter.restore();
209209

210-
//spacers before stim
211-
while(sampleCounter-timeDistanceSamples>0) {
212-
sampleCounter-=timeDistanceSamples;
213-
float x = chartBound.bottomLeft().x() + fDx*sampleCounter;
214-
painter.drawLine(x, yStart, x, yEnd);
215-
painter.drawText(QPointF(x - m_iChartBorderSpacing/3, yEnd + m_iChartBorderSpacing/2), QString("-%1ms").arg(timeDistanceMSec*counter));
216-
counter++;
217-
}
210+
// painter.save();
211+
// QColor colorTimeSpacer = Qt::black;
212+
// colorTimeSpacer.setAlphaF(0.5);
213+
// painter.setPen(QPen(colorTimeSpacer, 1, Qt::DashLine));
218214

219-
//spacers after stim
220-
counter = 1;
221-
sampleCounter = m_pEvokedSetModel->getNumPreStimSamples();
222-
while(sampleCounter+timeDistanceSamples<m_pEvokedSetModel->getNumSamples()) {
223-
sampleCounter+=timeDistanceSamples;
224-
float x = chartBound.bottomLeft().x() + fDx*sampleCounter;
225-
painter.drawLine(x, yStart, x, yEnd);
226-
painter.drawText(QPointF(x - m_iChartBorderSpacing/3, yEnd + m_iChartBorderSpacing/2), QString("%1ms").arg(timeDistanceMSec*counter));
227-
counter++;
228-
}
215+
// float yStart = chartBound.topLeft().y();
216+
// float yEnd = chartBound.bottomRight().y();
229217

230-
painter.restore();
218+
// float sampleCounter = m_pEvokedSetModel->getNumPreStimSamples();
219+
// int counter = 1;
220+
// float timeDistanceMSec = 50.0;
221+
// float timeDistanceSamples = (timeDistanceMSec/1000.0)*m_pEvokedSetModel->getSamplingFrequency(); //time distance corresponding to sampling frequency
231222

232-
}
223+
// //spacers before stim
224+
// while(sampleCounter-timeDistanceSamples>0) {
225+
// sampleCounter-=timeDistanceSamples;
226+
// float x = chartBound.bottomLeft().x() + fDx*sampleCounter;
227+
// painter.drawLine(x, yStart, x, yEnd);
228+
// painter.drawText(QPointF(x - m_iChartBorderSpacing/3, yEnd + m_iChartBorderSpacing/2), QString("-%1ms").arg(timeDistanceMSec*counter));
229+
// counter++;
230+
// }
233231

234-
}
232+
// //spacers after stim
233+
// counter = 1;
234+
// sampleCounter = m_pEvokedSetModel->getNumPreStimSamples();
235+
// while(sampleCounter+timeDistanceSamples<m_pEvokedSetModel->getNumSamples()) {
236+
// sampleCounter+=timeDistanceSamples;
237+
// float x = chartBound.bottomLeft().x() + fDx*sampleCounter;
238+
// painter.drawLine(x, yStart, x, yEnd);
239+
// painter.drawText(QPointF(x - m_iChartBorderSpacing/3, yEnd + m_iChartBorderSpacing/2), QString("%1ms").arg(timeDistanceMSec*counter));
240+
// counter++;
241+
// }
242+
243+
// painter.restore();
244+
245+
// }
246+
247+
// }
235248

236249
return QWidget::paintEvent(event);
237250
}

0 commit comments

Comments
 (0)