32: QStandardItemModel(parent)
35 setHorizontalHeaderLabels(QStringList() <<
"Data" <<
"Description");
40 QStandardItem* subjectItem = getSubjectItem(subject);
43 QStandardItem* hemiItem =
nullptr;
44 for (
int i = 0; i < subjectItem->rowCount(); ++i) {
45 if (subjectItem->child(i)->text() == hemi) {
46 hemiItem = subjectItem->child(i);
52 hemiItem =
new QStandardItem(hemi);
53 subjectItem->appendRow(hemiItem);
60 hemiItem->appendRow(surfItem);
66 QStandardItem* subjectItem = getSubjectItem(subject);
70 QStandardItem* hemiItem =
nullptr;
71 for (
int i = 0; i < subjectItem->rowCount(); ++i) {
72 if (subjectItem->child(i)->text() == hemi) {
73 hemiItem = subjectItem->child(i);
85 for (
int i = 0; i < hemiItem->rowCount(); ++i) {
95QStandardItem* BrainTreeModel::getSubjectItem(
const QString& subject)
98 QList<QStandardItem*> items = findItems(subject);
99 if (!items.isEmpty()) {
100 return items.first();
104 QStandardItem* item =
new QStandardItem(subject);
111 QStandardItem* subjItem = getSubjectItem(subject);
122 if (bemSurf.
id == 4) {
123 bemItem->
setColor(QColor(128, 77, 77));
124 }
else if (bemSurf.
id == 3) {
125 bemItem->
setColor(QColor(77, 128, 77));
126 }
else if (bemSurf.
id == 1) {
127 bemItem->
setColor(QColor(77, 77, 128));
129 bemItem->
setColor(QColor(100, 100, 100));
132 subjItem->appendRow(bemItem);
141 QStandardItem* parentItem =
new QStandardItem(type);
142 parentItem->setCheckable(
true);
143 parentItem->setCheckState(Qt::Checked);
145 for (
auto* item : items) {
146 parentItem->appendRow(item);
149 this->appendRow(parentItem);
157 item->setCheckable(
true);
158 item->setCheckState(Qt::Checked);
159 this->appendRow(item);
166 QStandardItem* parentItem =
new QStandardItem(
"Source Space");
167 parentItem->setCheckable(
true);
168 parentItem->setCheckState(Qt::Checked);
171 QColor srcColor(212, 28, 92);
173 for (
int h = 0; h < srcSpace.
size(); ++h) {
174 const auto& hemi = srcSpace[h];
175 QString hemiLabel = (h == 0) ?
"LH" :
"RH";
178 QVector<QVector3D> positions;
179 positions.reserve(hemi.vertno.size());
180 for (
int i = 0; i < hemi.vertno.size(); ++i) {
181 int vIdx = hemi.vertno(i);
182 if (vIdx < 0 || vIdx >= hemi.rr.rows())
184 positions.append(QVector3D(hemi.rr(vIdx, 0), hemi.rr(vIdx, 1), hemi.rr(vIdx, 2)));
189 qDebug() <<
"BrainTreeModel: Source space" << hemiLabel
190 <<
"- points:" << positions.size()
191 <<
"coord_frame:" << hemi.coord_frame;
192 if (!positions.isEmpty()) {
193 qDebug() <<
" First point:" << positions.first()
194 <<
" Last point:" << positions.last();
198 this->appendRow(parentItem);
205 if (digitizerPoints.isEmpty())
209 this->appendRow(setItem);
211 qInfo() <<
"BrainTreeModel: Added digitizer set with"
212 << setItem->totalPointCount() <<
"points in"
213 << setItem->rowCount() <<
"categories";
220 QString displayName = name;
221 if (displayName.isEmpty()) {
223 if (displayName.isEmpty())
224 displayName =
"Network";
227 QString objectKey =
"net_" + displayName.toLower().replace(
" ",
"_");
230 item->setCheckable(
true);
231 item->setCheckState(Qt::Checked);
233 this->appendRow(item);
235 qDebug() <<
"BrainTreeModel: Added network" << displayName
236 <<
"with" << network.
getNodes().size() <<
"nodes and"
QStandardItemModel hierarchy that organises every 3-D scene object (surfaces, sensors,...
Tree item wrapping a fitted INVLIB::InvEcdSet of equivalent current dipoles.
Tree item identifying a connectivity network rendered as instanced nodes and edges.
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.
Container item that groups raw FIFF digitizer points by category (Cardinal, HPI, EEG,...
Tree item wrapping a FreeSurfer FSLIB::FsSurface plus optional FSLIB::FsAnnotation parcellation.
Tree item holding one hemisphere of source-space dipole positions rendered as batched spheres.
Ordered set of INVLIB::InvEcd records — the result of a sequential dipole-fit run.
Per-hemisphere cortical surface bundle with decimation, patch info and rendering buffers.
3-D brain visualisation using the Qt RHI rendering backend.
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
SurfaceTreeItem * addSurface(const QString &subject, const QString &hemi, const QString &surfType, const FSLIB::FsSurface &surface)
void addSensors(const QString &type, const QList< QStandardItem * > &items)
NetworkTreeItem * addNetwork(const CONNECTIVITYLIB::Network &network, const QString &name="Network")
BemTreeItem * addBemSurface(const QString &subject, const QString &bemName, const MNELIB::MNEBemSurface &bemSurf)
void addDipoles(const INVLIB::InvEcdSet &set)
void addSourceSpace(const MNELIB::MNESourceSpaces &srcSpace)
void addDigitizerData(const QList< FIFFLIB::FiffDigPoint > &digitizerPoints)
bool addAnnotation(const QString &subject, const QString &hemi, const FSLIB::FsAnnotation &annotation)
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 setAnnotationData(const FSLIB::FsAnnotation &annotation)
void setSurfaceData(const FSLIB::FsSurface &surface)
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.