本文整理汇总了C++中Annotation::filePath方法的典型用法代码示例。如果您正苦于以下问题:C++ Annotation::filePath方法的具体用法?C++ Annotation::filePath怎么用?C++ Annotation::filePath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Annotation
的用法示例。
在下文中一共展示了Annotation::filePath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addData
bool BrainAnnotationTreeItem::addData(const Surface& tSurface, const Annotation& tAnnotation)
{
//Create color from annotation data if annotation is not empty
if(!tAnnotation.isEmpty()) {
QByteArray arrayColorsAnnot;
arrayColorsAnnot.resize(tAnnotation.getVertices().rows() * 3 * (int)sizeof(float));
float *rawArrayColors = reinterpret_cast<float *>(arrayColorsAnnot.data());
QList<FSLIB::Label> qListLabels;
QList<RowVector4i> qListLabelRGBAs;
tAnnotation.toLabels(tSurface, qListLabels, qListLabelRGBAs);
for(int i = 0; i<qListLabels.size(); i++) {
FSLIB::Label label = qListLabels.at(i);
for(int j = 0; j<label.vertices.rows(); j++) {
rawArrayColors[label.vertices(j)*3+0] = qListLabelRGBAs.at(i)(0)/255.0;
rawArrayColors[label.vertices(j)*3+1] = qListLabelRGBAs.at(i)(1)/255.0;
rawArrayColors[label.vertices(j)*3+2] = qListLabelRGBAs.at(i)(2)/255.0;
}
}
//Add data which is held by this BrainAnnotationTreeItem
QVariant data;
data.setValue(arrayColorsAnnot);
this->setData(data, BrainAnnotationTreeItemRoles::AnnotColors);
data.setValue(qListLabels);
this->setData(data, BrainAnnotationTreeItemRoles::LabeList);
data.setValue(tAnnotation.getLabelIds());
this->setData(data, BrainAnnotationTreeItemRoles::LabeIds);
//Add annotation meta information as item children
BrainTreeMetaItem *itemAnnotFileName = new BrainTreeMetaItem(BrainTreeMetaItemTypes::AnnotFileName, tAnnotation.fileName());
itemAnnotFileName->setEditable(false);
*this<<itemAnnotFileName;
data.setValue(tAnnotation.fileName());
itemAnnotFileName->setData(data, BrainAnnotationTreeItemRoles::AnnotFileName);
BrainTreeMetaItem *itemAnnotPath = new BrainTreeMetaItem(BrainTreeMetaItemTypes::AnnotFilePath, tAnnotation.filePath());
itemAnnotPath->setEditable(false);
*this<<itemAnnotPath;
data.setValue(tAnnotation.filePath());
itemAnnotFileName->setData(data, BrainAnnotationTreeItemRoles::AnnotFilePath);
}
return true;
}