45 const VectorXi& verticesTo,
46 const SparseMatrix<double>& morphMap)
48 if (verticesFrom.size() == 0 || verticesTo.size() == 0) {
49 qWarning() <<
"[SourceMorph::compute] Empty vertex vectors.";
53 if (morphMap.rows() != verticesTo.size() || morphMap.cols() != verticesFrom.size()) {
54 qWarning() <<
"[SourceMorph::compute] Morph map dimensions mismatch:"
55 << morphMap.rows() <<
"x" << morphMap.cols()
56 <<
"but expected" << verticesTo.size() <<
"x" << verticesFrom.size();
60 m_verticesFrom = verticesFrom;
61 m_verticesTo = verticesTo;
62 m_morphMatrix = morphMap;
71 qWarning() <<
"[SourceMorph::apply] Morph not computed. Call compute() first.";
76 qWarning() <<
"[SourceMorph::apply] Source estimate is empty.";
80 if (stcFrom.
data.rows() != m_morphMatrix.cols()) {
81 qWarning() <<
"[SourceMorph::apply] Source estimate rows" << stcFrom.
data.rows()
82 <<
"!= morph matrix cols" << m_morphMatrix.cols();
87 MatrixXd morphedData = m_morphMatrix * stcFrom.
data;
Sparse morph operator that re-samples an INVLIB::InvSourceEstimate from one subject's source space on...
Inverse source estimation (MNE, dSPM, sLORETA, dipole fitting).
Source-space inverse-solution container with dense grid plus optional focal-dipole,...
InvSourceSpaceType sourceSpaceType
InvOrientationType orientationType
InvSourceEstimate apply(const InvSourceEstimate &stcFrom) const
Apply the morphing to a source estimate.
void compute(const Eigen::VectorXi &verticesFrom, const Eigen::VectorXi &verticesTo, const Eigen::SparseMatrix< double > &morphMap)
Compute the morphing transformation.