25#ifndef MNE_HEMISPHERE_H
26#define MNE_HEMISPHERE_H
44#include <Eigen/SparseCore>
73 using SPtr = std::shared_ptr<MNEHemisphere>;
74 using ConstSPtr = std::shared_ptr<const MNEHemisphere>;
231 Eigen::MatrixXf m_TriCoords;
248 for(
int i = 0; i < a.
pinfo.size(); ++i) {
262 a.
rr.isApprox(b.
rr, 0.0001f) &&
263 a.
nn.isApprox(b.
nn, 0.0001f) &&
275 const auto& sa = a.dist.eigen();
276 const auto& sb = b.dist.eigen();
277 if (sa.rows() == 0 && sb.rows() == 0 && sa.cols() == 0 && sb.cols() == 0)
279 return sa.toDense().isApprox(sb.toDense(), 0.0001f);
288 if (a.neighbor_tri.size() != b.neighbor_tri.size()) return false;
289 for (size_t i = 0; i < a.neighbor_tri.size(); ++i) {
290 if (a.neighbor_tri[i].size() != b.neighbor_tri[i].size()) return false;
291 if (a.neighbor_tri[i].size() > 0 && !(a.neighbor_tri[i].array() == b.neighbor_tri[i].array()).all()) return false;
296 if (a.neighbor_vert.size() != b.neighbor_vert.size())
return false;
297 for (
size_t i = 0; i < a.neighbor_vert.size(); ++i) {
298 if (a.neighbor_vert[i].size() != b.neighbor_vert[i].size())
return false;
299 if (a.neighbor_vert[i].size() > 0 && !(a.neighbor_vert[i].array() == b.neighbor_vert[i].array()).all())
return false;
303 a.cluster_info == b.cluster_info &&
304 a.m_TriCoords.isApprox(b.m_TriCoords, 0.0001f));
bool operator==(const BIDSPath &a, const BIDSPath &b)
MNELIB shared-library export/import macros and library build metadata.
Single-hemisphere source space (cortical surface or volume grid) loaded from FIFF.
Bookkeeping for a label-restricted clustering of source-space leadfield columns.
Static MATLAB-style FIFF facade: thin wrapper functions kept for parity with the historical mne-matla...
Primitive scalar typedefs and forward-compatible aliases backing the FIFF type system.
Core MNE data structures (source spaces, source estimates, hemispheres).
bool operator==(const MNEClusterInfo &a, const MNEClusterInfo &b)
Labelled 4x4 FIFF affine: source frame, destination frame, rotation, translation and cached inverse.
FIFF tag-stream reader/writer: wraps a QIODevice and exposes typed read_* / write_* methods for every...
Cluster table used to compress and reconstruct a clustered leadfield.
void writeToStream(FIFFLIB::FiffStream *p_pStream)
Eigen::MatrixX3d tri_cent
bool complete_source_space_info()
Eigen::VectorXd use_tri_area
Eigen::MatrixX3d use_tri_cent
Eigen::MatrixXf & getTriCoords(float p_fScaling=1.0f)
MNEHemisphere & operator=(const MNEHemisphere &other)
bool compute_patch_info()
MNESourceSpace::SPtr clone() const override
bool transform_hemisphere_to(FIFFLIB::fiff_int_t dest, const FIFFLIB::FiffCoordTrans &p_Trans)
MNEClusterInfo cluster_info
Eigen::MatrixX3d use_tri_nn
std::shared_ptr< const MNEHemisphere > ConstSPtr
QList< Eigen::VectorXi > pinfo
std::shared_ptr< MNEHemisphere > SPtr
Eigen::VectorXi patch_inds
std::shared_ptr< MNESourceSpace > SPtr
Eigen::VectorXd nearestDistVec() const
Eigen::VectorXi nearestVertIdx() const