55 : QStandardItemModel(parent)
58 setHorizontalHeaderLabels(QStringList() <<
"Data" <<
"Description");
63 QStandardItem* subjectItem = getSubjectItem(subject);
66 QStandardItem* hemiItem =
nullptr;
67 for(
int i = 0; i < subjectItem->rowCount(); ++i) {
68 if (subjectItem->child(i)->text() == hemi) {
69 hemiItem = subjectItem->child(i);
75 hemiItem =
new QStandardItem(hemi);
76 subjectItem->appendRow(hemiItem);
83 hemiItem->appendRow(surfItem);
89 QStandardItem* subjectItem = getSubjectItem(subject);
90 if (!subjectItem)
return false;
92 QStandardItem* hemiItem =
nullptr;
93 for(
int i = 0; i < subjectItem->rowCount(); ++i) {
94 if (subjectItem->child(i)->text() == hemi) {
95 hemiItem = subjectItem->child(i);
100 if (!hemiItem)
return false;
105 bool applied =
false;
106 for(
int i = 0; i < hemiItem->rowCount(); ++i) {
116QStandardItem* BrainTreeModel::getSubjectItem(
const QString &subject)
119 QList<QStandardItem*> items = findItems(subject);
120 if (!items.isEmpty()) {
121 return items.first();
125 QStandardItem* item =
new QStandardItem(subject);
132 QStandardItem *subjItem = getSubjectItem(subject);
143 if (bemSurf.
id == 4) {
144 bemItem->
setColor(QColor(128, 77, 77));
145 }
else if (bemSurf.
id == 3) {
146 bemItem->
setColor(QColor(77, 128, 77));
147 }
else if (bemSurf.
id == 1) {
148 bemItem->
setColor(QColor(77, 77, 128));
150 bemItem->
setColor(QColor(100, 100, 100));
153 subjItem->appendRow(bemItem);
162 QStandardItem* parentItem =
new QStandardItem(type);
163 parentItem->setCheckable(
true);
164 parentItem->setCheckState(Qt::Checked);
166 for(
auto* item : items) {
167 parentItem->appendRow(item);
170 this->appendRow(parentItem);
178 item->setCheckable(
true);
179 item->setCheckState(Qt::Checked);
180 this->appendRow(item);
187 QStandardItem* parentItem =
new QStandardItem(
"Source Space");
188 parentItem->setCheckable(
true);
189 parentItem->setCheckState(Qt::Checked);
192 QColor srcColor(212, 28, 92);
194 for (
int h = 0; h < srcSpace.
size(); ++h) {
195 const auto &hemi = srcSpace[h];
196 QString hemiLabel = (h == 0) ?
"LH" :
"RH";
199 QVector<QVector3D> positions;
200 positions.reserve(hemi.vertno.size());
201 for (
int i = 0; i < hemi.vertno.size(); ++i) {
202 int vIdx = hemi.vertno(i);
203 if (vIdx < 0 || vIdx >= hemi.rr.rows())
continue;
204 positions.append(QVector3D(hemi.rr(vIdx, 0), hemi.rr(vIdx, 1), hemi.rr(vIdx, 2)));
209 qDebug() <<
"BrainTreeModel: Source space" << hemiLabel
210 <<
"- points:" << positions.size()
211 <<
"coord_frame:" << hemi.coord_frame;
212 if (!positions.isEmpty()) {
213 qDebug() <<
" First point:" << positions.first()
214 <<
" Last point:" << positions.last();
218 this->appendRow(parentItem);
225 if (digitizerPoints.isEmpty())
return;
228 this->appendRow(setItem);
230 qDebug() <<
"BrainTreeModel: Added digitizer set with"
231 << setItem->totalPointCount() <<
"points in"
232 << setItem->rowCount() <<
"categories";
239 QString displayName = name;
240 if (displayName.isEmpty()) {
242 if (displayName.isEmpty()) displayName =
"Network";
245 QString objectKey =
"net_" + displayName.toLower().replace(
" ",
"_");
248 item->setCheckable(
true);
249 item->setCheckState(Qt::Checked);
251 this->appendRow(item);
253 qDebug() <<
"BrainTreeModel: Added network" << displayName
254 <<
"with" << network.
getNodes().size() <<
"nodes and"
BrainTreeModel class declaration.
SurfaceTreeItem class declaration.
NetworkTreeItem class declaration.
BemTreeItem class declaration.
SourceSpaceTreeItem class declaration.
DipoleTreeItem class declaration.
DigitizerSetTreeItem class declaration.
SensorTreeItem class declaration.
MNEHemisphere class declaration.
FiffDigPointSet class declaration.
This class holds information about a network, can compute a distance table and provide network metric...
QString getConnectivityMethod() const
const QList< QSharedPointer< NetworkNode > > & getNodes() const
const QList< QSharedPointer< NetworkEdge > > & getFullEdges() const
BemTreeItem * addBemSurface(const QString &subject, const QString &bemName, const MNELIB::MNEBemSurface &bemSurf)
void addDigitizerData(const QList< FIFFLIB::FiffDigPoint > &digitizerPoints)
void addSensors(const QString &type, const QList< QStandardItem * > &items)
NetworkTreeItem * addNetwork(const CONNECTIVITYLIB::Network &network, const QString &name="Network")
SurfaceTreeItem * addSurface(const QString &subject, const QString &hemi, const QString &surfType, const FSLIB::Surface &surface)
void addSourceSpace(const MNELIB::MNESourceSpaces &srcSpace)
void addDipoles(const INVERSELIB::ECDSet &set)
BrainTreeModel(QObject *parent=nullptr)
bool addAnnotation(const QString &subject, const QString &hemi, const FSLIB::Annotation &annotation)
void setColor(const QColor &color)
void setVisible(bool visible)
Tree item representing a BEM surface layer in the 3-D scene hierarchy.
Digitizer point set container tree item.
Tree item representing a set of fitted dipoles in the 3-D scene hierarchy.
Tree item representing a connectivity network.
Source space point tree item.
Tree item representing a FreeSurfer cortical surface in the 3-D scene hierarchy.
void setSurfaceData(const FSLIB::Surface &surface)
void setAnnotationData(const FSLIB::Annotation &annotation)
Holds a set of Electric Current Dipoles.
BEM surface provides geometry information.
Source Space descritpion.