29 : QStandardItemModel(parent)
32 setHorizontalHeaderLabels(QStringList() <<
"Data" <<
"Description");
37 QStandardItem* subjectItem = getSubjectItem(subject);
40 QStandardItem* hemiItem =
nullptr;
41 for(
int i = 0; i < subjectItem->rowCount(); ++i) {
42 if (subjectItem->child(i)->text() == hemi) {
43 hemiItem = subjectItem->child(i);
49 hemiItem =
new QStandardItem(hemi);
50 subjectItem->appendRow(hemiItem);
57 hemiItem->appendRow(surfItem);
63 QStandardItem* subjectItem = getSubjectItem(subject);
64 if (!subjectItem)
return false;
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);
74 if (!hemiItem)
return false;
80 for(
int i = 0; i < hemiItem->rowCount(); ++i) {
90QStandardItem* BrainTreeModel::getSubjectItem(
const QString &subject)
93 QList<QStandardItem*> items = findItems(subject);
94 if (!items.isEmpty()) {
99 QStandardItem* item =
new QStandardItem(subject);
106 QStandardItem *subjItem = getSubjectItem(subject);
117 if (bemSurf.
id == 4) {
118 bemItem->
setColor(QColor(128, 77, 77));
119 }
else if (bemSurf.
id == 3) {
120 bemItem->
setColor(QColor(77, 128, 77));
121 }
else if (bemSurf.
id == 1) {
122 bemItem->
setColor(QColor(77, 77, 128));
124 bemItem->
setColor(QColor(100, 100, 100));
127 subjItem->appendRow(bemItem);
136 QStandardItem* parentItem =
new QStandardItem(type);
137 parentItem->setCheckable(
true);
138 parentItem->setCheckState(Qt::Checked);
140 for(
auto* item : items) {
141 parentItem->appendRow(item);
144 this->appendRow(parentItem);
152 item->setCheckable(
true);
153 item->setCheckState(Qt::Checked);
154 this->appendRow(item);
161 QStandardItem* parentItem =
new QStandardItem(
"Source Space");
162 parentItem->setCheckable(
true);
163 parentItem->setCheckState(Qt::Checked);
166 QColor srcColor(212, 28, 92);
168 for (
int h = 0; h < srcSpace.
size(); ++h) {
169 const auto &hemi = srcSpace[h];
170 QString hemiLabel = (h == 0) ?
"LH" :
"RH";
173 QVector<QVector3D> positions;
174 positions.reserve(hemi.vertno.size());
175 for (
int i = 0; i < hemi.vertno.size(); ++i) {
176 int vIdx = hemi.vertno(i);
177 if (vIdx < 0 || vIdx >= hemi.rr.rows())
continue;
178 positions.append(QVector3D(hemi.rr(vIdx, 0), hemi.rr(vIdx, 1), hemi.rr(vIdx, 2)));
183 qDebug() <<
"BrainTreeModel: Source space" << hemiLabel
184 <<
"- points:" << positions.size()
185 <<
"coord_frame:" << hemi.coord_frame;
186 if (!positions.isEmpty()) {
187 qDebug() <<
" First point:" << positions.first()
188 <<
" Last point:" << positions.last();
192 this->appendRow(parentItem);
199 if (digitizerPoints.isEmpty())
return;
202 this->appendRow(setItem);
204 qInfo() <<
"BrainTreeModel: Added digitizer set with"
205 << setItem->totalPointCount() <<
"points in"
206 << setItem->rowCount() <<
"categories";
213 QString displayName = name;
214 if (displayName.isEmpty()) {
216 if (displayName.isEmpty()) displayName =
"Network";
219 QString objectKey =
"net_" + displayName.toLower().replace(
" ",
"_");
222 item->setCheckable(
true);
223 item->setCheckState(Qt::Checked);
225 this->appendRow(item);
227 qDebug() <<
"BrainTreeModel: Added network" << displayName
228 <<
"with" << network.
getNodes().size() <<
"nodes and"
Tree item wrapping a fitted INVLIB::InvEcdSet of equivalent current dipoles.
Tree item holding one hemisphere of source-space dipole positions rendered as batched spheres.
Tree item identifying a connectivity network rendered as instanced nodes and edges.
Container item that groups raw FIFF digitizer points by category (Cardinal, HPI, EEG,...
Tree item wrapping a single MNELIB::MNEBemSurface (brain / inner-skull / outer-skull / scalp shell).
Tree item for a single MEG / EEG sensor with position, optional coil orientation and rendered scale.
Tree item wrapping a FreeSurfer FSLIB::FsSurface plus optional FSLIB::FsAnnotation parcellation.
QStandardItemModel hierarchy that organises every 3-D scene object (surfaces, sensors,...
Per-hemisphere cortical surface bundle with decimation, patch info and rendering buffers.
Ordered set of INVLIB::InvEcd records — the result of a sequential dipole-fit run.
Graph container for one connectivity metric; nodes + weighted edges + threshold/visualisation state.
QString getConnectivityMethod() const
const QList< QSharedPointer< NetworkNode > > & getNodes() const
const QList< QSharedPointer< NetworkEdge > > & getFullEdges() const
void addDipoles(const INVLIB::InvEcdSet &set)
SurfaceTreeItem * addSurface(const QString &subject, const QString &hemi, const QString &surfType, const FSLIB::FsSurface &surface)
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")
bool addAnnotation(const QString &subject, const QString &hemi, const FSLIB::FsAnnotation &annotation)
void addSourceSpace(const MNELIB::MNESourceSpaces &srcSpace)
BrainTreeModel(QObject *parent=nullptr)
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::FsSurface &surface)
void setAnnotationData(const FSLIB::FsAnnotation &annotation)
Single-hemisphere FreeSurfer parcellation: vertex → region label plus embedded colortable.
In-memory FreeSurfer triangular cortical surface for one hemisphere.
Holds a set of Electric Current Dipoles.
BEM surface provides geometry information.
List of MNESourceSpace objects forming a subject source space.