103 const QString &sSensorType,
104 Qt3DCore::QEntity* p3DEntityParent)
107 qDebug(
"SensorDataTreeItem::initData - Item is already initialized");
110 this->
setData(0, Data3DTreeModelItemRoles::Data);
113 fiff_int_t sensorTypeFiffConstant;
114 if (sSensorType.toStdString() ==
"MEG") {
115 sensorTypeFiffConstant = FIFFV_MEG_CH;
116 }
else if (sSensorType.toStdString() ==
"EEG") {
117 sensorTypeFiffConstant = FIFFV_EEG_CH;
119 qDebug() <<
"SensorDataTreeItem::initData - unknown sensor type. Returning ...";
125 QVector<Vector3f> vecSensorPos;
129 if(info.kind == sensorTypeFiffConstant &&
130 (info.unit == FIFF_UNIT_T || info.unit == FIFF_UNIT_V)) {
131 vecSensorPos.push_back(info.chpos.r0);
140 for(
const QString &bad : fiffInfo.
bads) {
148 Data3DTreeModelItemTypes::GpuInterpolationItem,
149 QStringLiteral(
"3D Plot"));
155 QList<QStandardItem*> list;
158 this->appendRow(list);
171 Data3DTreeModelItemTypes::AbstractMeshItem,
172 QStringLiteral(
"3D Plot"));
181 Qt3DRender::QGeometryRenderer::Triangles);
183 QList<QStandardItem*> list;
186 this->appendRow(list);
202 sensorTypeFiffConstant);
213 qDebug() <<
"SensorDataTreeItem::addData - item has not been initialized yet!";
219 if(tSensorData.rows() > iSensorSize)
221 MatrixXd dSmallSensorData(iSensorSize, tSensorData.cols());
222 for(
int i = 0 ; i < iSensorSize; ++i)
226 dSmallSensorData.row(i).setZero();
233 data.setValue(dSmallSensorData);
234 this->
setData(data, Data3DTreeModelItemRoles::Data);
242 MatrixXd dSmallSensorData = tSensorData;
243 for(
int i = 0 ; i < dSmallSensorData.rows(); ++i)
246 dSmallSensorData.row(i).setZero();
252 data.setValue(dSmallSensorData);
253 this->
setData(data, Data3DTreeModelItemRoles::Data);
344 QList<QStandardItem*> lItems = this->
findChildren(MetaTreeItemTypes::DataThreshold);
346 for(
int i = 0; i < lItems.size(); i++) {
349 data.setValue(vecThresholds);
350 pAbstractItem->setData(data, MetaTreeItemRoles::DataThreshold);
352 QString sTemp = QString(
"%1,%2,%3").arg(vecThresholds.x()).arg(vecThresholds.y()).arg(vecThresholds.z());
353 data.setValue(sTemp);
354 pAbstractItem->setData(data, Qt::DisplayRole);
379 QList<QStandardItem*> lItems = this->
findChildren(MetaTreeItemTypes::InterpolationFunction);
381 for(
int i = 0; i < lItems.size(); i++) {
384 data.setValue(sInterpolationFunction);
385 pAbstractItem->setData(data, MetaTreeItemRoles::InterpolationFunction);
386 pAbstractItem->setData(data, Qt::DisplayRole);
472 this->setEditable(
false);
473 this->setCheckable(
true);
474 this->setCheckState(Qt::Checked);
475 this->setToolTip(
"Sensor Data item");
478 QList<QStandardItem*> list;
482 list << pItemStreamStatus;
483 list <<
new QStandardItem(pItemStreamStatus->toolTip());
484 this->appendRow(list);
485 pItemStreamStatus->setCheckable(
true);
486 pItemStreamStatus->setEditable(
false);
487 pItemStreamStatus->setCheckState(Qt::Unchecked);
491 data.setValue(
false);
492 pItemStreamStatus->
setData(data, MetaTreeItemRoles::StreamStatus);
496 list << pItemColormapType;
497 list <<
new QStandardItem(pItemColormapType->toolTip());
498 this->appendRow(list);
499 data.setValue(QString(
"Hot"));
500 pItemColormapType->
setData(data, MetaTreeItemRoles::ColormapType);
506 list << pItemThreshold;
507 list <<
new QStandardItem(pItemThreshold->toolTip());
508 this->appendRow(list);
509 data.setValue(QVector3D(0.0,5.5,15));
510 pItemThreshold->
setData(data, MetaTreeItemRoles::DataThreshold);
516 list << pItemStreamingInterval;
517 list <<
new QStandardItem(pItemStreamingInterval->toolTip());
518 this->appendRow(list);
520 pItemStreamingInterval->
setData(data, MetaTreeItemRoles::StreamingTimeInterval);
525 pItemLoopedStreaming->setCheckable(
true);
526 pItemLoopedStreaming->setCheckState(Qt::Checked);
528 list << pItemLoopedStreaming;
529 list <<
new QStandardItem(pItemLoopedStreaming->toolTip());
530 this->appendRow(list);
536 list << pItemAveragedStreaming;
537 list <<
new QStandardItem(pItemAveragedStreaming->toolTip());
538 this->appendRow(list);
540 pItemAveragedStreaming->
setData(data, MetaTreeItemRoles::NumberAverages);
546 list << pItemCancelDistance;
547 list <<
new QStandardItem(pItemCancelDistance->toolTip());
548 this->appendRow(list);
550 pItemCancelDistance->
setData(data, MetaTreeItemRoles::CancelDistance);
556 list << pInterpolationFunction;
557 list <<
new QStandardItem(pInterpolationFunction->toolTip());
558 this->appendRow(list);
559 data.setValue(QString(
"Cubic"));
560 pInterpolationFunction->
setData(data, MetaTreeItemRoles::InterpolationFunction);