v2.0.0
Loading...
Searching...
No Matches
FIFFLIB::FiffRawData Class Reference

Continuous FIFF raw recording: FiffInfo plus a random-access directory of FIFF_DATA_BUFFER tags. More...

#include <fiff_raw_data.h>

Public Types

using SPtr = QSharedPointer<FiffRawData>
using ConstSPtr = QSharedPointer<const FiffRawData>
using UPtr = std::unique_ptr<FiffRawData>
using ConstUPtr = std::unique_ptr<const FiffRawData>

Public Member Functions

 FiffRawData ()
 FiffRawData (const FiffRawData &p_FiffRawData)
FiffRawData & operator= (const FiffRawData &other)=default
 FiffRawData (QIODevice &p_IODevice)
 FiffRawData (QIODevice &p_IODevice, bool b_littleEndian)
 ~FiffRawData ()
void clear ()
bool isEmpty () const
bool read_raw_segment (Eigen::MatrixXd &data, Eigen::MatrixXd &times, fiff_int_t from=-1, fiff_int_t to=-1, const Eigen::RowVectorXi &sel=defaultRowVectorXi, bool do_debug=false) const
bool read_raw_segment (Eigen::MatrixXd &data, Eigen::MatrixXd &times, Eigen::SparseMatrix< double > &multSegment, fiff_int_t from=-1, fiff_int_t to=-1, const Eigen::RowVectorXi &sel=defaultRowVectorXi, bool do_debug=false) const
bool read_raw_segment_times (Eigen::MatrixXd &data, Eigen::MatrixXd &times, float from, float to, const Eigen::RowVectorXi &sel=defaultRowVectorXi) const
bool save (QIODevice &p_IODevice, const Eigen::RowVectorXi &picks=Eigen::RowVectorXi(), int decim=1, int from=-1, int to=-1) const

Public Attributes

FiffStream::SPtr file
FiffInfo info
fiff_int_t first_samp
fiff_int_t last_samp
Eigen::RowVectorXd cals
QList< FiffRawDir > rawdir
Eigen::MatrixXd proj
FiffCtfComp comp

Detailed Description

Continuous FIFF raw recording: FiffInfo plus a random-access directory of FIFF_DATA_BUFFER tags.

The directory built into FiffRawDir lets segment reads jump straight to the buffers covering the requested sample window, decode them through the channel cals and active projectors and return a contiguous channel × sample Eigen matrix without rescanning the file.

Open a recording and pick the MEG channels plus the trigger channel:

Read a window of the picked channels, in seconds or in samples:

Definition at line 82 of file fiff_raw_data.h.

Member Typedef Documentation

◆ ConstSPtr

using FIFFLIB::FiffRawData::ConstSPtr = QSharedPointer<const FiffRawData>

Const shared pointer type for FiffRawData.

Definition at line 86 of file fiff_raw_data.h.

◆ ConstUPtr

using FIFFLIB::FiffRawData::ConstUPtr = std::unique_ptr<const FiffRawData>

Const unique pointer type for FiffRawData.

Definition at line 88 of file fiff_raw_data.h.

◆ SPtr

using FIFFLIB::FiffRawData::SPtr = QSharedPointer<FiffRawData>

Shared pointer type for FiffRawData.

Definition at line 85 of file fiff_raw_data.h.

◆ UPtr

using FIFFLIB::FiffRawData::UPtr = std::unique_ptr<FiffRawData>

Unique pointer type for FiffRawData.

Definition at line 87 of file fiff_raw_data.h.

Constructor & Destructor Documentation

◆ FiffRawData() [1/4]

FiffRawData::FiffRawData ( )

Default constructor.

Definition at line 44 of file fiff_raw_data.cpp.

◆ FiffRawData() [2/4]

FiffRawData::FiffRawData ( const FiffRawData & p_FiffRawData)

Copy constructor.

Parameters
[in]p_FiffRawDataFIFF raw measurement which should be copied.

Definition at line 76 of file fiff_raw_data.cpp.

◆ FiffRawData() [3/4]

FiffRawData::FiffRawData ( QIODevice & p_IODevice)

Constructs fiff raw data, by reading from a IO device.

Parameters
[in]p_IODeviceIO device to read the raw data from .

Definition at line 52 of file fiff_raw_data.cpp.

◆ FiffRawData() [4/4]

FiffRawData::FiffRawData ( QIODevice & p_IODevice,
bool b_littleEndian )

Constructs fiff raw data, by reading from a IO device with specified endianness.

Parameters
[in]p_IODeviceIO device to read the raw data from.
[in]b_littleEndianIf true, read data as little-endian.

Definition at line 64 of file fiff_raw_data.cpp.

◆ ~FiffRawData()

FiffRawData::~FiffRawData ( )

Destroys the FiffInfo.

Definition at line 90 of file fiff_raw_data.cpp.

Member Function Documentation

◆ clear()

void FiffRawData::clear ( )

Initializes the fiff raw measurement data.

Definition at line 96 of file fiff_raw_data.cpp.

◆ isEmpty()

bool FIFFLIB::FiffRawData::isEmpty ( ) const
inline

True if fiff raw data are empty.

Returns
true if fiff raw data are empty.

Definition at line 152 of file fiff_raw_data.h.

◆ operator=()

FiffRawData & FIFFLIB::FiffRawData::operator= ( const FiffRawData & other)
default

Copy assignment. Every member has value semantics, so the compiler-generated member-wise assignment is correct. It is declared explicitly because declaring a copy constructor and/or a destructor deprecates the implicitly generated one.

Parameters
[in]otherObject to assign from.
Returns
reference to this object.

◆ read_raw_segment() [1/2]

bool FIFFLIB::FiffRawData::read_raw_segment ( Eigen::MatrixXd & data,
Eigen::MatrixXd & times,
Eigen::SparseMatrix< double > & multSegment,
fiff_int_t from = -1,
fiff_int_t to = -1,
const Eigen::RowVectorXi & sel = defaultRowVectorXi,
bool do_debug = false ) const

Read a specific raw data segment

Parameters
[out]datareturns the data matrix (channels x samples).
[out]timesreturns the time values corresponding to the samples.
[out]multSegmentused multiplication matrix (compensator,projection,calibration).
[in]fromfirst sample to include. If omitted, defaults to the first sample in data (optional).
[in]tolast sample to include. If omitted, defaults to the last sample in data (optional).
[in]selchannel selection vector (optional).
[in]do_debugPrint diagnostic output while reading.
Returns
true if succeeded, false otherwise.

◆ read_raw_segment() [2/2]

bool FIFFLIB::FiffRawData::read_raw_segment ( Eigen::MatrixXd & data,
Eigen::MatrixXd & times,
fiff_int_t from = -1,
fiff_int_t to = -1,
const Eigen::RowVectorXi & sel = defaultRowVectorXi,
bool do_debug = false ) const

Read a specific raw data segment

Parameters
[out]datareturns the data matrix (channels x samples).
[out]timesreturns the time values corresponding to the samples.
[in]fromfirst sample to include. If omitted, defaults to the first sample in data (optional).
[in]tolast sample to include. If omitted, defaults to the last sample in data (optional).
[in]selchannel selection vector (optional).
[in]do_debugPrint diagnostic output while reading.
Returns
true if succeeded, false otherwise.

◆ read_raw_segment_times()

bool FiffRawData::read_raw_segment_times ( Eigen::MatrixXd & data,
Eigen::MatrixXd & times,
float from,
float to,
const Eigen::RowVectorXi & sel = defaultRowVectorXi ) const

Read a specific raw data segment

Parameters
[out]datareturns the data matrix (channels x samples).
[out]timesreturns the time values corresponding to the samples.
[in]fromstarting time of the segment in seconds.
[in]toend time of the segment in seconds.
[in]seloptional channel selection vector.
Returns
true if succeeded, false otherwise.

Definition at line 719 of file fiff_raw_data.cpp.

◆ save()

bool FiffRawData::save ( QIODevice & p_IODevice,
const Eigen::RowVectorXi & picks = Eigen::RowVectorXi(),
int decim = 1,
int from = -1,
int to = -1 ) const

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

Parameters
[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 738 of file fiff_raw_data.cpp.

Member Data Documentation

◆ cals

Eigen::RowVectorXd FIFFLIB::FiffRawData::cals

Calibration values.

Definition at line 241 of file fiff_raw_data.h.

◆ comp

FiffCtfComp FIFFLIB::FiffRawData::comp

Compensator.

Definition at line 244 of file fiff_raw_data.h.

◆ file

FiffStream::SPtr FIFFLIB::FiffRawData::file

replaces fid.

Definition at line 237 of file fiff_raw_data.h.

◆ first_samp

fiff_int_t FIFFLIB::FiffRawData::first_samp

First sample number.

Definition at line 239 of file fiff_raw_data.h.

◆ info

FiffInfo FIFFLIB::FiffRawData::info

Fiff measurement information.

Definition at line 238 of file fiff_raw_data.h.

◆ last_samp

fiff_int_t FIFFLIB::FiffRawData::last_samp

Last sample number.

Definition at line 240 of file fiff_raw_data.h.

◆ proj

Eigen::MatrixXd FIFFLIB::FiffRawData::proj

SSP operator to apply to the data.

Definition at line 243 of file fiff_raw_data.h.

◆ rawdir

QList<FiffRawDir> FIFFLIB::FiffRawData::rawdir

Special fiff directory entry for raw data.

Definition at line 242 of file fiff_raw_data.h.


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