v2.0.0
Loading...
Searching...
No Matches
MNELIB::MNEMorphMap Class Reference

Morph map of one hemisphere from one subject to another. More...

#include <mne_morph_map.h>

Public Types

typedef QSharedPointer< MNEMorphMap > SPtr
typedef QSharedPointer< const MNEMorphMap > ConstSPtr

Public Member Functions

 MNEMorphMap ()=default
 MNEMorphMap (MNEMorphMap &&)=default
MNEMorphMap & operator= (MNEMorphMap &&)=default
 ~MNEMorphMap ()=default
 MNEMorphMap (const MNEMorphMap &other)
Eigen::SparseMatrix< double > toEigen () const

Static Public Member Functions

static MNEMorphMap compute (const Eigen::MatrixX3f &fromRr, const Eigen::MatrixX3i &fromTris, const Eigen::MatrixX3f &toRr)
static std::optional< MNEMorphMap > read (const QString &path, const QString &fromSubj, const QString &toSubj, int hemi)
static bool write (const QString &path, const QList< const MNEMorphMap * > &maps)

Public Attributes

std::unique_ptr< FIFFLIB::FiffSparseMatrix > map
Eigen::VectorXi best
int hemi = -1
QString from_subj
QString to_subj

Detailed Description

Morph map of one hemisphere from one subject to another.

Definition at line 73 of file mne_morph_map.h.

Member Typedef Documentation

◆ ConstSPtr

typedef QSharedPointer<const MNEMorphMap> MNELIB::MNEMorphMap::ConstSPtr

Const shared pointer type for MNEMorphMap.

Definition at line 77 of file mne_morph_map.h.

◆ SPtr

typedef QSharedPointer<MNEMorphMap> MNELIB::MNEMorphMap::SPtr

Shared pointer type for MNEMorphMap.

Definition at line 76 of file mne_morph_map.h.

Constructor & Destructor Documentation

◆ MNEMorphMap() [1/3]

MNELIB::MNEMorphMap::MNEMorphMap ( )
default

◆ MNEMorphMap() [2/3]

MNELIB::MNEMorphMap::MNEMorphMap ( MNEMorphMap && )
default

◆ ~MNEMorphMap()

MNELIB::MNEMorphMap::~MNEMorphMap ( )
default

◆ MNEMorphMap() [3/3]

MNEMorphMap::MNEMorphMap ( const MNEMorphMap & other)

Copies the map including its matrix.

Parameters
[in]otherThe map to copy.

Definition at line 203 of file mne_morph_map.cpp.

Member Function Documentation

◆ compute()

MNEMorphMap MNEMorphMap::compute ( const Eigen::MatrixX3f & fromRr,
const Eigen::MatrixX3i & fromTris,
const Eigen::MatrixX3f & toRr )
static

Computes the map between two registered spheres (MNE-C mne_compose_morph_maps, accurate mode; mne.surface._make_morph_map_hemi).

Both spheres are scaled to unit radius. Each destination vertex is mapped to the source triangle it falls into, among the triangles around its nearest source vertex, with barycentric weights; best holds that nearest vertex.

Parameters
[in]fromRrSource sphere vertices.
[in]fromTrisSource sphere triangles.
[in]toRrDestination sphere vertices.
Returns
The map (destination vertices x source vertices).

Definition at line 214 of file mne_morph_map.cpp.

◆ operator=()

MNEMorphMap & MNELIB::MNEMorphMap::operator= ( MNEMorphMap && )
default

◆ read()

std::optional< MNEMorphMap > MNEMorphMap::read ( const QString & path,
const QString & fromSubj,
const QString & toSubj,
int hemi )
static

Reads one map from a morph-map file (MNE-C load_one_morph_map).

Parameters
[in]pathA -morph.fif file.
[in]fromSubjSource subject.
[in]toSubjDestination subject.
[in]hemi0 for the left, 1 for the right hemisphere.
Returns
The map, or no value if the file has no such map.

Definition at line 279 of file mne_morph_map.cpp.

◆ toEigen()

SparseMatrix< double > MNEMorphMap::toEigen ( ) const

Returns the map as a matrix that takes source vertex values to destination vertices.

Returns
The destination x source sparse matrix in double precision (e.g. for SourceMorph).

Definition at line 342 of file mne_morph_map.cpp.

◆ write()

bool MNEMorphMap::write ( const QString & path,
const QList< const MNEMorphMap * > & maps )
static

Writes maps as FIFFB_MNE_MORPH_MAP blocks (MNE-C mne_save_morph_map_matrices).

Parameters
[in]pathThe output file.
[in]mapsThe maps; from_subj, to_subj and hemi identify each one.
Returns
True if the file was written.

Definition at line 317 of file mne_morph_map.cpp.

Member Data Documentation

◆ best

Eigen::VectorXi MNELIB::MNEMorphMap::best

Nearest source vertex of every destination vertex (computed maps only).

Definition at line 143 of file mne_morph_map.h.

◆ from_subj

QString MNELIB::MNEMorphMap::from_subj

Source subject.

Definition at line 145 of file mne_morph_map.h.

◆ hemi

int MNELIB::MNEMorphMap::hemi = -1

0 for the left, 1 for the right hemisphere, -1 if unknown.

Definition at line 144 of file mne_morph_map.h.

◆ map

std::unique_ptr<FIFFLIB::FiffSparseMatrix> MNELIB::MNEMorphMap::map

Destination x source interpolation weights.

Definition at line 142 of file mne_morph_map.h.

◆ to_subj

QString MNELIB::MNEMorphMap::to_subj

Destination subject.

Definition at line 146 of file mne_morph_map.h.


The documentation for this class was generated from the following files: