MNE-CPP  beta 1.0
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
MNELIB::MNEForwardSolution Class Reference

Forward operator. More...

#include <mne_forwardsolution.h>

Public Types

typedef QSharedPointer< MNEForwardSolutionSPtr
 
typedef QSharedPointer< const MNEForwardSolutionConstSPtr
 

Public Member Functions

 MNEForwardSolution ()
 
 MNEForwardSolution (QIODevice &p_IODevice, bool force_fixed=false, bool surf_ori=false, const QStringList &include=defaultQStringList, const QStringList &exclude=defaultQStringList, bool bExcludeBads=false)
 
 MNEForwardSolution (const MNEForwardSolution &p_MNEForwardSolution)
 
 ~MNEForwardSolution ()
 
void clear ()
 
MNEForwardSolution cluster_forward_solution (const AnnotationSet &p_AnnotationSet, qint32 p_iClusterSize, MatrixXd &p_D=defaultD, const FiffCov &p_pNoise_cov=defaultCov, const FiffInfo &p_pInfo=defaultInfo, QString p_sMethod="cityblock") const
 
FiffCov compute_orient_prior (float loose=0.2)
 
bool isClustered () const
 
bool isEmpty () const
 
bool isFixedOrient () const
 
MNEForwardSolution pick_channels (const QStringList &include=defaultQStringList, const QStringList &exclude=defaultQStringList) const
 
MNEForwardSolution pick_regions (const QList< Label > &p_qListLabels) const
 
MNEForwardSolution pick_types (bool meg, bool eeg, const QStringList &include=defaultQStringList, const QStringList &exclude=defaultQStringList) const
 
void prepare_forward (const FiffInfo &p_info, const FiffCov &p_noise_cov, bool p_pca, FiffInfo &p_outFwdInfo, MatrixXd &gain, FiffCov &p_outNoiseCov, MatrixXd &p_outWhitener, qint32 &p_outNumNonZero) const
 
VectorXi tripletSelection (const VectorXi &p_vecIdxSelection) const
 
MNEForwardSolution reduce_forward_solution (qint32 p_iNumDipoles, MatrixXd &p_D) const
 
void to_fixed_ori ()
 

Static Public Member Functions

static FiffCov compute_depth_prior (const MatrixXd &Gain, const FiffInfo &gain_info, bool is_fixed_ori, double exp=0.8, double limit=10.0, const MatrixXd &patch_areas=defaultConstMatrixXd, bool limit_depth_chs=false)
 
static bool read (QIODevice &p_IODevice, MNEForwardSolution &fwd, bool force_fixed=false, bool surf_ori=false, const QStringList &include=defaultQStringList, const QStringList &exclude=defaultQStringList, bool bExcludeBads=true)
 
static void restrict_gain_matrix (MatrixXd &G, const FiffInfo &info)
 

Public Attributes

FiffInfoBase info
 
fiff_int_t source_ori
 
bool surf_ori
 
fiff_int_t coord_frame
 
fiff_int_t nsource
 
fiff_int_t nchan
 
FiffNamedMatrix::SDPtr sol
 
FiffNamedMatrix::SDPtr sol_grad
 
FiffCoordTrans mri_head_t
 
MNESourceSpace src
 
MatrixX3f source_rr
 
MatrixX3f source_nn
 

Friends

std::ostream & operator<< (std::ostream &out, const MNELIB::MNEForwardSolution &p_MNEForwardSolution)
 

Detailed Description

Forward operator.

Forward operator

Definition at line 206 of file mne_forwardsolution.h.

Member Typedef Documentation

Const shared pointer type for MNEForwardSolution.

Definition at line 210 of file mne_forwardsolution.h.

Shared pointer type for MNEForwardSolution.

Definition at line 209 of file mne_forwardsolution.h.

Constructor & Destructor Documentation

MNEForwardSolution::MNEForwardSolution ( )

Default constructor.

Definition at line 80 of file mne_forwardsolution.cpp.

MNEForwardSolution::MNEForwardSolution ( QIODevice &  p_IODevice,
bool  force_fixed = false,
bool  surf_ori = false,
const QStringList &  include = defaultQStringList,
const QStringList &  exclude = defaultQStringList,
bool  bExcludeBads = false 
)

Constructs a forward operator, by reading from a IO device.

Parameters
[in]p_IODeviceIO device to read from the forward operator.
[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)
[in]bExcludeBadsIf true bads are also read; default = false (optional)

Definition at line 99 of file mne_forwardsolution.cpp.

MNEForwardSolution::MNEForwardSolution ( const MNEForwardSolution p_MNEForwardSolution)

Copy constructor.

Parameters
[in]p_MNEForwardSolutionMNE forward solution

Definition at line 122 of file mne_forwardsolution.cpp.

MNEForwardSolution::~MNEForwardSolution ( )

Destroys the MNEForwardSolution.

Definition at line 142 of file mne_forwardsolution.cpp.

Member Function Documentation

void MNEForwardSolution::clear ( )

Initializes the MNE forward solution.

Definition at line 150 of file mne_forwardsolution.cpp.

MNEForwardSolution MNEForwardSolution::cluster_forward_solution ( const AnnotationSet p_AnnotationSet,
qint32  p_iClusterSize,
MatrixXd &  p_D = defaultD,
const FiffCov p_pNoise_cov = defaultCov,
const FiffInfo p_pInfo = defaultInfo,
QString  p_sMethod = "cityblock" 
) const

Cluster the forward solution and stores the result to p_fwdOut. The clustering is done by using the provided annotations

Parameters
[in]p_AnnotationSetAnnotation set containing the annotation of left & right hemisphere
[in]p_iClusterSizeMaximal cluster size per roi
[out]p_DThe cluster operator
[in]p_pNoise_cov
[in]p_pInfo
[in]p_sMethod"cityblock" or "sqeuclidean"
Returns
clustered MNE forward solution

Definition at line 169 of file mne_forwardsolution.cpp.

FiffCov MNEForwardSolution::compute_depth_prior ( const MatrixXd &  Gain,
const FiffInfo gain_info,
bool  is_fixed_ori,
double  exp = 0.8,
double  limit = 10.0,
const MatrixXd &  patch_areas = defaultConstMatrixXd,
bool  limit_depth_chs = false 
)
static

Compute weighting for depth prior. ToDo move this to FiffCov

Parameters
[in]Gaingain matrix
[in]gain_infoThe measurement info to specify the channels to include.
[in]is_fixed_oriFixed orientation?
[in]expfloat in [0, 1]. Depth weighting coefficients. If None, no depth weighting is performed. (optional; default = 0.8)
[in]limit(optional; default = 10.0)
[in]patch_areas(optional)
[in]limit_depth_chsIf True, use only grad channels in depth weighting (equivalent to MNE C code). If grad chanels aren't present, only mag channels will be used (if no mag, then eeg). If False, use all channels. (optional)
Returns
the depth prior

Definition at line 811 of file mne_forwardsolution.cpp.

FiffCov MNEForwardSolution::compute_orient_prior ( float  loose = 0.2)

Compute orientation prior

Parameters
[in]looseThe loose orientation parameter.
Returns
Orientation priors.

Definition at line 921 of file mne_forwardsolution.cpp.

bool MNELIB::MNEForwardSolution::isClustered ( ) const
inline

Indicates whether fwd conatins a clustered forward solution.

Returns
true if forward solution is clustered, false otherwise.

Definition at line 523 of file mne_forwardsolution.h.

bool MNELIB::MNEForwardSolution::isEmpty ( ) const
inline

True if FIFF measurement file information is empty.

Returns
true if FIFF measurement file information is empty

Definition at line 531 of file mne_forwardsolution.h.

bool MNELIB::MNEForwardSolution::isFixedOrient ( ) const
inline

Has forward operator fixed orientation?

Returns
true if forward operator has fixed orientation, false otherwise

Definition at line 539 of file mne_forwardsolution.h.

MNEForwardSolution MNEForwardSolution::pick_channels ( const QStringList &  include = defaultQStringList,
const QStringList &  exclude = defaultQStringList 
) const

mne.fiff.pick_channels_forward

Pick channels from forward operator

Parameters
[in]includeList of channels to include. (if None, include all available).
[in]excludeChannels to exclude (if None, do not exclude any).
Returns
Forward solution restricted to selected channel types.

Definition at line 970 of file mne_forwardsolution.cpp.

MNEForwardSolution MNEForwardSolution::pick_regions ( const QList< Label > &  p_qListLabels) const

Reduces a forward solution to selected regions

Parameters
[in]p_qListLabelsROIs
Returns
the reduced forward solution

Definition at line 1034 of file mne_forwardsolution.cpp.

MNEForwardSolution MNEForwardSolution::pick_types ( bool  meg,
bool  eeg,
const QStringList &  include = defaultQStringList,
const QStringList &  exclude = defaultQStringList 
) const

mne.fiff.pick_types_forward

Pick by channel type and names from a forward operator

Parameters
[in]megInclude MEG channels
[in]eegInclude EEG channels
[in]includeAdditional channels to include (if empty, do not add any)
[in]excludeChannels to exclude (if empty, do not exclude any)
Returns
Forward solution restricted to selected channel types.

Definition at line 1086 of file mne_forwardsolution.cpp.

void MNEForwardSolution::prepare_forward ( const FiffInfo p_info,
const FiffCov p_noise_cov,
bool  p_pca,
FiffInfo p_outFwdInfo,
MatrixXd &  gain,
FiffCov p_outNoiseCov,
MatrixXd &  p_outWhitener,
qint32 &  p_outNumNonZero 
) const

Prepare forward for assembling the inverse operator

Parameters
[in]p_infoThe measurement info to specify the channels to include. Bad channels in info['bads'] are not used.
[in]p_noise_covThe noise covariance matrix.
[in]p_pcaCalculate pca or not.
[out]ch_namesSelected channel names
[out]gainGain matrix
[out]p_outNoiseCovnoise covariance matrix
[out]p_outWhitenerWhitener
[out]p_outNumNonZerothe rank (non zeros)

Definition at line 1100 of file mne_forwardsolution.cpp.

bool MNEForwardSolution::read ( QIODevice &  p_IODevice,
MNEForwardSolution fwd,
bool  force_fixed = false,
bool  surf_ori = false,
const QStringList &  include = defaultQStringList,
const QStringList &  exclude = defaultQStringList,
bool  bExcludeBads = true 
)
static

MNE toolbox root function ###: Implementation of the mne_read_forward_solution function

Reads a forward solution from a fif file

Parameters
[in]p_IODeviceA fiff IO device like a fiff QFile or QTCPSocket
[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)
[in]bExcludeBadsIf true bads are also read; default = false (optional)
Returns
true if succeeded, false otherwise

Definition at line 1192 of file mne_forwardsolution.cpp.

MNEForwardSolution MNEForwardSolution::reduce_forward_solution ( qint32  p_iNumDipoles,
MatrixXd &  p_D 
) const

reduces the forward solution and stores the result to p_fwdOut.

Parameters
[in]p_iNumDipolesDesired number of dipoles
[out]p_DThe reduction operator
Returns
reduced MNE forward solution

Definition at line 703 of file mne_forwardsolution.cpp.

void MNEForwardSolution::restrict_gain_matrix ( MatrixXd &  G,
const FiffInfo info 
)
static

Restrict gain matrix entries for optimal depth weighting

Parameters
[in,out]GGain matrix to be restricted; result is stored in place.
[in]infoFiff information

Definition at line 1769 of file mne_forwardsolution.cpp.

void MNEForwardSolution::to_fixed_ori ( )

Helper to convert the forward solution to fixed ori from free

Definition at line 1815 of file mne_forwardsolution.cpp.

VectorXi MNELIB::MNEForwardSolution::tripletSelection ( const VectorXi &  p_vecIdxSelection) const
inline

Prepares a forward solution, Bad channels, after clustering etc ToDo...

Parameters
[in]p_FiffInfoFif measurement info

Definition at line 416 of file mne_forwardsolution.h.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const MNELIB::MNEForwardSolution p_MNEForwardSolution 
)
friend

overloading the stream out operator<<

Parameters
[in]outThe stream to which the MNE forward solution should be assigned to.
[in]p_MNEForwardSolutionMNE forward solution which should be assigned to the stream.
Returns
the stream with the attached fiff projector

Definition at line 547 of file mne_forwardsolution.h.

Member Data Documentation

fiff_int_t MNELIB::MNEForwardSolution::coord_frame

Coil coordinate system definition

Definition at line 507 of file mne_forwardsolution.h.

FiffInfoBase MNELIB::MNEForwardSolution::info

light weighted measurement info

Definition at line 504 of file mne_forwardsolution.h.

FiffCoordTrans MNELIB::MNEForwardSolution::mri_head_t

MRI head coordinate transformation

Definition at line 512 of file mne_forwardsolution.h.

fiff_int_t MNELIB::MNEForwardSolution::nchan

Number of channels

Definition at line 509 of file mne_forwardsolution.h.

fiff_int_t MNELIB::MNEForwardSolution::nsource

Number of source dipoles

Definition at line 508 of file mne_forwardsolution.h.

FiffNamedMatrix::SDPtr MNELIB::MNEForwardSolution::sol

Forward solution

Definition at line 510 of file mne_forwardsolution.h.

FiffNamedMatrix::SDPtr MNELIB::MNEForwardSolution::sol_grad

ToDo...

Definition at line 511 of file mne_forwardsolution.h.

MatrixX3f MNELIB::MNEForwardSolution::source_nn

Source normals (number depends on fixed or free orientation)

Definition at line 515 of file mne_forwardsolution.h.

fiff_int_t MNELIB::MNEForwardSolution::source_ori

Source orientation: fixed or free

Definition at line 505 of file mne_forwardsolution.h.

MatrixX3f MNELIB::MNEForwardSolution::source_rr

Source locations

Definition at line 514 of file mne_forwardsolution.h.

MNESourceSpace MNELIB::MNEForwardSolution::src

Geometric description of the source spaces (hemispheres)

Definition at line 513 of file mne_forwardsolution.h.

bool MNELIB::MNEForwardSolution::surf_ori

If surface oriented

Definition at line 506 of file mne_forwardsolution.h.


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