MNE-CPP 0.1.9
A Framework for Electrophysiology
Loading...
Searching...
No Matches
hemispheretreeitem.cpp
Go to the documentation of this file.
1//=============================================================================================================
36//=============================================================================================================
37// INCLUDES
38//=============================================================================================================
39
40#include "hemispheretreeitem.h"
41#include "../freesurfer/fssurfacetreeitem.h"
42#include "../freesurfer/fsannotationtreeitem.h"
43#include "../sourcespace/sourcespacetreeitem.h"
44#include "../sourcedata/mnedatatreeitem.h"
45
46#include <fs/label.h>
47#include <fs/annotationset.h>
48#include <fs/surfaceset.h>
49
52
53//=============================================================================================================
54// QT INCLUDES
55//=============================================================================================================
56
57//=============================================================================================================
58// EIGEN INCLUDES
59//=============================================================================================================
60
61#include <Eigen/Core>
62
63//=============================================================================================================
64// USED NAMESPACES
65//=============================================================================================================
66
67using namespace Eigen;
68using namespace FSLIB;
69using namespace MNELIB;
70using namespace DISP3DLIB;
71
72//=============================================================================================================
73// DEFINE MEMBER METHODS
74//=============================================================================================================
75
77 const QString& text)
78: AbstractTreeItem(iType, text)
79{
80 initItem();
81}
82
83//=============================================================================================================
84
86{
87 this->setEditable(false);
88 this->setCheckable(true);
89 this->setCheckState(Qt::Checked);
90 this->setToolTip("Brain hemisphere item");
91}
92
93//=============================================================================================================
94
96 const Annotation& tAnnotation,
97 Qt3DCore::QEntity* p3DEntityParent)
98{
99 //Set name of HemisphereTreeItem based on the hemisphere information
100 switch (tSurface.hemi()) {
101 case 0:
102 this->setText("Left hemisphere");
103 break;
104 case 1:
105 this->setText("Right hemisphere");
106 break;
107 default:
108 this->setText("Unknown hemisphere");
109 break;
110 }
111
112 QVariant data;
113 data.setValue(tSurface.hemi());
114
115 this->setData(data, Data3DTreeModelItemRoles::SurfaceHemi);
116
117 //Add childs
118 //Add surface child
119 FsSurfaceTreeItem* pSurfaceItem = new FsSurfaceTreeItem(p3DEntityParent,
120 Data3DTreeModelItemTypes::SurfaceItem, "Surface");
121
122 QList<QStandardItem*> list;
123 list << pSurfaceItem;
124 list << new QStandardItem(pSurfaceItem->toolTip());
125 this->appendRow(list);
126
127 pSurfaceItem->addData(tSurface);
128
129 //Add annotation child
130 if(!tAnnotation.isEmpty()) {
131 FsAnnotationTreeItem* pAnnotItem = new FsAnnotationTreeItem(Data3DTreeModelItemTypes::AnnotationItem);
132
135
136 list.clear();
137 list << pAnnotItem;
138 list << new QStandardItem(pAnnotItem->toolTip());
139 this->appendRow(list);
140
141 pAnnotItem->addData(tSurface, tAnnotation);
142 }
143
144 return pSurfaceItem;
145}
146
147//=============================================================================================================
148
150 Qt3DCore::QEntity* p3DEntityParent)
151{
152 //Set name of HemisphereTreeItem based on the hemisphere information
153 QVariant data;
154
155 switch (tHemisphere.id) {
156 case 101:
157 this->setText("Left hemisphere");
158 data.setValue(0);
159 break;
160 case 102:
161 this->setText("Right hemisphere");
162 data.setValue(1);
163 break;
164 default:
165 this->setText("Unknown hemisphere");
166 data.setValue(-1);
167 break;
168 }
169
170 this->setData(data, Data3DTreeModelItemRoles::SurfaceHemi);
171
172 //Add extra info
173 SourceSpaceTreeItem* pSourceSpaceItem = new SourceSpaceTreeItem(p3DEntityParent, Data3DTreeModelItemTypes::SourceSpaceItem);
174
175 QList<QStandardItem*> list;
176 list << pSourceSpaceItem;
177 list << new QStandardItem(pSourceSpaceItem->toolTip());
178 this->appendRow(list);
179
180 pSourceSpaceItem->addData(tHemisphere);
181
182 return pSourceSpaceItem;
183}
MNEForwardSolution class declaration, which provides the forward solution including the source space ...
MNESourceEstimate class declaration.
Label class declaration.
AnnotationSet class declaration.
SurfaceSet class declaration.
HemisphereTreeItem class declaration.
Provides the basic tree item.
void setData(const QVariant &value, int role=Qt::UserRole+1)
Provides a generic brain tree item.
void annotationVisibiltyChanged(bool isVisible)
void addData(const FSLIB::Surface &tSurface, const FSLIB::Annotation &tAnnotation)
Provides a generic brain tree item.
void addData(const FSLIB::Surface &tSurface)
void onAnnotationVisibilityChanged(bool isVisible)
HemisphereTreeItem(int iType=Data3DTreeModelItemTypes::HemisphereItem, const QString &text="Unknown")
FsSurfaceTreeItem * addData(const FSLIB::Surface &tSurface, const FSLIB::Annotation &tAnnotation, Qt3DCore::QEntity *p3DEntityParent=0)
Provides a generic brain tree item.
void addData(const MNELIB::MNEHemisphere &tHemisphere)
Free surfer annotation.
Definition annotation.h:81
bool isEmpty() const
Definition annotation.h:294
FreeSurfer surface mesh.
Definition surface.h:76
qint32 hemi() const
Definition surface.h:301
Hemisphere provides geometry information.
FIFFLIB::fiff_int_t id