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

The MNE class provides wrapper functions to stay consistent with mne matlab toolbox. More...

#include <mne.h>

Public Member Functions

virtual ~MNE ()

Static Public Member Functions

static Eigen::VectorXd * combine_xyz (const Eigen::VectorXd &vec)
static qint32 find_source_space_hemi (MNEHemisphere &p_Hemisphere)
static qint32 get_current_comp (FIFFLIB::FiffInfo *info)
static Eigen::SparseMatrix< double > * make_block_diag (const Eigen::MatrixXd &A, qint32 n)
static bool make_compensator (const FIFFLIB::FiffInfo &info, FIFFLIB::fiff_int_t from, FIFFLIB::fiff_int_t to, FIFFLIB::FiffCtfComp &ctf_comp, bool exclude_comp_chs=false)
static FIFFLIB::fiff_int_t make_projector (const QList< FIFFLIB::FiffProj > &projs, const QStringList &ch_names, Eigen::MatrixXd &proj, const QStringList &bads=FIFFLIB::defaultQStringList, Eigen::MatrixXd &U=FIFFLIB::defaultMatrixXd)
static qint32 make_projector (FIFFLIB::FiffInfo &info, Eigen::MatrixXd &proj)
static bool patch_info (MNEHemisphere &p_Hemisphere)
static MNEInverseOperator prepare_inverse_operator (MNEInverseOperator &orig, qint32 nave, float lambda2, bool dSPM, bool sLORETA=false)
static bool read_events (const QString &t_sEventName, const QString &t_fileRawName, Eigen::MatrixXi &events)
static bool read_events_from_fif (QIODevice &p_IODevice, Eigen::MatrixXi &eventlist)
static bool read_events_from_ascii (QIODevice &p_IODevice, Eigen::MatrixXi &eventlist)
static bool write_events_to_fif (QIODevice &p_IODevice, const Eigen::MatrixXi &eventlist)
static bool write_events_to_ascii (QIODevice &p_IODevice, const Eigen::MatrixXi &eventlist, float sfreq=0.0f)
static FIFFLIB::FiffCov compute_epoch_covariance (const FIFFLIB::FiffRawData &raw, const Eigen::MatrixXi &events, const QList< int > &eventCodes, float tmin, float tmax, float bmin=0.0f, float bmax=0.0f, bool doBaseline=false, bool removeMean=true)
static QList< FIFFLIB::FiffProjcompute_proj (const FIFFLIB::FiffRawData &raw, const Eigen::MatrixXi &events, int eventCode, float tmin, float tmax, int nGrad, int nMag, int nEeg, const QMap< QString, double > &mapReject=QMap< QString, double >())
static bool save_raw (const FIFFLIB::FiffRawData &raw, QIODevice &p_IODevice, const Eigen::RowVectorXi &picks=Eigen::RowVectorXi(), int decim=1, int from=-1, int to=-1)
static void setup_compensators (FIFFLIB::FiffRawData &raw, FIFFLIB::fiff_int_t dest_comp, bool keep_comp)
static bool read_cov (FIFFLIB::FiffStream::SPtr &p_pStream, const FIFFLIB::FiffDirNode::SPtr &p_Node, FIFFLIB::fiff_int_t cov_kind, FIFFLIB::FiffCov &p_covData)
static bool read_inverse_operator (QIODevice &p_pIODevice, MNEInverseOperator &inv)
static bool read_forward_solution (QIODevice &p_IODevice, MNEForwardSolution &fwd, bool force_fixed=false, bool surf_ori=false, const QStringList &include=FIFFLIB::defaultQStringList, const QStringList &exclude=FIFFLIB::defaultQStringList)
static bool read_source_spaces (FIFFLIB::FiffStream::SPtr &p_pStream, bool add_geom, MNESourceSpaces &p_SourceSpace)
static QList< FIFFLIB::FiffChInfoset_current_comp (QList< FIFFLIB::FiffChInfo > &chs, FIFFLIB::fiff_int_t value)
static bool transform_source_space_to (MNESourceSpaces &p_pMNESourceSpaces, FIFFLIB::fiff_int_t dest, FIFFLIB::FiffCoordTrans &trans)
static void transpose_named_matrix (FIFFLIB::FiffNamedMatrix &mat)

Detailed Description

The MNE class provides wrapper functions to stay consistent with mne matlab toolbox.

DECLARE MNE WRAPPER CLASS

Definition at line 89 of file mne.h.

Constructor & Destructor Documentation

◆ ~MNE()

virtual MNELIB::MNE::~MNE ( )
inlinevirtual

dtor

Definition at line 98 of file mne.h.

Member Function Documentation

◆ combine_xyz()

Eigen::VectorXd * MNELIB::MNE::combine_xyz ( const Eigen::VectorXd & vec)
inlinestatic

mne_combine_xyz

MNE toolbox root function

Wrapper for the MNEMath::combine_xyz static function

Compute the three Cartesian components of a vector together

Parameters
[in]vecInput row vector [ x1 y1 z1 ... x_n y_n z_n ].
Returns
Output vector [x1^2+y1^2+z1^2 ... x_n^2+y_n^2+z_n^2 ].

Definition at line 115 of file mne.h.

◆ compute_epoch_covariance()

FIFFLIB::FiffCov MNELIB::MNE::compute_epoch_covariance ( const FIFFLIB::FiffRawData & raw,
const Eigen::MatrixXi & events,
const QList< int > & eventCodes,
float tmin,
float tmax,
float bmin = 0.0f,
float bmax = 0.0f,
bool doBaseline = false,
bool removeMean = true )
inlinestatic

compute_epoch_covariance

MNE toolbox root function

Wrapper for the FiffCov::compute_from_epochs static function

Compute a noise covariance matrix from raw data based on event-locked epochs. Ported from compute_cov.c (MNE-C).

Parameters
[in]rawThe raw data.
[in]eventsEvent matrix (nEvents x 3): [sample, before, after].
[in]eventCodesWhich event codes to include.
[in]tminStart of time window relative to event (seconds).
[in]tmaxEnd of time window relative to event (seconds).
[in]bminBaseline start (seconds, relative to event). Only used if doBaseline is true.
[in]bmaxBaseline end (seconds, relative to event). Only used if doBaseline is true.
[in]doBaselineWhether to apply baseline correction before covariance computation.
[in]removeMeanWhether to remove sample mean from the covariance estimate.
Returns
The computed noise covariance matrix, or empty FiffCov on failure.

Definition at line 434 of file mne.h.

◆ compute_proj()

QList< FIFFLIB::FiffProj > MNELIB::MNE::compute_proj ( const FIFFLIB::FiffRawData & raw,
const Eigen::MatrixXi & events,
int eventCode,
float tmin,
float tmax,
int nGrad,
int nMag,
int nEeg,
const QMap< QString, double > & mapReject = QMap<QString,double>() )
inlinestatic

compute_proj

MNE toolbox root function

Create SSP (Signal-Space Projection) operators from raw data via SVD. Ported from make_ssp.c (MNE-C).

Parameters
[in]rawThe raw data.
[in]eventsEvent matrix (nEvents x 3).
[in]eventCodeWhich event code to select epochs for.
[in]tminStart of epoch relative to event (seconds).
[in]tmaxEnd of epoch relative to event (seconds).
[in]nGradNumber of gradiometer projection vectors.
[in]nMagNumber of magnetometer projection vectors.
[in]nEegNumber of EEG projection vectors.
[in]mapRejectRejection thresholds (key = channel type string, value = threshold).
Returns
List of FiffProj items, or empty list on failure.

Definition at line 468 of file mne.h.

◆ find_source_space_hemi()

qint32 MNELIB::MNE::find_source_space_hemi ( MNEHemisphere & p_Hemisphere)
inlinestatic

mne_block_diag - decoding part

MNE toolbox root function

Wrapper for the MNEForwardSolution::extract_block_diag static function mne_find_source_space_hemi

MNE toolbox root function

Wrapper for the MNESourceSpaces::find_source_space_hemi static function

Returns the hemisphere id (FIFFV_MNE_SURF_LEFT_HEMI or FIFFV_MNE_SURF_RIGHT_HEMI) for a source space.

Parameters
[in]p_HemisphereThe hemisphere to investigate.
Returns
the deduced hemisphere id.

Definition at line 144 of file mne.h.

◆ get_current_comp()

qint32 MNELIB::MNE::get_current_comp ( FIFFLIB::FiffInfo * info)
inlinestatic

mne_get_current_comp

MNE toolbox root function

Wrapper for the FiffInfo get_current_comp member function

Get the current compensation in effect in the data

Parameters
[in]infoFiff measurement info.
Returns
the current compensation.

Definition at line 163 of file mne.h.

◆ make_block_diag()

Eigen::SparseMatrix< double > * MNELIB::MNE::make_block_diag ( const Eigen::MatrixXd & A,
qint32 n )
inlinestatic

mne_block_diag - encoding part

MNE toolbox root function

Wrapper for the MNEForwardSolution::make_block_diag static function

Make a sparse block diagonal matrix

Returns a sparse block diagonal, diagonalized from the elements in "A". "A" is ma x na, comprising bdn=(na/"n") blocks of submatrices. Each submatrix is ma x "n", and these submatrices are placed down the diagonal of the matrix.

Parameters
[in,out]AMatrix which should be diagonlized.
[in,out]nColumns of the submatrices.
Returns
A sparse block diagonal, diagonalized from the elements in "A".

Definition at line 188 of file mne.h.

◆ make_compensator()

bool MNELIB::MNE::make_compensator ( const FIFFLIB::FiffInfo & info,
FIFFLIB::fiff_int_t from,
FIFFLIB::fiff_int_t to,
FIFFLIB::FiffCtfComp & ctf_comp,
bool exclude_comp_chs = false )
inlinestatic

mne_make_compensator

MNE toolbox root function

Wrapper for the FiffInfo make_compensator member function

Create a compensation matrix to bring the data from one compensation state to another

Parameters
[in]infomeasurement info as returned by the fif reading routines.
[in]fromcompensation in the input data.
[in]todesired compensation in the output.
[out]ctf_compCompensation Matrix.
[in]exclude_comp_chsexclude compensation channels from the output (optional).
Returns
true if succeeded, false otherwise.

Definition at line 211 of file mne.h.

◆ make_projector() [1/2]

FIFFLIB::fiff_int_t MNELIB::MNE::make_projector ( const QList< FIFFLIB::FiffProj > & projs,
const QStringList & ch_names,
Eigen::MatrixXd & proj,
const QStringList & bads = FIFFLIB::defaultQStringList,
Eigen::MatrixXd & U = FIFFLIB::defaultMatrixXd )
inlinestatic

make_projector

MNE toolbox root function

Wrapper for the FiffInfo::make_projector static function There exists also a member function which should be preferred: make_projector(MatrixXd& proj, Eigen::MatrixXd& U = defaultUMatrix)

Make an SSP operator

Parameters
[in]projsA set of projection vectors.
[in]ch_namesA cell array of channel names.
[out]projThe projection operator to apply to the data.
[in]badsBad channels to exclude.
[out]UThe orthogonal basis of the projection vectors (optional).
Returns
nproj - How many items in the projector.

Definition at line 240 of file mne.h.

◆ make_projector() [2/2]

qint32 MNELIB::MNE::make_projector ( FIFFLIB::FiffInfo & info,
Eigen::MatrixXd & proj )
inlinestatic

mne_make_projector_info

MNE toolbox root function

Wrapper for the FiffInfo make_projector_info(MatrixXd& proj) member function

Make a SSP operator using the meas info

Parameters
[in]infoFiff measurement info.
[out]projThe projection operator to apply to the data.
Returns
nproj - How many items in the projector.

Definition at line 268 of file mne.h.

◆ patch_info()

bool MNELIB::MNE::patch_info ( MNEHemisphere & p_Hemisphere)
inlinestatic

mne_patch_info

MNE toolbox root function

Wrapper for the MNESourceSpaces::patch_info static function

Parameters
[in,out]p_HemisphereThe source space.
Returns
true if succeeded, false otherwise.

Definition at line 286 of file mne.h.

◆ prepare_inverse_operator()

MNEInverseOperator MNELIB::MNE::prepare_inverse_operator ( MNEInverseOperator & orig,
qint32 nave,
float lambda2,
bool dSPM,
bool sLORETA = false )
inlinestatic

mne_prepare_inverse_operator

MNE toolbox root function

Wrapper for the MNEInverseOperator prepare_inverse_operator member function

Prepare for actually computing the inverse

Parameters
[in]origThe inverse operator structure read from a file.
[in]naveNumber of averages (scales the noise covariance).
[in]lambda2The regularization factor.
[in]dSPMCompute the noise-normalization factors for dSPM?.
[in]sLORETACompute the noise-normalization factors for sLORETA?.
Returns
the prepared inverse operator.

Definition at line 309 of file mne.h.

◆ read_cov()

bool MNELIB::MNE::read_cov ( FIFFLIB::FiffStream::SPtr & p_pStream,
const FIFFLIB::FiffDirNode::SPtr & p_Node,
FIFFLIB::fiff_int_t cov_kind,
FIFFLIB::FiffCov & p_covData )
inlinestatic

mne_read_cov

MNE toolbox root function

Wrapper for the FiffStream read_cov member function

Reads a covariance matrix from a fiff file

Parameters
[in]p_pStreaman open fiff file.
[in]p_Nodelook for the matrix in here.
[in]cov_kindwhat kind of a covariance matrix do we want?.
[in,out]p_covDatathe read covariance matrix.
Returns
true if succeeded, false otherwise.

Definition at line 532 of file mne.h.

◆ read_events()

bool MNELIB::MNE::read_events ( const QString & t_sEventName,
const QString & t_fileRawName,
Eigen::MatrixXi & events )
inlinestatic

Definition at line 318 of file mne.h.

◆ read_events_from_ascii()

bool MNELIB::MNE::read_events_from_ascii ( QIODevice & p_IODevice,
Eigen::MatrixXi & eventlist )
inlinestatic

read_events

Read a list of events from an eve file

Parameters
[in]p_IODeviceThe I/O device to read from.
[in,out]eventListList of events.
Returns
true if succeeded, false otherwise.

Definition at line 361 of file mne.h.

◆ read_events_from_fif()

bool MNELIB::MNE::read_events_from_fif ( QIODevice & p_IODevice,
Eigen::MatrixXi & eventlist )
inlinestatic

mne_read_events

Read an event list from a fif file

Parameters
[in]p_IODeviceThe I/O device to read from.
[in,out]eventlistThe read eventlist m x 3; with m events; colum: 1 - position in samples, 3 - eventcode.
Returns
true if succeeded, false otherwise.

Definition at line 340 of file mne.h.

◆ read_forward_solution()

bool MNELIB::MNE::read_forward_solution ( QIODevice & p_IODevice,
MNEForwardSolution & fwd,
bool force_fixed = false,
bool surf_ori = false,
const QStringList & include = FIFFLIB::defaultQStringList,
const QStringList & exclude = FIFFLIB::defaultQStringList )
inlinestatic

mne_read_forward_solution

MNE toolbox root function

Wrapper for the MNEForwardSolution::read_forward_solution static function

Reads a forward solution from a fif file

Parameters
[in]p_IODeviceA fiff IO device like a fiff QFile or QTCPSocket.
[in,out]fwdA forward solution from a fif file.
[in]force_fixedForce fixed source orientation mode? (optional).
[in]surf_oriUse surface based source coordinate system? (optional).
[in]includeInclude these channels (optional).
[in]excludeExclude these channels (optional).
Returns
true if succeeded, false otherwise.

Definition at line 583 of file mne.h.

◆ read_inverse_operator()

bool MNELIB::MNE::read_inverse_operator ( QIODevice & p_pIODevice,
MNEInverseOperator & inv )
inlinestatic

mne_read_inverse_operator

MNE toolbox root function

Wrapper for the MNEInverseOperator::read_inverse_operator static function

Reads the inverse operator decomposition from a fif file

Parameters
[in]p_pIODeviceA fiff IO device like a fiff QFile or QTCPSocket.
[in,out]invThe read inverse operator.
Returns
true if succeeded, false otherwise.

Definition at line 557 of file mne.h.

◆ read_source_spaces()

bool MNELIB::MNE::read_source_spaces ( FIFFLIB::FiffStream::SPtr & p_pStream,
bool add_geom,
MNESourceSpaces & p_SourceSpace )
inlinestatic

mne_read_forward_solution

MNE toolbox root function

Wrapper for the MNESourceSpaces::read_source_spaces static function

Reads source spaces from a fif file

Parameters
[in]p_pStreamThe open fiff file.
[in]add_geomAdd geometry information to the source spaces.
[in,out]p_SourceSpaceThe read source spaces.
Returns
true if succeeded, false otherwise.

Definition at line 615 of file mne.h.

◆ save_raw()

bool MNELIB::MNE::save_raw ( const FIFFLIB::FiffRawData & raw,
QIODevice & p_IODevice,
const Eigen::RowVectorXi & picks = Eigen::RowVectorXi(),
int decim = 1,
int from = -1,
int to = -1 )
inlinestatic

save_raw

MNE toolbox root function

Wrapper for the FiffRawData::save member function

Save raw data to a FIFF file, optionally with decimation and channel picking. Ported from save.c (MNE-C).

Parameters
[in]rawThe raw data to save.
[in]p_IODeviceOutput device to write to.
[in]picksChannel indices to include (empty = all channels).
[in]decimDecimation factor (1 = no decimation).
[in]fromFirst sample to save (-1 = from start of raw data).
[in]toLast sample to save (-1 = to end of raw data).
Returns
true on success.

Definition at line 501 of file mne.h.

◆ set_current_comp()

QList< FIFFLIB::FiffChInfo > MNELIB::MNE::set_current_comp ( QList< FIFFLIB::FiffChInfo > & chs,
FIFFLIB::fiff_int_t value )
inlinestatic

mne_set_current_comp

MNE toolbox root function

Wrapper for the FiffInfo::set_current_comp static function Consider taking the member function of a FiffInfo set_current_comp(fiff_int_t value), when compensation should be applied to the channels of FiffInfo

Set the current compensation value in the channel info structures

Parameters
[in]chsfiff channel info list.
[in]valuecompensation value.
Returns
the current compensation.

Definition at line 642 of file mne.h.

◆ setup_compensators()

void MNE::setup_compensators ( FIFFLIB::FiffRawData & raw,
FIFFLIB::fiff_int_t dest_comp,
bool keep_comp )
static

Definition at line 68 of file mne.cpp.

◆ transform_source_space_to()

bool MNELIB::MNE::transform_source_space_to ( MNESourceSpaces & p_pMNESourceSpaces,
FIFFLIB::fiff_int_t dest,
FIFFLIB::FiffCoordTrans & trans )
inlinestatic

mne_transform_source_space_to

MNE toolbox root function

Wrapper for the MNESourceSpaces transform_source_space_to member function

Transforms source space data to the desired coordinate system

Parameters
[in,out]p_pMNESourceSpacesthe source space which is should be transformed.
[in]destdestination check code.
[in]transtransformation information.
Returns
true if succeeded, false otherwise.

Definition at line 665 of file mne.h.

◆ transpose_named_matrix()

void MNELIB::MNE::transpose_named_matrix ( FIFFLIB::FiffNamedMatrix & mat)
inlinestatic

mne_transpose_named_matrix

MNE toolbox root function

Wrapper for the FiffNamedMatrix transpose_named_matrix member function

Transpose a named matrix (FiffNamedMatrix)

Parameters
[in,out]matFiffNamedMatrix which shoul be transposed.

Definition at line 686 of file mne.h.

◆ write_events_to_ascii()

bool MNELIB::MNE::write_events_to_ascii ( QIODevice & p_IODevice,
const Eigen::MatrixXi & eventlist,
float sfreq = 0.0f )
inlinestatic

write_events_to_ascii

Write an event list to a text file (MNE-C compatible format).

Parameters
[in]p_IODeviceThe I/O device to write to.
[in]eventlistThe event list (nEvents x 3): [sample, before, after].
[in]sfreqSampling frequency for time column computation.
Returns
true if succeeded, false otherwise.

Definition at line 402 of file mne.h.

◆ write_events_to_fif()

bool MNELIB::MNE::write_events_to_fif ( QIODevice & p_IODevice,
const Eigen::MatrixXi & eventlist )
inlinestatic

write_events_to_fif

Write an event list to a FIFF file.

Parameters
[in]p_IODeviceThe I/O device to write to.
[in]eventlistThe event list (nEvents x 3): [sample, before, after].
Returns
true if succeeded, false otherwise.

Definition at line 382 of file mne.h.


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