MNE-CPP  0.1.9
A Framework for Electrophysiology
Public Types | Public Member Functions | Static Public Member Functions | List of all members
UTILSLIB::IOUtils Class Reference

IO utilitie routines. More...

#include <ioutils.h>

Public Types

typedef QSharedPointer< IOUtilsSPtr
 
typedef QSharedPointer< const IOUtilsConstSPtr
 

Public Member Functions

 ~IOUtils ()
 

Static Public Member Functions

static qint32 fread3 (QDataStream &p_qStream)
 
static qint32 fread3 (std::iostream &stream)
 
static Eigen::VectorXi fread3_many (QDataStream &p_qStream, qint32 count)
 
static Eigen::VectorXi fread3_many (std::iostream &stream, qint32 count)
 
static qint16 swap_short (qint16 source)
 
static qint32 swap_int (qint32 source)
 
static void swap_intp (qint32 *source)
 
static qint64 swap_long (qint64 source)
 
static void swap_longp (qint64 *source)
 
static float swap_float (float source)
 
static void swap_floatp (float *source)
 
static void swap_doublep (double *source)
 
template<typename T >
static bool write_eigen_matrix (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &in, const QString &sPath, const QString &sDescription=QString())
 
template<typename T >
static bool write_eigen_matrix (const Eigen::Matrix< T, 1, Eigen::Dynamic > &in, const QString &sPath, const QString &sDescription=QString())
 
template<typename T >
static bool write_eigen_matrix (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &in, const QString &sPath, const QString &sDescription=QString())
 
template<typename T >
static bool write_eigen_matrix (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &in, const std::string &sPath, const std::string &sDescription=std::string())
 
template<typename T >
static bool write_eigen_matrix (const Eigen::Matrix< T, 1, Eigen::Dynamic > &in, const std::string &sPath, const std::string &sDescription=std::string())
 
template<typename T >
static bool write_eigen_matrix (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &in, const std::string &sPath, const std::string &sDescription=std::string())
 
template<typename T >
static bool read_eigen_matrix (Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &out, const QString &path)
 
template<typename T >
static bool read_eigen_matrix (Eigen::Matrix< T, 1, Eigen::Dynamic > &out, const QString &path)
 
template<typename T >
static bool read_eigen_matrix (Eigen::Matrix< T, Eigen::Dynamic, 1 > &out, const QString &path)
 
template<typename T >
static bool read_eigen_matrix (Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &out, const std::string &path)
 
template<typename T >
static bool read_eigen_matrix (Eigen::Matrix< T, 1, Eigen::Dynamic > &out, const std::string &path)
 
template<typename T >
static bool read_eigen_matrix (Eigen::Matrix< T, Eigen::Dynamic, 1 > &out, const std::string &path)
 
static QStringList get_new_chnames_conventions (const QStringList &chNames)
 
static std::vector< std::string > get_new_chnames_conventions (const std::vector< std::string > &chNames)
 
static QStringList get_old_chnames_conventions (const QStringList &chNames)
 
static std::vector< std::string > get_old_chnames_conventions (const std::vector< std::string > &chNames)
 
static bool check_matching_chnames_conventions (const QStringList &chNamesA, const QStringList &chNamesB, bool bCheckForNewNamingConvention=false)
 
static bool check_matching_chnames_conventions (const std::vector< std::string > &chNamesA, const std::vector< std::string > &chNamesB, bool bCheckForNewNamingConvention=false)
 

Detailed Description

IO utilitie routines.

IO utilitie routines

Definition at line 94 of file ioutils.h.

Member Typedef Documentation

◆ ConstSPtr

typedef QSharedPointer<const IOUtils> UTILSLIB::IOUtils::ConstSPtr

Const shared pointer type for IOUtils class.

Definition at line 98 of file ioutils.h.

◆ SPtr

typedef QSharedPointer<IOUtils> UTILSLIB::IOUtils::SPtr

Shared pointer type for IOUtils class.

Definition at line 97 of file ioutils.h.

Constructor & Destructor Documentation

◆ ~IOUtils()

UTILSLIB::IOUtils::~IOUtils ( )
inline

Destroys the IOUtils class.

Definition at line 104 of file ioutils.h.

Member Function Documentation

◆ check_matching_chnames_conventions() [1/2]

bool IOUtils::check_matching_chnames_conventions ( const QStringList &  chNamesA,
const QStringList &  chNamesB,
bool  bCheckForNewNamingConvention = false 
)
static

Checks if all names from chNamesA are in chNamesB. If wanted each name in chNamesA is transformed to the old and new naming convention and checked if in chNamesB.

Parameters
[in]chNamesAThe channel names.
[in]chNamesBThe channel names which is to be compared to.
[in]bCheckForNewNamingConventionWhether to use old and new naming conventions while checking.
Returns
True if all names in chNamesA are present in chNamesB, false otherwise.

Definition at line 334 of file ioutils.cpp.

◆ check_matching_chnames_conventions() [2/2]

bool IOUtils::check_matching_chnames_conventions ( const std::vector< std::string > &  chNamesA,
const std::vector< std::string > &  chNamesB,
bool  bCheckForNewNamingConvention = false 
)
static

Checks if all names from chNamesA are in chNamesB. If wanted each name in chNamesA is transformed to the old and new naming convention and checked if in chNamesB.

Parameters
[in]chNamesAThe channel names.
[in]chNamesBThe channel names which is to be compared to.
[in]bCheckForNewNamingConventionWhether to use old and new naming conventions while checking.
Returns
True if all names in chNamesA are present in chNamesB, false otherwise.

Definition at line 383 of file ioutils.cpp.

◆ fread3() [1/2]

qint32 IOUtils::fread3 ( QDataStream &  p_qStream)
static

mne_fread3(fid)

Reads a 3-byte integer out of a stream

Parameters
[in]p_qStreamStream to read from.
Returns
the read 3-byte integer.

Definition at line 69 of file ioutils.cpp.

◆ fread3() [2/2]

qint32 IOUtils::fread3 ( std::iostream &  stream)
static

mne_fread3(fid)

Reads a 3-byte integer out of a stream

Parameters
[in]streamStream to read from.
Returns
the read 3-byte integer.

Definition at line 80 of file ioutils.cpp.

◆ fread3_many() [1/2]

VectorXi IOUtils::fread3_many ( QDataStream &  p_qStream,
qint32  count 
)
static

fread3_many(fid,count)

Reads a 3-byte integer out of a stream

Parameters
[in]p_qStreamStream to read from.
[in]countNumber of elements to read.
Returns
the read 3-byte integer.

Definition at line 91 of file ioutils.cpp.

◆ fread3_many() [2/2]

VectorXi IOUtils::fread3_many ( std::iostream &  stream,
qint32  count 
)
static

fread3_many(fid,count)

Reads a 3-byte integer out of a stream

Parameters
[in]streamStream to read from.
[in]countNumber of elements to read.
Returns
the read 3-byte integer.

Definition at line 103 of file ioutils.cpp.

◆ get_new_chnames_conventions() [1/2]

QStringList IOUtils::get_new_chnames_conventions ( const QStringList &  chNames)
static

Returns the new channel naming conventions (whitespcae between channel type and number) for the input list.

Parameters
[in]chNamesThe channel names.
Returns
The new channel names.

Definition at line 267 of file ioutils.cpp.

◆ get_new_chnames_conventions() [2/2]

std::vector< std::string > IOUtils::get_new_chnames_conventions ( const std::vector< std::string > &  chNames)
static

Returns the new channel naming conventions (whitespcae between channel type and number) for the input list.

Parameters
[in]chNamesThe channel names.
Returns
The new channel names.

Definition at line 283 of file ioutils.cpp.

◆ get_old_chnames_conventions() [1/2]

QStringList IOUtils::get_old_chnames_conventions ( const QStringList &  chNames)
static

Returns the old channel naming conventions (whitespcae between channel type and number) for the input list.

Parameters
[in]chNamesThe channel names.
Returns
The new channel names.

Definition at line 297 of file ioutils.cpp.

◆ get_old_chnames_conventions() [2/2]

std::vector< std::string > IOUtils::get_old_chnames_conventions ( const std::vector< std::string > &  chNames)
static

Returns the old channel naming conventions (whitespcae between channel type and number) for the input list.

Parameters
[in]chNamesThe channel names.
Returns
The new channel names.

Definition at line 320 of file ioutils.cpp.

◆ read_eigen_matrix() [1/2]

template<typename T >
bool UTILSLIB::IOUtils::read_eigen_matrix ( Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &  out,
const QString &  path 
)
static

Read Eigen Matrix from file

Parameters
[out]outoutput eigen value.
[in]pathpath and file name to read from.

Definition at line 481 of file ioutils.h.

◆ read_eigen_matrix() [2/2]

template<typename T >
bool UTILSLIB::IOUtils::read_eigen_matrix ( Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &  out,
const std::string &  path 
)
static

Read Eigen Matrix from file

Parameters
[out]outoutput eigen value.
[in]pathpath and file name to read from.

Definition at line 561 of file ioutils.h.

◆ swap_doublep()

void IOUtils::swap_doublep ( double *  source)
static

swap double

Parameters
[in,out]sourcedouble to swap.

Definition at line 240 of file ioutils.cpp.

◆ swap_float()

float IOUtils::swap_float ( float  source)
static

swap float

Parameters
[in]sourcefloat to swap.
Returns
swapped float.

Definition at line 207 of file ioutils.cpp.

◆ swap_floatp()

void IOUtils::swap_floatp ( float *  source)
static

swap float

Parameters
[in,out]sourcefloat to swap.

Definition at line 222 of file ioutils.cpp.

◆ swap_int()

qint32 IOUtils::swap_int ( qint32  source)
static

swap integer

Parameters
[in]sourceinteger to swap.
Returns
swapped integer.

Definition at line 128 of file ioutils.cpp.

◆ swap_intp()

void IOUtils::swap_intp ( qint32 *  source)
static

swap integer

Parameters
[in,out]sourceinteger to swap.

Definition at line 143 of file ioutils.cpp.

◆ swap_long()

qint64 IOUtils::swap_long ( qint64  source)
static

swap long

Parameters
[in]sourcelong to swap.
Returns
swapped long.

Definition at line 162 of file ioutils.cpp.

◆ swap_longp()

void IOUtils::swap_longp ( qint64 *  source)
static

swap long

Parameters
[in,out]sourcelong to swap.

Definition at line 181 of file ioutils.cpp.

◆ swap_short()

qint16 IOUtils::swap_short ( qint16  source)
static

swap short

Parameters
[in]sourceshort to swap.
Returns
swapped short.

Definition at line 115 of file ioutils.cpp.

◆ write_eigen_matrix() [1/2]

template<typename T >
bool UTILSLIB::IOUtils::write_eigen_matrix ( const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &  in,
const QString &  sPath,
const QString &  sDescription = QString() 
)
static

Write Eigen Matrix to file

Parameters
[in]ininput eigen value which is to be written to file.
[in]pathpath and file name to write to.

Definition at line 374 of file ioutils.h.

◆ write_eigen_matrix() [2/2]

template<typename T >
bool UTILSLIB::IOUtils::write_eigen_matrix ( const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &  in,
const std::string &  sPath,
const std::string &  sDescription = std::string() 
)
static

Write Eigen Matrix to file

Parameters
[in]ininput eigen value which is to be written to file.
[in]pathpath and file name to write to.

Definition at line 423 of file ioutils.h.


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