In-memory FreeSurfer triangular cortical surface for one hemisphere. More...
#include <fs_surface.h>
Public Types | |
| typedef QSharedPointer< FsSurface > | SPtr |
| typedef QSharedPointer< const FsSurface > | ConstSPtr |
Public Member Functions | |
| FsSurface () | |
| FsSurface (const QString &p_sFile) | |
| FsSurface (const QString &subject_id, qint32 hemi, const QString &surf, const QString &subjects_dir) | |
| FsSurface (const QString &path, qint32 hemi, const QString &surf) | |
| ~FsSurface () | |
| void | clear () |
| qint32 | hemi () const |
| bool | isEmpty () const |
| QString | surf () const |
| const Eigen::MatrixX3f & | rr () const |
| const Eigen::MatrixX3i & | tris () const |
| const Eigen::MatrixX3f & | nn () const |
| const Eigen::VectorXf & | curv () const |
| const Eigen::Vector3f & | offset () const |
| Eigen::Vector3f & | offset () |
| QString | filePath () const |
| QString | fileName () const |
Static Public Member Functions | |
| static bool | read (const QString &subject_id, qint32 hemi, const QString &surf, const QString &subjects_dir, FsSurface &p_Surface, bool p_bLoadCurvature=true) |
| static bool | read (const QString &path, qint32 hemi, const QString &surf, FsSurface &p_Surface, bool p_bLoadCurvature=true) |
| static bool | read (const QString &p_sFileName, FsSurface &p_Surface, bool p_bLoadCurvature=true) |
| static Eigen::VectorXf | read_curv (const QString &p_sFileName) |
| static Eigen::MatrixX3f | compute_normals (const Eigen::MatrixX3f &rr, const Eigen::MatrixX3i &tris) |
| static qint32 | fread3 (QDataStream &stream) |
| static qint32 | fread3 (std::iostream &stream) |
| static Eigen::VectorXi | fread3_many (QDataStream &stream, qint32 count) |
| static Eigen::VectorXi | fread3_many (std::iostream &stream, qint32 count) |
In-memory FreeSurfer triangular cortical surface for one hemisphere.
Owns the vertex coordinate matrix (n_vertices × 3, Tk-surface RAS mm), the triangle index matrix (n_faces × 3, zero-based into the vertex array) and the hemisphere id (0 = lh, 1 = rh). Construction is purely an I/O operation: each constructor either takes a direct path to a lh.pial / rh.white / lh.inflated style binary surface file, or the subject_id / hemi / surf shorthand resolved against $SUBJECTS_DIR. The instance is intended to be paired with an FsAnnotation or FsLabel sharing the same vertex indexing.
Definition at line 91 of file fs_surface.h.
| typedef QSharedPointer<const FsSurface> FSLIB::FsSurface::ConstSPtr |
Const shared pointer type for FsSurface class.
Definition at line 95 of file fs_surface.h.
| typedef QSharedPointer<FsSurface> FSLIB::FsSurface::SPtr |
Shared pointer type for FsSurface class.
Definition at line 94 of file fs_surface.h.
| FsSurface::FsSurface | ( | ) |
Default constructor
Definition at line 41 of file fs_surface.cpp.
|
explicit |
Construts the surface by reading it of the given file.
| [in] | p_sFile | FsSurface file name with path. |
Definition at line 52 of file fs_surface.cpp.
|
explicit |
Construts the surface by reading it of the given file.
| [in] | subject_id | Name of subject. |
| [in] | hemi | Which hemisphere to load {0 -> lh, 1 -> rh}. |
| [in] | surf | Name of the surface to load (eg. inflated, orig ...). |
| [in] | subjects_dir | Subjects directory. |
Definition at line 64 of file fs_surface.cpp.
|
explicit |
Construts the surface by reading it of the given file.
| [in] | path | path to surface directory. |
| [in] | hemi | Which hemisphere to load {0 -> lh, 1 -> rh}. |
| [in] | surf | Name of the surface to load (eg. inflated, orig ...). |
Definition at line 76 of file fs_surface.cpp.
| FsSurface::~FsSurface | ( | ) |
Destroys the FsSurface class.
Definition at line 88 of file fs_surface.cpp.
| void FsSurface::clear | ( | ) |
Initializes the FsSurface.
Definition at line 94 of file fs_surface.cpp.
|
static |
Efficiently compute vertex normals for triangulated surface
Definition at line 108 of file fs_surface.cpp.
|
inline |
FreeSurfer curvature
Definition at line 397 of file fs_surface.h.
|
inline |
|
inline |
path to surf directuryt
Definition at line 418 of file fs_surface.h.
|
static |
Reads a 3-byte integer out of a QDataStream (FreeSurfer format).
| [in] | stream | Stream to read from. |
Definition at line 439 of file fs_surface.cpp.
|
static |
Reads a 3-byte integer out of a std::iostream (FreeSurfer format).
| [in] | stream | Stream to read from. |
Definition at line 448 of file fs_surface.cpp.
|
static |
Reads multiple 3-byte integers out of a QDataStream (FreeSurfer format).
| [in] | stream | Stream to read from. |
| [in] | count | Number of elements to read. |
Definition at line 457 of file fs_surface.cpp.
|
static |
Reads multiple 3-byte integers out of a std::iostream (FreeSurfer format).
| [in] | stream | Stream to read from. |
| [in] | count | Number of elements to read. |
Definition at line 467 of file fs_surface.cpp.
|
inline |
Returns the hemisphere id (0 = lh; 1 = rh)
Definition at line 355 of file fs_surface.h.
|
inline |
Returns whether FsSurface is empty.
Definition at line 362 of file fs_surface.h.
|
inline |
Normalized surface normals for each vertex
Definition at line 390 of file fs_surface.h.
|
inline |
|
inline |
|
static |
mne_read_surface
Reads a FreeSurfer surface file
| [in] | p_sFileName | The file to read. |
| [out] | p_Surface | The read surface. |
| [in] | p_bLoadCurvature | True if the curvature should be read (optional, default = true). |
Definition at line 183 of file fs_surface.cpp.
|
static |
mne_read_surface
Reads a FreeSurfer surface file
| [in] | path | path to surface directory. |
| [in] | hemi | Which hemisphere to load {0 -> lh, 1 -> rh}. |
| [in] | surf | Name of the surface to load (eg. inflated, orig ...). |
| [out] | p_Surface | The read surface. |
| [in] | p_bLoadCurvature | True if the curvature should be read (optional, default = true). |
Definition at line 171 of file fs_surface.cpp.
|
static |
mne_read_surface
Reads a FreeSurfer surface file
| [in] | subject_id | Name of subject. |
| [in] | hemi | Which hemisphere to load {0 -> lh, 1 -> rh}. |
| [in] | surf | Name of the surface to load (eg. inflated, orig ...). |
| [in] | subjects_dir | Subjects directory. |
| [out] | p_Surface | The read surface. |
| [in] | p_bLoadCurvature | True if the curvature should be read (optional, default = true). |
Definition at line 159 of file fs_surface.cpp.
|
static |
reads a binary curvature file into a vector
Definition at line 385 of file fs_surface.cpp.
|
inline |
Coordinates of vertices (rr)
Definition at line 376 of file fs_surface.h.
|
inline |
Loaded surface (eg. inflated, orig ...)
Definition at line 369 of file fs_surface.h.
|
inline |
The triangle descriptions
Definition at line 383 of file fs_surface.h.