141 if (verts.contains(p_matTris(i, 0)) || verts.contains(p_matTris(i, 1)) || verts.contains(p_matTris(i, 2))) {
158 if (p_sFileName.mid(p_sFileName.size() - 6, 6).compare(
".label") != 0) {
159 qWarning(
"Given file (%s) is not a .label file!\n", p_sFileName.toUtf8().constData());
163 qInfo(
"Reading label...");
164 QFile t_File(p_sFileName);
166 if (!t_File.open(QIODevice::ReadOnly | QIODevice::Text)) {
167 qWarning(
"\tError: Couldn't open the label file\n");
171 QTextStream t_TextStream(&t_File);
173 QString
comment = t_TextStream.readLine();
174 qint32 nv = t_TextStream.readLine().toInt();
176 MatrixXd data(nv, 5);
182 for (qint32 i = 0; i < nv; ++i) {
185#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
186 auto skip = QString::SkipEmptyParts;
188 auto skip = Qt::SkipEmptyParts;
191 list = t_TextStream.readLine().split(QRegularExpression(
"\\s+"), skip);
193 for (qint32 j = 0; j < list.size(); ++j) {
194 value = list[j].toDouble(&isNumber);
196 data(i, count) = value;
203 if (t_File.fileName().contains(
"lh."))
212 p_Label.
vertices = data.cast<
int>().block(0, 0, data.rows(), 1);
213 p_Label.
pos = data.cast<
float>().block(0, 1, data.rows(), 3).array() * 1e-3f;
214 p_Label.
values = data.block(0, 4, data.rows(), 1);
216 if (t_File.fileName().contains(
"lh.label")) {
217 QStringList tmpList = t_File.fileName().split(
"lh.")[0].split(QRegularExpression(
"\\W+"));
218 p_Label.
name = tmpList[tmpList.size() - 1];
219 }
else if (t_File.fileName().contains(
"lh."))
220 p_Label.
name = t_File.fileName().split(
"lh.")[1].split(QRegularExpression(
"\\W+"))[0];