53 const QString &rhPath,
61 , m_lhSurface(lhSurface)
62 , m_rhSurface(rhSurface)
63 , m_cancelDist(cancelDist)
77 emit
progress(0,
"Loading STC files...");
80 if (!m_lhPath.isEmpty()) {
86 qDebug() <<
"StcLoadingWorker: Loaded LH with" << stc.
data.rows() <<
"vertices,"
87 << stc.
data.cols() <<
"time points";
89 emit
error(QString(
"Failed to read LH STC file: %1").arg(m_lhPath));
93 emit
progress(5,
"Loading RH STC file...");
96 if (!m_rhPath.isEmpty()) {
102 qDebug() <<
"StcLoadingWorker: Loaded RH with" << stc.
data.rows() <<
"vertices,"
103 << stc.
data.cols() <<
"time points";
105 emit
error(QString(
"Failed to read RH STC file: %1").arg(m_rhPath));
109 if (!m_hasLh && !m_hasRh) {
110 emit
error(
"No STC data could be loaded.");
116 if (m_hasLh && m_lhSurface) {
117 emit
progress(10,
"Computing LH interpolation matrix...");
119 Eigen::MatrixX3f matVertices = m_lhSurface->verticesAsMatrix();
120 std::vector<Eigen::VectorXi> vecNeighbors = m_lhSurface->computeNeighbors();
122 Eigen::VectorXi vecSourceVertices = m_stcLh.vertices;
124 qDebug() <<
"StcLoadingWorker: LH surface has" << matVertices.rows() <<
"vertices,"
125 << vecSourceVertices.size() <<
"sources";
127 if (vecSourceVertices.size() > 0) {
129 emit
progress(15,
"Computing LH geodesic distances (SCDC)...");
137 if (distTable && distTable->rows() > 0) {
138 emit
progress(35,
"Creating LH interpolation matrix...");
146 if (m_interpMatLh && m_interpMatLh->rows() > 0) {
147 qDebug() <<
"StcLoadingWorker: LH interpolation matrix created:"
148 << m_interpMatLh->rows() <<
"x" << m_interpMatLh->cols();
155 if (m_hasRh && m_rhSurface) {
156 emit
progress(50,
"Computing RH interpolation matrix...");
158 Eigen::MatrixX3f matVertices = m_rhSurface->verticesAsMatrix();
159 std::vector<Eigen::VectorXi> vecNeighbors = m_rhSurface->computeNeighbors();
161 Eigen::VectorXi vecSourceVertices = m_stcRh.vertices;
163 qDebug() <<
"StcLoadingWorker: RH surface has" << matVertices.rows() <<
"vertices,"
164 << vecSourceVertices.size() <<
"sources";
166 if (vecSourceVertices.size() > 0) {
168 emit
progress(55,
"Computing RH geodesic distances (SCDC)...");
176 if (distTable && distTable->rows() > 0) {
177 emit
progress(75,
"Creating RH interpolation matrix...");
185 if (m_interpMatRh && m_interpMatRh->rows() > 0) {
186 qDebug() <<
"StcLoadingWorker: RH interpolation matrix created:"
187 << m_interpMatRh->rows() <<
"x" << m_interpMatRh->cols();
StcLoadingWorker class declaration.
BrainSurface class declaration.
GeometryInfo class declaration.
Interpolation class declaration.
static QSharedPointer< Eigen::MatrixXd > scdc(const Eigen::MatrixX3f &matVertices, const std::vector< Eigen::VectorXi > &vecNeighborVertices, Eigen::VectorXi &vecVertSubset, double dCancelDist=FLOAT_INFINITY)
scdc Calculates surface constrained distances on a mesh.
static double cubic(const double dIn)
cubic Cubic hyperbola interpolation function.
static QSharedPointer< Eigen::SparseMatrix< float > > createInterpolationMat(const Eigen::VectorXi &vecProjectedSensors, const QSharedPointer< Eigen::MatrixXd > matDistanceTable, double(*interpolationFunction)(double), const double dCancelDist=FLOAT_INFINITY, const Eigen::VectorXi &vecExcludeIndex=Eigen::VectorXi())
createInterpolationMat Calculates the weight matrix for interpolation.
Renderable cortical surface mesh with per-vertex color, curvature data, and GPU buffer management.
void error(const QString &message)
void progress(int percent, const QString &message)
void finished(bool success)
StcLoadingWorker(const QString &lhPath, const QString &rhPath, BrainSurface *lhSurface, BrainSurface *rhSurface, double cancelDist=0.05, QObject *parent=nullptr)
static bool read(QIODevice &p_IODevice, MNESourceEstimate &p_stc)