v2.0.0
Loading...
Searching...
No Matches
rtfiffrawviewdelegate.cpp
Go to the documentation of this file.
1//=============================================================================================================
16
17//=============================================================================================================
18// INCLUDES
19//=============================================================================================================
20
22#include "rtfiffrawviewmodel.h"
23#include "../rtfiffrawview.h"
24
25#include "../scalingview.h"
26
27//=============================================================================================================
28// QT INCLUDES
29//=============================================================================================================
30
31#include <QPainter>
32#include <QDebug>
33#include <QPainterPath>
34
35//=============================================================================================================
36// EIGEN INCLUDES
37//=============================================================================================================
38
39//=============================================================================================================
40// USED NAMESPACES
41//=============================================================================================================
42
43using namespace DISPLIB;
44
45//=============================================================================================================
46// DEFINE MEMBER METHODS
47//=============================================================================================================
48
50: QAbstractItemDelegate(parent)
51, m_pParent(parent)
52, m_dMaxValue(0.0)
53, m_dScaleY(0.0)
54, m_iActiveRow(0)
55, m_iUpperItemIndex(0)
56{
57
58}
59
60//=============================================================================================================
61
62void RtFiffRawViewDelegate::initPainterPaths(const QAbstractTableModel *model)
63{
64 for(int i = 0; i<model->rowCount(); i++)
65 m_painterPaths.append(QPainterPath());
66
67 // Init pens
68 QColor colorMarker(233,0,43);
69 colorMarker.setAlpha(160);
70
71 m_penMarker = QPen(colorMarker, 2, Qt::DashLine);
72
73 m_penGrid = QPen(Qt::black, 1, Qt::DashLine);
74 m_penTimeSpacers = QPen(Qt::black, 1, Qt::DashLine);
75
76 m_penFreeze = QPen(Qt::darkGray, 1, Qt::SolidLine);
77 m_penFreezeSelected = QPen(Qt::darkRed, 1, Qt::SolidLine);
78
79 m_penFreezeBad = QPen(Qt::darkGray, 0.1, Qt::SolidLine);
80 m_penFreezeSelectedBad = QPen(Qt::darkRed, 1, Qt::SolidLine);
81
82 m_penNormal = QPen(Qt::darkBlue, 1, Qt::SolidLine);
83 m_penNormalSelected = QPen(Qt::red, 1, Qt::SolidLine);
84
85 m_penNormalBad = QPen(Qt::darkBlue, 0.1, Qt::SolidLine);
86 m_penNormalSelectedBad = QPen(Qt::red, 1, Qt::SolidLine);
87}
88
89//=============================================================================================================
90
91void createPaths(const QModelIndex &index,
92 const QStyleOptionViewItem &option,
93 QPainterPath &path,
94 QPainterPath &lastPath,
95 QPointF &ellipsePos,
96 QPointF &markerPosition,
97 QString &amplitude,
98 const QVector<float> &data,
99 const QVector<float> &lastData)
100{
101 const RtFiffRawViewModel* t_pModel = static_cast<const RtFiffRawViewModel*>(index.model());
102
103 //get maximum range of respective channel type (range value in FiffChInfo does not seem to contain a reasonable value)
104 qint32 kind = t_pModel->getKind(index.row());
105
106 float fMaxValue = DISPLIB::getScalingValue(t_pModel->getScaling(), kind, t_pModel->getUnit(index.row()));
107
108 float dValue;
109 float dScaleY = option.rect.height()/(2*fMaxValue);
110
111 float y_base = path.currentPosition().y();
112 QPointF qSamplePosition;
113
114 float dDx = ((float)option.rect.width()) / t_pModel->getMaxSamples();
115
116 //Move to initial starting point
117 if(data.size() > 0)
118 {
119// float val = data[0];
120 dValue = 0;//(val-data[0])*dScaleY;
121
122 float newY = y_base-dValue;//Reverse direction -> plot the right way
123
124 qSamplePosition.setY(newY);
125 qSamplePosition.setX(path.currentPosition().x());
126
127 path.moveTo(qSamplePosition);
128 }
129
130 //create lines from one to the next sample
131 qint32 i;
132 for(i = 1; i < data.size(); ++i) {
133 float val = data[i] - data[0]; //remove first sample data[0] as offset
134 dValue = val*dScaleY;
135 //qDebug()<<"val"<<val<<"dScaleY"<<dScaleY<<"dValue"<<dValue;
136
137 float newY = y_base-dValue;//Reverse direction -> plot the right way
138
139 qSamplePosition.setY(newY);
140 qSamplePosition.setX(path.currentPosition().x()+dDx);
141
142 path.lineTo(qSamplePosition);
143
144 //Create ellipse position
145 if(i == (qint32)(markerPosition.x()/dDx)) {
146 ellipsePos.setX(path.currentPosition().x()+dDx);
147 ellipsePos.setY(newY+(option.rect.height()/2));
148
149 amplitude = QString::number(data[i]);
150 }
151 }
152
153 //create lines from one to the next sample for last path
154 qint32 sample_offset = t_pModel->numVLines() + 1;
155 qSamplePosition.setX(qSamplePosition.x() + dDx*static_cast<double>(sample_offset));
156
157 //start painting from first sample value
158 float val = lastData[i] - lastData[0]; //remove first sample lastData[0] as offset
159 dValue = val*dScaleY;
160 float newY = y_base-dValue;
161 qSamplePosition.setY(newY);
162
163 lastPath.moveTo(qSamplePosition);
164
165 for(i += sample_offset; i < lastData.size(); ++i) {
166 val = lastData[i] - lastData[0]; //remove first sample lastData[0] as offset
167 dValue = val*dScaleY;
168
169 newY = y_base-dValue;
170
171 qSamplePosition.setY(newY);
172 qSamplePosition.setX(lastPath.currentPosition().x()+dDx);
173
174 lastPath.lineTo(qSamplePosition);
175
176 //Create ellipse position
177 if(i == (qint32)(markerPosition.x()/dDx)) {
178 ellipsePos.setX(lastPath.currentPosition().x()+dDx);
179 ellipsePos.setY(newY+(option.rect.height()/2));
180
181 amplitude = QString::number(lastData[i]);
182 }
183 }
184}
185
186//=============================================================================================================
187
188void RtFiffRawViewDelegate::paint(QPainter *painter,
189 const QStyleOptionViewItem &option,
190 const QModelIndex &index) const
191{
192 float t_fPlotHeight = option.rect.height();
193 painter->setRenderHint(QPainter::Antialiasing, true);
194
195 switch(index.column()) {
196 case 0: { //chnames
197 painter->save();
198
199 painter->rotate(-90);
200 painter->drawText(QRectF(-option.rect.y()-t_fPlotHeight,0,t_fPlotHeight,20),Qt::AlignCenter,index.model()->data(index,Qt::DisplayRole).toString());
201
202 painter->restore();
203 break;
204 }
205
206 case 1: { //data plot
207 QBrush backgroundBrush = index.model()->data(index, Qt::BackgroundRole).value<QBrush>();
208 bool bIsBadChannel = index.model()->data(index.model()->index(index.row(), 2), Qt::DisplayRole).toBool();
209
210 // Plot background based on user chosen color
211 // This is a rather ugly hack in order to cope with QOpenGLWidget's/QtableView's problem when setting a background color
212 if (index.row() == m_iUpperItemIndex) {
213 painter->save();
214 painter->setBrushOrigin(option.rect.topLeft());
215 QRect rect = option.rect;
216 rect.setHeight(2000);
217 painter->fillRect(rect, backgroundBrush);
218 painter->restore();
219 }
220
221 // Draw special background when channel is marked as bad
222 if(bIsBadChannel) {
223 painter->save();
224 QBrush brush(QColor(254,74,93,40));
225 painter->setBrushOrigin(option.rect.topLeft());
226 painter->fillRect(option.rect, brush);
227 painter->restore();
228 }
229
230// //Highlight selected channels
231// if(option.state & QStyle::State_Selected) {
232// QPointF oldBO = painter->brushOrigin();
233// painter->setBrushOrigin(option.rect.topLeft());
234// painter->fillRect(option.rect, option.palette.highlight());
235// painter->setBrushOrigin(oldBO);
236// }
237
238 //Get data
239 QVariant variant = index.model()->data(index,Qt::DisplayRole);
240 RowVectorPair data = variant.value<RowVectorPair>();
241
242 const RtFiffRawViewModel* t_pModel = static_cast<const RtFiffRawViewModel*>(index.model());
243
244 if(data.second > 0) {
245 QPainterPath path(QPointF(option.rect.x(),option.rect.y()));
246
247// //Plot hovering marker
248// createMarkerPath(option, path);
249
250// painter->save();
251// painter->setPen(m_penMarker);
252// painter->drawPath(path);
253// painter->restore();
254
255 //Plot grid
256 createGridPath(index, option, path, data);
257
258 painter->save();
259 painter->setPen(m_penGrid);
260 painter->drawPath(path);
261 painter->restore();
262
263 //Plot time spacers
264 createTimeSpacersPath(index, option, path, data);
265
266 painter->save();
267 painter->setPen(m_penTimeSpacers);
268 painter->drawPath(path);
269 painter->restore();
270
271 //Plot detected triggers
272 path = QPainterPath(QPointF(option.rect.x(),option.rect.y()));//QPointF(option.rect.x()+t_rtmsaModel->relFiffCursor(),option.rect.y()));
273 painter->save();
274 createTriggerPath(painter, index, option, path, data);
275 painter->restore();
276
277 //Plot trigger threshold
278 if(index.row() == t_pModel->getCurrentTriggerIndex() &&
279 t_pModel->triggerDetectionActive()) {
280 path = QPainterPath(QPointF(option.rect.x(),option.rect.y()));//QPointF(option.rect.x()+t_rtmsaModel->relFiffCursor(),option.rect.y()));
281 QPointF textPosition;
282 createTriggerThresholdPath(index, option, path, data, textPosition);
283
284 painter->save();
285 painter->setPen(QPen(Qt::red, 1, Qt::DashLine));
286 painter->drawPath(path);
287 painter->drawText(textPosition, QString("%1 Threshold").arg(t_pModel->getTriggerName()));
288 painter->restore();
289 }
290
291 path = QPainterPath(QPointF(option.rect.x(),option.rect.y()));//QPointF(option.rect.x()+t_rtmsaModel->relFiffCursor(),option.rect.y()));
292
293 //Plot data path
294 createPlotPath(index, option, path, data);
295
296 painter->setRenderHint(QPainter::Antialiasing, true);
297 painter->save();
298 painter->translate(0, t_fPlotHeight/2);
299
300 if(bIsBadChannel) {
301 if(t_pModel->isFreezed()) {
302 if(option.state & QStyle::State_Selected)
303 painter->setPen(m_penFreezeSelectedBad);
304 else
305 painter->setPen(m_penFreezeBad);
306 } else {
307 if(option.state & QStyle::State_Selected)
308 painter->setPen(m_penNormalSelectedBad);
309 else
310 painter->setPen(m_penNormalBad);
311 }
312 } else {
313 if(t_pModel->isFreezed()) {
314 if(option.state & QStyle::State_Selected)
315 painter->setPen(m_penFreezeSelected);
316 else
317 painter->setPen(m_penFreeze);
318 } else {
319 if(option.state & QStyle::State_Selected)
320 painter->setPen(m_penNormalSelected);
321 else
322 painter->setPen(m_penNormal);
323 }
324 }
325
326 painter->drawPath(path);
327 painter->restore();
328
329 //Plot current position marker
330 path = QPainterPath(QPointF(option.rect.x(),option.rect.y()));//QPointF(option.rect.x()+t_rtmsaModel->relFiffCursor(),option.rect.y()));
331 createCurrentPositionMarkerPath(index, option, path);
332
333 painter->save();
334 painter->setPen(m_penMarker);
335 painter->drawPath(path);
336 painter->restore();
337
338 path = QPainterPath(QPointF(option.rect.x(),option.rect.y()));//QPointF(option.rect.x()+t_rtmsaModel->relFiffCursor(),option.rect.y()));
339 createMarkerPath(index, option, path);
340
341 painter->save();
342 painter->setPen(QPen(Qt::green, 1, Qt::SolidLine));
343 painter->drawPath(path);
344 painter->restore();
345 }
346 break;
347 }
348 }
349}
350
351//=============================================================================================================
352
353QSize RtFiffRawViewDelegate::sizeHint(const QStyleOptionViewItem &option,
354 const QModelIndex &index) const
355{
356 QSize size = option.rect.size();
357
358 switch(index.column()) {
359 case 0:
360 size = QSize(20,option.rect.height());
361 break;
362 case 1:
363 QList< QVector<float> > data = index.model()->data(index).value< QList<QVector<float> > >();
364// qint32 nsamples = (static_cast<const RtFiffRawViewModel*>(index.model()))->lastSample()-(static_cast<const RtFiffRawViewModel*>(index.model()))->firstSample();
365// size = QSize(nsamples*m_dDx,m_dPlotHeight);
366 Q_UNUSED(option);
367 break;
368 }
369
370 return size;
371}
372
373//=============================================================================================================
374
376 int activeRow)
377{
378 m_markerPosition = position;
379 m_iActiveRow = activeRow;
380}
381
382//=============================================================================================================
383
384void RtFiffRawViewDelegate::setSignalColor(const QColor& signalColor)
385{
386 m_penNormal.setColor(signalColor);
387 m_penNormalBad.setColor(signalColor);
388}
389
390//=============================================================================================================
391
393{
394 return m_penNormal.color();
395}
396
397//=============================================================================================================
398
400{
401 m_iUpperItemIndex = iUpperItemIndex;
402}
403
404//=============================================================================================================
405
406void RtFiffRawViewDelegate::createPlotPath(const QModelIndex &index,
407 const QStyleOptionViewItem &option,
408 QPainterPath& path,
409 const RowVectorPair &data) const
410{
411 const RtFiffRawViewModel* t_pModel = static_cast<const RtFiffRawViewModel*>(index.model());
412 int iPlotSizePx = option.rect.width();
413 int iNumSamples = t_pModel->getMaxSamples();
414 double dPixelsPerSample = static_cast<double>(iPlotSizePx) / static_cast<double>(iNumSamples);
415
416 // locate time-cursor
417 int iTimeCursorSample = t_pModel->getCurrentSampleIndex();
418 double firstValuePreviousPlot = t_pModel->getLastBlockFirstValue(index.row());
419
420 //get maximum range of respective channel type (range value in FiffChInfo does not seem to contain a reasonable value)
421 double dMaxYValueEstimate = t_pModel->getMaxValueFromRawViewModel(index.row());
422 double dScaleY = option.rect.height()/(2 * dMaxYValueEstimate);
423 double dChannelOffset = path.currentPosition().y();
424
425// qDebug() << " - - - - - - - - - - - - - - - - - - - - - ";
426// qDebug() << " iPlotSizePx = " << iPlotSizePx;
427// qDebug() << " iNumSamples = " << iNumSamples;
428// qDebug() << " dPixelsPerSample = " << dPixelsPerSample;
429// qDebug() << " iTimeCursorSample = " << iTimeCursorSample;
430// qDebug() << " firstValuePreviousPlot = " << firstValuePreviousPlot;
431
432// qDebug() << " dMaxYValueEstimate = " << dMaxYValueEstimate;
433// qDebug() << " dScaleY = " << dScaleY;
434// qDebug() << " dChannelOffset = " << dChannelOffset;
435
436 // Move to initial starting point
437 path.moveTo(calcPoint(path, 0., 0., dChannelOffset, dScaleY));
438 double dY(0);
439
440 // The plot works as a rolling time-cursor, ploting data on top of previous
441 // runs. You always plot one whole window of data, between first sample and
442 // numSamplesToPlot (or data.second) Even if the only change is a new block
443 // of samples to the left of the time-cursor. At any time, to the left of
444 // the time-cursor you have the most recent data (A part) corresponding to
445 // the current roll. To the right of the time-cursor, you have data
446 // corresponding to the previous roll.
447 for (int j = 0; j < data.second; ++j) {
448 dY = data.first[j];
449 path.lineTo(calcPoint(path, dPixelsPerSample, dY,
450 dChannelOffset, dScaleY));
451 }
452}
453
454//=============================================================================================================
455
456void RtFiffRawViewDelegate::createCurrentPositionMarkerPath(const QModelIndex &index, const QStyleOptionViewItem &option, QPainterPath& path) const
457{
458 const RtFiffRawViewModel* t_pModel = static_cast<const RtFiffRawViewModel*>(index.model());
459
460 float currentSampleIndex = option.rect.x()+t_pModel->getCurrentSampleIndex();
461 float dDx = ((float)option.rect.width()) / t_pModel->getMaxSamples();
462 currentSampleIndex = currentSampleIndex*dDx;
463
464 float yStart = option.rect.topLeft().y();
465 float yEnd = option.rect.bottomRight().y();
466
467 path.moveTo(currentSampleIndex,yStart);
468 path.lineTo(currentSampleIndex,yEnd);
469}
470
471//=============================================================================================================
472
473void RtFiffRawViewDelegate::createGridPath(const QModelIndex &index, const QStyleOptionViewItem &option, QPainterPath& path, RowVectorPair &data) const
474{
475 Q_UNUSED(data)
476
477 const RtFiffRawViewModel* t_pModel = static_cast<const RtFiffRawViewModel*>(index.model());
478
479 if(t_pModel->numVLines() > 0)
480 {
481 //vertical lines
482 float distance = float (option.rect.width())/(t_pModel->numVLines()+1);
483
484 float yStart = option.rect.topLeft().y();
485
486 float yEnd = option.rect.bottomRight().y();
487
488 for(qint32 i = 0; i < t_pModel->numVLines(); ++i) {
489 float x = distance*(i+1);
490 path.moveTo(x,yStart);
491 path.lineTo(x,yEnd);
492 }
493 }
494}
495
496//=============================================================================================================
497
498void RtFiffRawViewDelegate::createTimeSpacersPath(const QModelIndex &index, const QStyleOptionViewItem &option, QPainterPath& path, RowVectorPair &data) const
499{
500 Q_UNUSED(data)
501
502 const RtFiffRawViewModel* t_pModel = static_cast<const RtFiffRawViewModel*>(index.model());
503
504 if(t_pModel->getNumberOfTimeSpacers() > 0)
505 {
506 //vertical lines
507 float distanceSec = float (option.rect.width())/(t_pModel->numVLines()+1);
508 float distanceSpacers = distanceSec/(t_pModel->getNumberOfTimeSpacers()+1);
509
510 float yStart = option.rect.topLeft().y();
511
512 float yEnd = option.rect.bottomRight().y();
513
514 for(qint32 t = 0; t < t_pModel->numVLines()+1; ++t) {
515 for(qint32 i = 0; i < t_pModel->getNumberOfTimeSpacers(); ++i) {
516 float x = (distanceSec*t)+(distanceSpacers*(i+1));
517 path.moveTo(x,yStart);
518 path.lineTo(x,yEnd);
519 }
520 }
521 }
522}
523
524//=============================================================================================================
525
526void RtFiffRawViewDelegate::createTriggerPath(QPainter *painter,
527 const QModelIndex &index,
528 const QStyleOptionViewItem &option,
529 QPainterPath& path,
530 RowVectorPair &data) const
531{
532 Q_UNUSED(data)
533 Q_UNUSED(path)
534
535 const RtFiffRawViewModel* t_pModel = static_cast<const RtFiffRawViewModel*>(index.model());
536
537 QList<QPair<int,double> > detectedTriggers = t_pModel->getDetectedTriggers();
538 QList<QPair<int,double> > detectedTriggersOld = t_pModel->getDetectedTriggersOld();
539 QMap<double, QColor> mapTriggerTypeColors = t_pModel->getTriggerColor();
540
541 float yStart = option.rect.topLeft().y();
542 float yEnd = option.rect.bottomRight().y();
543 float dDx = ((float)option.rect.width()) / t_pModel->getMaxSamples();
544
545 int currentSampleIndex = t_pModel->getCurrentSampleIndex();
546
547 //Newly detected triggers
548 for(int u = 0; u < detectedTriggers.size(); ++u) {
549 QPainterPath path;
550
551 int triggerPos = detectedTriggers[u].first;
552
553 painter->save();
554 if(mapTriggerTypeColors.contains(detectedTriggers[u].second)) {
555 painter->setPen(QPen(mapTriggerTypeColors[detectedTriggers[u].second], 1.5, Qt::SolidLine));
556 }
557
558 if(triggerPos <= currentSampleIndex + t_pModel->getCurrentOverlapAddDelay()) {
559 path.moveTo(static_cast<qreal>(triggerPos)*dDx,yStart);
560 path.lineTo(static_cast<qreal>(triggerPos)*dDx,yEnd);
561 }
562
563 painter->drawPath(path);
564 painter->restore();
565 }
566
567 //Old detected triggers
568 for(int u = 0; u < detectedTriggersOld.size(); ++u) {
569 QPainterPath path;
570
571 int triggerPos = detectedTriggersOld[u].first;
572
573 if(triggerPos >= currentSampleIndex + t_pModel->getCurrentOverlapAddDelay()) {
574 painter->save();
575
576 if(mapTriggerTypeColors.contains(detectedTriggersOld[u].second)) {
577 painter->setPen(QPen(mapTriggerTypeColors[detectedTriggersOld[u].second], 1.5, Qt::SolidLine));
578 }
579
580 path.moveTo(static_cast<qreal>(triggerPos)*dDx,yStart);
581 path.lineTo(static_cast<qreal>(triggerPos)*dDx,yEnd);
582
583 painter->drawPath(path);
584 painter->restore();
585 }
586 }
587}
588
589//=============================================================================================================
590
591void RtFiffRawViewDelegate::createTriggerThresholdPath(const QModelIndex &index,
592 const QStyleOptionViewItem &option,
593 QPainterPath& path,
594 RowVectorPair &data,
595 QPointF &textPosition) const
596{
597 Q_UNUSED(data)
598
599 const RtFiffRawViewModel* t_pModel = static_cast<const RtFiffRawViewModel*>(index.model());
600
601 //get maximum range of respective channel type (range value in FiffChInfo does not seem to contain a reasonable value)
602 qint32 kind = t_pModel->getKind(index.row());
603 double dMaxValue = 1e-9f;
604
605 switch(kind) {
606 case FIFFV_STIM_CH: {
607 dMaxValue = 5.0;
608 if(t_pModel->getScaling().contains(FIFFV_STIM_CH))
609 dMaxValue = t_pModel->getScaling()[FIFFV_STIM_CH];
610 break;
611 }
612 }
613
614 double dScaleY = option.rect.height()/(2*dMaxValue);
615 double triggerThreshold = -1*(t_pModel->getTriggerThreshold());
616
617 path.moveTo(option.rect.topLeft().x(), option.rect.topLeft().y()+option.rect.height()/2+dScaleY*triggerThreshold);
618 path.lineTo(option.rect.topRight().x(), option.rect.topLeft().y()+option.rect.height()/2+dScaleY*triggerThreshold);
619
620 textPosition = QPointF(option.rect.topLeft().x()+5, option.rect.topLeft().y()+option.rect.height()/2+dScaleY*triggerThreshold-5);
621}
622
623//=============================================================================================================
624
625void RtFiffRawViewDelegate::createMarkerPath(const QModelIndex &index,
626 const QStyleOptionViewItem &option,
627 QPainterPath& path) const
628{
629 const RtFiffRawViewModel* t_pModel = static_cast<const RtFiffRawViewModel*>(index.model());
630
631 int iOffset = t_pModel->getFirstSampleOffset();
632 int iTimeCursorSample = t_pModel->getCurrentSampleIndex();
633 int iMaxSample = t_pModel->getMaxSamples();
634
635 double dDx = static_cast<double>(option.rect.width()) / static_cast<double>(iMaxSample);
636
637 float yStart = option.rect.topLeft().y();
638 float yEnd = option.rect.bottomRight().y();
639
640 int iEarliestDrawnSample = iOffset - iMaxSample + iTimeCursorSample;
641 int iLatestDrawnSample = iOffset + iTimeCursorSample;
642
643 auto eventSamples = t_pModel->getEventsToDisplay(iEarliestDrawnSample, iLatestDrawnSample);
644
645 for(int iEventSample : eventSamples)
646 {
647 int iLastStartingSample = iOffset - iMaxSample;
648 int iDrawPositionInSamples = (iEventSample - iLastStartingSample) % iMaxSample;
649
650 float iPositionInPixels = static_cast<float>(iDrawPositionInSamples) * dDx;
651
652 path.moveTo(iPositionInPixels,yStart);
653 path.lineTo(iPositionInPixels,yEnd);
654 }
655}
656
657//=============================================================================================================
658
659QPointF RtFiffRawViewDelegate::calcPoint(QPainterPath& path,
660 const double dx,
661 const double y,
662 const double yBase,
663 const double yScale) const
664{
665 double x = path.currentPosition().x() + dx;
666 double yScaled = -((yScale * y) - yBase);//- because y pixels grow downwards.
667
668// qDebug() << " x = " << x;
669// qDebug() << " y = " << yScaled;
670
671 return QPointF(x, yScaled);
672}
673
674//=============================================================================================================
Per-modality vertical-scale spinbox panel (one spin per channel type).
Real-time FIFF raw-data table browser backed by RtFiffRawViewModel + RtFiffRawViewDelegate.
QAbstractItemDelegate painting one FIFF channel's signal trace inside RtFiffRawView.
void createPaths(const QModelIndex &index, const QStyleOptionViewItem &option, QPainterPath &path, QPainterPath &lastPath, QPointF &ellipsePos, QPointF &markerPosition, QString &amplitude, const QVector< float > &data, const QVector< float > &lastData)
Circular-buffer QAbstractTableModel feeding the real-time FIFF raw browser.
#define FIFFV_STIM_CH
2-D display widgets and visualisation helpers (charts, topography, colour maps).
float getScalingValue(const QMap< qint32, float > &qMapChScaling, int iChannelKind, int iChannelUnit)
QPair< const double *, qint32 > RowVectorPair
void setUpperItemIndex(int iUpperItemIndex)
RtFiffRawViewDelegate(RtFiffRawView *parent=0)
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
void initPainterPaths(const QAbstractTableModel *model)
void setSignalColor(const QColor &signalColor)
void markerMoved(QPoint position, int activeRow)
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
Circular-buffer QAbstractTableModel feeding the real-time FIFF raw browser.
double getLastBlockFirstValue(int row) const
const QMap< qint32, float > & getScaling() const
FIFFLIB::fiff_int_t getKind(qint32 row) const
QList< QPair< int, double > > getDetectedTriggers() const
QMap< double, QColor > getTriggerColor() const
FIFFLIB::fiff_int_t getUnit(qint32 row) const
std::vector< int > getEventsToDisplay(int iBegin, int iEnd) const
QList< QPair< int, double > > getDetectedTriggersOld() const
double getMaxValueFromRawViewModel(int row) const
QTableView-based real-time FIFF raw-data browser host.