40 #include "../common/metatreeitem.h"
58 using namespace DISP3DLIB;
59 using namespace FSLIB;
60 using namespace Eigen;
76 this->setEditable(
false);
77 this->setCheckable(
true);
78 this->setCheckState(Qt::Unchecked);
79 this->setToolTip(
"Freesurfer annotation item");
88 MatrixX4f matAnnotColors(tAnnotation.
getVertices().rows(), 4);
90 QList<FSLIB::Label> qListLabels;
91 QList<RowVector4i> qListLabelRGBAs;
93 tAnnotation.
toLabels(tSurface, qListLabels, qListLabelRGBAs);
95 for(
int i = 0; i < qListLabels.size(); ++i) {
97 for(
int j = 0; j<label.
vertices.rows(); j++) {
99 patchColor.setRed(qListLabelRGBAs.at(i)(0));
100 patchColor.setGreen(qListLabelRGBAs.at(i)(1));
101 patchColor.setBlue(qListLabelRGBAs.at(i)(2));
103 patchColor = patchColor.darker(200);
105 if(label.
vertices(j) < matAnnotColors.rows()) {
106 matAnnotColors(label.
vertices(j),0) = patchColor.redF();
107 matAnnotColors(label.
vertices(j),1) = patchColor.greenF();
108 matAnnotColors(label.
vertices(j),2) = patchColor.blueF();
109 matAnnotColors(label.
vertices(j),3) = patchColor.alphaF();
116 data.setValue(matAnnotColors);
117 this->
setData(data, Data3DTreeModelItemRoles::AnnotColors);
120 QList<QStandardItem*> list;
123 itemAnnotFileName->setEditable(
false);
124 list << itemAnnotFileName;
125 list <<
new QStandardItem(itemAnnotFileName->toolTip());
126 this->appendRow(list);
127 data.setValue(tAnnotation.
fileName());
128 itemAnnotFileName->setData(data, Data3DTreeModelItemRoles::FileName);
132 itemAnnotPath->setEditable(
false);
133 list << itemAnnotPath;
134 list <<
new QStandardItem(itemAnnotPath->toolTip());
135 this->appendRow(list);
136 data.setValue(tAnnotation.
filePath());
137 itemAnnotFileName->setData(data, Data3DTreeModelItemRoles::FilePath);