42 #include "../common/metatreeitem.h"
43 #include "../../3dhelpers/renderable3Dentity.h"
44 #include "../../materials/pervertexphongalphamaterial.h"
45 #include "../../materials/shownormalsmaterial.h"
46 #include "../../3dhelpers/custommesh.h"
65 using namespace DISP3DLIB;
66 using namespace Eigen;
67 using namespace FSLIB;
75 , m_sColorInfoOrigin(
"Color from curvature")
84 this->setToolTip(
"Brain hemisphere surface item");
92 QList<QStandardItem*> list;
104 data.setValue(QColor(50,50,50));
118 data.setValue(QColor(125,125,125));
137 Qt3DRender::QGeometryRenderer::Triangles);
143 data.setValue(matCurvatureColor);
144 this->
setData(data, Data3DTreeModelItemRoles::SurfaceCurrentColorVert);
146 data.setValue(tSurface.
curv());
147 this->
setData(data, Data3DTreeModelItemRoles::SurfaceCurv);
149 data.setValue(tSurface.
rr().rows());
150 this->
setData(data, Data3DTreeModelItemRoles::NumberVertices);
153 QList<QStandardItem*> list;
156 itemSurfFileName->setEditable(
false);
158 list << itemSurfFileName;
159 list <<
new QStandardItem(itemSurfFileName->toolTip());
160 this->appendRow(list);
162 itemSurfFileName->setData(data, MetaTreeItemRoles::SurfaceFileName);
190 const QColor& colSulci,
191 const QColor& colGyri)
193 MatrixX4f colors(curvature.rows(), 4);
195 for(
int i = 0; i < colors.rows(); ++i) {
197 if(curvature(i) >= 0) {
198 colors(i,0) = colSulci.redF();
199 colors(i,1) = colSulci.greenF();
200 colors(i,2) = colSulci.blueF();
201 colors(i,3) = colSulci.alphaF();
203 colors(i,0) = colGyri.redF();
204 colors(i,1) = colGyri.greenF();
205 colors(i,2) = colGyri.blueF();
206 colors(i,3) = colGyri.alphaF();
219 MatrixX4f matNewVertColor;
223 QColor colorSulci =
m_pItemSurfColSulci->data(MetaTreeItemRoles::SurfaceColorSulci).value<QColor>();
224 QColor colorGyri =
m_pItemSurfColGyri->data(MetaTreeItemRoles::SurfaceColorGyri).value<QColor>();
226 matNewVertColor =
createCurvatureVertColor(this->data(Data3DTreeModelItemRoles::SurfaceCurv).value<VectorXf>(), colorSulci, colorGyri);
228 data.setValue(matNewVertColor);
229 this->
setData(data, Data3DTreeModelItemRoles::SurfaceCurrentColorVert);
237 for(
int i = 0; i < this->QStandardItem::parent()->rowCount(); ++i) {
238 if(this->QStandardItem::parent()->child(i,0)->type() == Data3DTreeModelItemTypes::AnnotationItem) {
239 matNewVertColor = this->QStandardItem::parent()->child(i,0)->data(Data3DTreeModelItemRoles::AnnotColors).value<MatrixX4f>();
242 data.setValue(matNewVertColor);
243 this->
setData(data, Data3DTreeModelItemRoles::SurfaceCurrentColorVert);