示例#1
0
bool BemTreeItem::addData(const MNEBem &tBem, Qt3DCore::QEntity* p3DEntityParent)
{
    //Generate child items based on BEM input parameters
    bool state = false;

    for(int i = 0; i < tBem.size(); ++i) {
        QString sBemSurfName;
        sBemSurfName = QString("%1").arg(tBem[i].id);
        BemSurfaceTreeItem* pSurfItem = new BemSurfaceTreeItem(Data3DTreeModelItemTypes::BemSurfaceItem, sBemSurfName);
        pSurfItem->addData(tBem[i], p3DEntityParent);

        QList<QStandardItem*> list;
        list << pSurfItem;
        list << new QStandardItem(pSurfItem->toolTip());
        this->appendRow(list);
    }

    return state;
}
示例#2
0
void SensorSetTreeItem::addData(const MNEBem &tSensor,
                                const QList<FiffChInfo>& lChInfo,
                                const QString& sDataType,
                                const QStringList& bads,
                                Qt3DCore::QEntity* p3DEntityParent)
{
    //Generate sensor surfaces as childs
    for(int i = 0; i < tSensor.size(); ++i) {
        SensorSurfaceTreeItem* pSurfItem = new SensorSurfaceTreeItem(p3DEntityParent, Data3DTreeModelItemTypes::SensorSurfaceItem);
        pSurfItem->addData(tSensor[i]);

        QList<QStandardItem*> list;
        list << pSurfItem;
        list << new QStandardItem(pSurfItem->toolTip());
        this->appendRow(list);
    }

    //Sort MEG channel types
    QList<FiffChInfo> lChInfoGrad;
    QList<FiffChInfo> lChInfoMag;
    QList<FiffChInfo> lChInfoEEG;

    for(int i = 0; i < lChInfo.size(); ++i) {
        if(lChInfo.at(i).unit == FIFF_UNIT_T_M) {
            lChInfoGrad << lChInfo.at(i);
        } else if(lChInfo.at(i).unit == FIFF_UNIT_T) {
            lChInfoMag << lChInfo.at(i);
        } else if(lChInfo.at(i).kind == FIFFV_EEG_CH) {
            lChInfoEEG << lChInfo.at(i);
        }
    }

    //Add sensor locations as child items
    if(!lChInfoGrad.isEmpty() && sDataType == "MEG") {
        SensorPositionTreeItem* pSensorPosItem = new SensorPositionTreeItem(p3DEntityParent, Data3DTreeModelItemTypes::SensorPositionItem, "Grad");
        pSensorPosItem->addData(lChInfoGrad, "MEG", bads);

        QList<QStandardItem*> list;
        list << pSensorPosItem;
        list << new QStandardItem(pSensorPosItem->toolTip());
        this->appendRow(list);
    }

    if(!lChInfoMag.isEmpty() && sDataType == "MEG") {
        SensorPositionTreeItem* pSensorPosItem = new SensorPositionTreeItem(p3DEntityParent, Data3DTreeModelItemTypes::SensorPositionItem, "Mag");
        pSensorPosItem->addData(lChInfoMag, "MEG", bads);

        QList<QStandardItem*> list;
        list << pSensorPosItem;
        list << new QStandardItem(pSensorPosItem->toolTip());
        this->appendRow(list);
    }

    if(!lChInfoEEG.isEmpty() && sDataType == "EEG") {
        SensorPositionTreeItem* pSensorPosItem = new SensorPositionTreeItem(p3DEntityParent, Data3DTreeModelItemTypes::SensorPositionItem, "EEG");
        pSensorPosItem->addData(lChInfoEEG, "EEG", bads);

        QList<QStandardItem*> list;
        list << pSensorPosItem;
        list << new QStandardItem(pSensorPosItem->toolTip());
        this->appendRow(list);
    }
}