MNE-CPP 0.1.9
A Framework for Electrophysiology
Loading...
Searching...
No Matches
Macros | Functions
mne_surface_or_volume.cpp File Reference

Definition of the MNE Surface or Volume (MneSurfaceOrVolume) Class. More...

#include "mne_surface_or_volume.h"
#include "mne_surface_old.h"
#include "mne_source_space_old.h"
#include "mne_patch_info.h"
#include "mne_nearest.h"
#include "filter_thread_arg.h"
#include "mne_triangle.h"
#include "mne_msh_display_surface.h"
#include "mne_proj_data.h"
#include "mne_vol_geom.h"
#include "mne_mgh_tag_group.h"
#include "mne_mgh_tag.h"
#include <fiff/fiff_stream.h>
#include <fiff/c/fiff_digitizer_data.h>
#include <fiff/fiff_dig_point.h>
#include <utils/sphere.h>
#include <utils/ioutils.h>
#include <QFile>
#include <QCoreApplication>
#include <QtConcurrent>
#include <math.h>
#include <Eigen/Dense>
#include <Eigen/Sparse>
#include <unistd.h>
Include dependency graph for mne_surface_or_volume.cpp:

Go to the source code of this file.

Macros

#define _USE_MATH_DEFINES
 
#define TRUE   1
 
#define FALSE   0
 
#define FAIL   -1
 
#define OK   0
 
#define X_17   0
 
#define Y_17   1
 
#define Z_17   2
 
#define VEC_DOT_17(x, y)   ((x)[X_17]*(y)[X_17] + (x)[Y_17]*(y)[Y_17] + (x)[Z_17]*(y)[Z_17])
 
#define VEC_LEN_17(x)   sqrt(VEC_DOT_17(x,x))
 
#define VEC_DIFF_17(from, to, diff)
 
#define VEC_COPY_17(to, from)
 
#define CROSS_PRODUCT_17(x, y, xy)
 
#define MALLOC_17(x, t)   (t *)malloc((x)*sizeof(t))
 
#define REALLOC_17(x, y, t)   (t *)((x == NULL) ? malloc((y)*sizeof(t)) : realloc((x),(y)*sizeof(t)))
 
#define ALLOC_INT_17(x)   MALLOC_17(x,int)
 
#define ALLOC_CMATRIX_17(x, y)   mne_cmatrix_17((x),(y))
 
#define FREE_17(x)   if ((char *)(x) != NULL) free((char *)(x))
 
#define FREE_CMATRIX_17(m)   mne_free_cmatrix_17((m))
 
#define FREE_ICMATRIX_17(m)   mne_free_icmatrix_17((m))
 
#define NNEIGHBORS   26
 
#define CURVATURE_FILE_MAGIC_NUMBER   (16777215)
 
#define TAG_MGH_XFORM   31
 
#define TAG_SURF_GEOM   21
 
#define TAG_OLD_USEREALRAS   2
 
#define TAG_COLORTABLE   5
 
#define TAG_OLD_MGH_XFORM   30
 
#define TAG_OLD_COLORTABLE   1
 
#define TAG_USEREALRAS   4
 
#define ALLOC_ICMATRIX_17(x, y)   mne_imatrix_17((x),(y))
 
#define LH_LABEL_TAG   "-lh.label"
 
#define RH_LABEL_TAG   "-rh.label"
 
#define EVEN(n)   ((((n) / 2) * 2) == n)
 

Functions

float ** mne_cmatrix_17 (int numPoints, int numDim)
 
void mne_free_cmatrix_17 (float **m)
 
void mne_free_icmatrix_17 (int **m)
 
int ** mne_imatrix_17 (int nr, int nc)
 
Eigen::MatrixXf toFloatEigenMatrix_17 (float **mat, const int m, const int n)
 
void fromFloatEigenMatrix_17 (const Eigen::MatrixXf &from_mat, float **&to_mat, const int m, const int n)
 
void fromFloatEigenMatrix_17 (const Eigen::MatrixXf &from_mat, float **&to_mat)
 
void fromIntEigenMatrix_17 (const Eigen::MatrixXi &from_mat, int **&to_mat, const int m, const int n)
 
void fromIntEigenMatrix_17 (const Eigen::MatrixXi &from_mat, int **&to_mat)
 
void mne_sort_nearest_by_nearest (MneNearest *points, int npoint)
 

Detailed Description

Definition of the MNE Surface or Volume (MneSurfaceOrVolume) Class.

Author
Lorenz Esch lesch.nosp@m.@mgh.nosp@m..harv.nosp@m.ard..nosp@m.edu; Matti Hamalainen msh@n.nosp@m.mr.m.nosp@m.gh.ha.nosp@m.rvar.nosp@m.d.edu; Christoph Dinh chdin.nosp@m.h@nm.nosp@m.r.mgh.nosp@m..har.nosp@m.vard..nosp@m.edu
Since
0.1.0
Date
January, 2017

LICENSE

Copyright (C) 2017, Lorenz Esch, Matti Hamalainen, Christoph Dinh. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file mne_surface_or_volume.cpp.

Macro Definition Documentation

◆ _USE_MATH_DEFINES

#define _USE_MATH_DEFINES

Definition at line 66 of file mne_surface_or_volume.cpp.

◆ ALLOC_CMATRIX_17

#define ALLOC_CMATRIX_17 (   x,
 
)    mne_cmatrix_17((x),(y))

Definition at line 137 of file mne_surface_or_volume.cpp.

◆ ALLOC_ICMATRIX_17

#define ALLOC_ICMATRIX_17 (   x,
 
)    mne_imatrix_17((x),(y))

Definition at line 217 of file mne_surface_or_volume.cpp.

◆ ALLOC_INT_17

#define ALLOC_INT_17 (   x)    MALLOC_17(x,int)

Definition at line 135 of file mne_surface_or_volume.cpp.

◆ CROSS_PRODUCT_17

#define CROSS_PRODUCT_17 (   x,
  y,
  xy 
)
Value:
{\
(xy)[X_17] = (x)[Y_17]*(y)[Z_17]-(y)[Y_17]*(x)[Z_17];\
(xy)[Y_17] = -((x)[X_17]*(y)[Z_17]-(y)[X_17]*(x)[Z_17]);\
(xy)[Z_17] = (x)[X_17]*(y)[Y_17]-(y)[X_17]*(x)[Y_17];\
}

Definition at line 125 of file mne_surface_or_volume.cpp.

◆ CURVATURE_FILE_MAGIC_NUMBER

#define CURVATURE_FILE_MAGIC_NUMBER   (16777215)

Definition at line 206 of file mne_surface_or_volume.cpp.

◆ FAIL

#define FAIL   -1

Definition at line 98 of file mne_surface_or_volume.cpp.

◆ FALSE

#define FALSE   0

Definition at line 94 of file mne_surface_or_volume.cpp.

◆ FREE_17

#define FREE_17 (   x)    if ((char *)(x) != NULL) free((char *)(x))

Definition at line 181 of file mne_surface_or_volume.cpp.

◆ FREE_CMATRIX_17

#define FREE_CMATRIX_17 (   m)    mne_free_cmatrix_17((m))

Definition at line 183 of file mne_surface_or_volume.cpp.

◆ FREE_ICMATRIX_17

#define FREE_ICMATRIX_17 (   m)    mne_free_icmatrix_17((m))

Definition at line 185 of file mne_surface_or_volume.cpp.

◆ LH_LABEL_TAG

#define LH_LABEL_TAG   "-lh.label"

Definition at line 2110 of file mne_surface_or_volume.cpp.

◆ MALLOC_17

#define MALLOC_17 (   x,
 
)    (t *)malloc((x)*sizeof(t))

Definition at line 131 of file mne_surface_or_volume.cpp.

◆ NNEIGHBORS

#define NNEIGHBORS   26

Definition at line 204 of file mne_surface_or_volume.cpp.

◆ OK

#define OK   0

Definition at line 102 of file mne_surface_or_volume.cpp.

◆ REALLOC_17

#define REALLOC_17 (   x,
  y,
 
)    (t *)((x == NULL) ? malloc((y)*sizeof(t)) : realloc((x),(y)*sizeof(t)))

Definition at line 133 of file mne_surface_or_volume.cpp.

◆ RH_LABEL_TAG

#define RH_LABEL_TAG   "-rh.label"

Definition at line 2111 of file mne_surface_or_volume.cpp.

◆ TAG_COLORTABLE

#define TAG_COLORTABLE   5

Definition at line 211 of file mne_surface_or_volume.cpp.

◆ TAG_MGH_XFORM

#define TAG_MGH_XFORM   31

Definition at line 208 of file mne_surface_or_volume.cpp.

◆ TAG_OLD_COLORTABLE

#define TAG_OLD_COLORTABLE   1

Definition at line 213 of file mne_surface_or_volume.cpp.

◆ TAG_OLD_MGH_XFORM

#define TAG_OLD_MGH_XFORM   30

Definition at line 212 of file mne_surface_or_volume.cpp.

◆ TAG_OLD_USEREALRAS

#define TAG_OLD_USEREALRAS   2

Definition at line 210 of file mne_surface_or_volume.cpp.

◆ TAG_SURF_GEOM

#define TAG_SURF_GEOM   21

Definition at line 209 of file mne_surface_or_volume.cpp.

◆ TAG_USEREALRAS

#define TAG_USEREALRAS   4

Definition at line 215 of file mne_surface_or_volume.cpp.

◆ TRUE

#define TRUE   1

Definition at line 90 of file mne_surface_or_volume.cpp.

◆ VEC_COPY_17

#define VEC_COPY_17 (   to,
  from 
)
Value:
{\
(to)[X_17] = (from)[X_17];\
(to)[Y_17] = (from)[Y_17];\
(to)[Z_17] = (from)[Z_17];\
}

Definition at line 119 of file mne_surface_or_volume.cpp.

◆ VEC_DIFF_17

#define VEC_DIFF_17 (   from,
  to,
  diff 
)
Value:
{\
(diff)[X_17] = (to)[X_17] - (from)[X_17];\
(diff)[Y_17] = (to)[Y_17] - (from)[Y_17];\
(diff)[Z_17] = (to)[Z_17] - (from)[Z_17];\
}

Definition at line 113 of file mne_surface_or_volume.cpp.

◆ VEC_DOT_17

#define VEC_DOT_17 (   x,
 
)    ((x)[X_17]*(y)[X_17] + (x)[Y_17]*(y)[Y_17] + (x)[Z_17]*(y)[Z_17])

Definition at line 109 of file mne_surface_or_volume.cpp.

◆ VEC_LEN_17

#define VEC_LEN_17 (   x)    sqrt(VEC_DOT_17(x,x))

Definition at line 111 of file mne_surface_or_volume.cpp.

◆ X_17

#define X_17   0

Definition at line 105 of file mne_surface_or_volume.cpp.

◆ Y_17

#define Y_17   1

Definition at line 106 of file mne_surface_or_volume.cpp.

◆ Z_17

#define Z_17   2

Definition at line 107 of file mne_surface_or_volume.cpp.

Function Documentation

◆ fromFloatEigenMatrix_17() [1/2]

void fromFloatEigenMatrix_17 ( const Eigen::MatrixXf &  from_mat,
float **&  to_mat 
)

Definition at line 253 of file mne_surface_or_volume.cpp.

◆ fromFloatEigenMatrix_17() [2/2]

void fromFloatEigenMatrix_17 ( const Eigen::MatrixXf &  from_mat,
float **&  to_mat,
const int  m,
const int  n 
)

Definition at line 246 of file mne_surface_or_volume.cpp.

◆ fromIntEigenMatrix_17() [1/2]

void fromIntEigenMatrix_17 ( const Eigen::MatrixXi &  from_mat,
int **&  to_mat 
)

Definition at line 265 of file mne_surface_or_volume.cpp.

◆ fromIntEigenMatrix_17() [2/2]

void fromIntEigenMatrix_17 ( const Eigen::MatrixXi &  from_mat,
int **&  to_mat,
const int  m,
const int  n 
)

Definition at line 258 of file mne_surface_or_volume.cpp.

◆ mne_cmatrix_17()

float ** mne_cmatrix_17 ( int  numPoints,
int  numDim 
)

Definition at line 156 of file mne_surface_or_volume.cpp.

◆ mne_free_cmatrix_17()

void mne_free_cmatrix_17 ( float **  m)

Definition at line 187 of file mne_surface_or_volume.cpp.

◆ mne_free_icmatrix_17()

void mne_free_icmatrix_17 ( int **  m)

Definition at line 195 of file mne_surface_or_volume.cpp.

◆ mne_imatrix_17()

int ** mne_imatrix_17 ( int  nr,
int  nc 
)

Definition at line 219 of file mne_surface_or_volume.cpp.

◆ mne_sort_nearest_by_nearest()

void mne_sort_nearest_by_nearest ( MneNearest points,
int  npoint 
)

Definition at line 328 of file mne_surface_or_volume.cpp.

◆ toFloatEigenMatrix_17()

Eigen::MatrixXf toFloatEigenMatrix_17 ( float **  mat,
const int  m,
const int  n 
)

Definition at line 235 of file mne_surface_or_volume.cpp.