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

FIFF tag-stream reader/writer: wraps a QIODevice and exposes typed read_* / write_* methods for every FIFF block and record kind. More...

#include <fiff_stream.h>

Public Types

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

Public Member Functions

 FiffStream (QIODevice *p_pIODevice)
 FiffStream (QByteArray *a, QIODevice::OpenMode mode)
QString streamName ()
FiffId id () const
QList< FiffDirEntry::SPtr > & dir ()
const QList< FiffDirEntry::SPtr > & dir () const
int nent () const
const FiffDirNode::SPtr & dirtree () const
fiff_long_t end_block (fiff_int_t kind, fiff_int_t next=FIFFV_NEXT_SEQ)
void end_file ()
void finish_writing_raw ()
bool get_evoked_entries (const QList< FiffDirNode::SPtr > &evoked_node, QStringList &comments, QList< fiff_int_t > &aspect_kinds, QString &t)
bool open (QIODevice::OpenModeFlag mode=QIODevice::ReadOnly)
bool close ()
FiffDirNode::SPtr make_subtree (QList< FiffDirEntry::SPtr > &dentry)
QStringList read_bad_channels (const FiffDirNode::SPtr &p_Node)
void write_bad_channels (const QStringList &bads)
bool attach_env (const QString &workingDir, const QString &command)
bool read_cov (const FiffDirNode::SPtr &p_Node, fiff_int_t cov_kind, FiffCov &p_covData)
QList< FiffCtfComp > read_ctf_comp (const FiffDirNode::SPtr &p_Node, const QList< FiffChInfo > &p_Chs)
bool read_digitizer_data (const FiffDirNode::SPtr &p_Node, FiffDigitizerData &p_digData)
bool read_meas_info (const FiffDirNode::SPtr &p_Node, FiffInfo &p_Info, FiffDirNode::SPtr &p_NodeInfo)
bool read_meas_info_base (const FiffDirNode::SPtr &p_Node, FiffInfoBase &p_InfoForward)
bool read_named_matrix (const FiffDirNode::SPtr &p_Node, fiff_int_t matkind, FiffNamedMatrix &mat)
QList< FiffProj > read_proj (const FiffDirNode::SPtr &p_Node)
bool read_tag_data (std::unique_ptr< FiffTag > &p_pTag, fiff_long_t pos=-1)
fiff_long_t read_tag_info (std::unique_ptr< FiffTag > &p_pTag, bool p_bDoSkip=true)
bool read_rt_tag (std::unique_ptr< FiffTag > &p_pTag)
bool read_tag (std::unique_ptr< FiffTag > &p_pTag, fiff_long_t pos=-1)
fiff_long_t start_block (fiff_int_t kind)
fiff_long_t write_tag (const std::unique_ptr< FiffTag > &p_pTag, fiff_long_t pos=-1)
fiff_long_t write_ch_info (const FiffChInfo &ch)
fiff_long_t write_ch_pos (const FiffChPos &chpos)
fiff_long_t write_coord_trans (const FiffCoordTrans &trans)
fiff_long_t write_cov (const FiffCov &p_FiffCov)
fiff_long_t write_ctf_comp (const QList< FiffCtfComp > &comps)
fiff_long_t write_dig_point (const FiffDigPoint &dig)
fiff_long_t write_dir_pointer (fiff_int_t dirpos, fiff_long_t pos=-1, fiff_int_t next=FIFFV_NEXT_SEQ)
fiff_long_t write_dir_entries (const QList< FiffDirEntry::SPtr > &dir, fiff_long_t pos=-1)
fiff_long_t write_double (fiff_int_t kind, const double *data, fiff_int_t nel=1)
fiff_long_t write_id (fiff_int_t kind, const FiffId &id=FiffId::getDefault())
fiff_long_t write_info_base (const FiffInfoBase &p_FiffInfoBase)
fiff_long_t write_int (fiff_int_t kind, const fiff_int_t *data, fiff_int_t nel=1, fiff_int_t next=FIFFV_NEXT_SEQ)
fiff_long_t write_int_matrix (fiff_int_t kind, const Eigen::MatrixXi &mat)
fiff_long_t write_float (fiff_int_t kind, const float *data, fiff_int_t nel=1)
fiff_long_t write_float_matrix (fiff_int_t kind, const Eigen::MatrixXf &mat)
fiff_long_t write_float_sparse_ccs (fiff_int_t kind, const Eigen::SparseMatrix< float > &mat)
fiff_long_t write_float_sparse_rcs (fiff_int_t kind, const Eigen::SparseMatrix< float > &mat)
fiff_long_t write_name_list (fiff_int_t kind, const QStringList &data)
fiff_long_t write_named_matrix (fiff_int_t kind, const FiffNamedMatrix &mat)
fiff_long_t write_evoked_set (const FiffEvokedSet &p_FiffEvokedSet)
fiff_long_t write_proj (const QList< FiffProj > &projs)
bool write_raw_buffer (const Eigen::MatrixXd &buf, const Eigen::RowVectorXd &cals)
bool write_raw_buffer (const Eigen::MatrixXd &buf, const Eigen::SparseMatrix< double > &mult)
bool write_raw_buffer (const Eigen::MatrixXd &buf)
fiff_long_t write_string (fiff_int_t kind, const QString &data)
void write_rt_command (fiff_int_t command, const QString &data)

Static Public Member Functions

static bool setup_read_raw (QIODevice &p_IODevice, FiffRawData &data, bool allow_maxshield=true, bool is_littleEndian=false)
static QStringList split_name_list (QString p_sNameList)
static FiffStream::SPtr start_file (QIODevice &p_IODevice)
static FiffStream::SPtr open_update (QIODevice &p_IODevice)
static FiffStream::SPtr start_writing_raw (QIODevice &p_IODevice, const FiffInfo &info, Eigen::RowVectorXd &cals, Eigen::MatrixXi sel=defaultMatrixXi, bool bResetRange=true)
static bool copyProcessingHistory (const QString &fromPath, const QString &toPath)

Detailed Description

FIFF tag-stream reader/writer: wraps a QIODevice and exposes typed read_* / write_* methods for every FIFF block and record kind.

Reads or writes one QIODevice. Builds the FIFF directory and FiffDirNode block tree on open and exposes typed loaders / emitters for every structured record (id, channel info, coord trans, named matrix, dig point, projector, CTF comp, raw segment, evoked, covariance). The on-disk format is the Elekta/Neuromag FIFF specification — files emitted here round-trip through mne.io.fiff in MNE-Python without modification.

Definition at line 112 of file fiff_stream.h.

Inheritance diagram for FIFFLIB::FiffStream:
Inheritance graph

Member Typedef Documentation

◆ ConstSPtr

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

Const shared pointer type for FiffStream.

Definition at line 116 of file fiff_stream.h.

◆ ConstUPtr

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

Const unique pointer type for FiffStream.

Definition at line 118 of file fiff_stream.h.

◆ SPtr

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

Shared pointer type for FiffStream.

Definition at line 115 of file fiff_stream.h.

◆ UPtr

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

Unique pointer type for FiffStream.

Definition at line 117 of file fiff_stream.h.

Constructor & Destructor Documentation

◆ FiffStream() [1/2]

FiffStream::FiffStream ( QIODevice * p_pIODevice)
explicit

Constructs a fiff stream that uses the I/O device p_pIODevice.

Parameters
[in]p_pIODeviceA fiff IO device like a fiff QFile or QTCPSocket.

Definition at line 82 of file fiff_stream.cpp.

◆ FiffStream() [2/2]

FiffStream::FiffStream ( QByteArray * a,
QIODevice::OpenMode mode )
explicit

Constructs a fiff stream that operates on a byte array, a. The mode describes how the device is to be used.

Parameters
[in]aThe byte array.
[in]modeThe open mode.

Definition at line 92 of file fiff_stream.cpp.

Member Function Documentation

◆ attach_env()

bool FiffStream::attach_env ( const QString & workingDir,
const QString & command )

Attach environment metadata (working directory, command line) to this stream. Formerly mne_attach_env (SVN MNE).

The stream must already be opened for update (via open_update). Finds the first known top-level block (MNE, MEAS, MRI, or BEM) and inserts a FIFFB_MNE_ENV block with working directory and command-line string.

Parameters
[in]workingDirThe working directory to record.
[in]commandThe command-line string to record.
Returns
true on success, false on error.

Definition at line 416 of file fiff_stream.cpp.

◆ close()

bool FiffStream::close ( )

Close stream

  • Returns
    true if succeeded, false otherwise.

Definition at line 316 of file fiff_stream.cpp.

◆ copyProcessingHistory()

bool FiffStream::copyProcessingHistory ( const QString & fromPath,
const QString & toPath )
static

Copy the FIFF processing history block from one file to another.

Opens the source file, locates the FIFFB_PROCESSING_HISTORY block, reads all tags within it, then appends them to the destination file.

Parameters
[in]fromPathPath to the source FIFF file.
[in]toPathPath to the destination FIFF file.
Returns
true on success, false on error.
Since
2.2.0

Definition at line 3315 of file fiff_stream.cpp.

◆ dir() [1/2]

QList< FiffDirEntry::SPtr > & FiffStream::dir ( )

Returns the directory compiled into a tree dir is set when open() was called.

Returns
the directory.

Definition at line 124 of file fiff_stream.cpp.

◆ dir() [2/2]

const QList< FiffDirEntry::SPtr > & FiffStream::dir ( ) const

Returns the directory compiled into a tree dir is set when open() was called.

Returns
the directory.

Definition at line 131 of file fiff_stream.cpp.

◆ dirtree()

const FiffDirNode::SPtr & FiffStream::dirtree ( ) const

Returns the directory compiled into a tree tree is set when open() was called.

Returns
the compiled directory.

Definition at line 145 of file fiff_stream.cpp.

◆ end_block()

fiff_long_t FiffStream::end_block ( fiff_int_t kind,
fiff_int_t next = FIFFV_NEXT_SEQ )

Writes a FIFF_BLOCK_END tag

Parameters
[in]kindThe block kind to end.
[in]nextPosition of the next tag (default = FIFFV_NEXT_SEQ).
Returns
the position where the end block struct was written to.

Definition at line 152 of file fiff_stream.cpp.

◆ end_file()

void FiffStream::end_file ( )

Writes the closing tags to a fif file and closes the file

Definition at line 159 of file fiff_stream.cpp.

◆ finish_writing_raw()

void FiffStream::finish_writing_raw ( )

Finishes a raw file by writing all necessary end tags.

Definition at line 171 of file fiff_stream.cpp.

◆ get_evoked_entries()

bool FiffStream::get_evoked_entries ( const QList< FiffDirNode::SPtr > & evoked_node,
QStringList & comments,
QList< fiff_int_t > & aspect_kinds,
QString & t )

Helper to get all evoked entries

Parameters
[in]evoked_nodeevoked tree nodes.
[out]commentsfound comments.
[out]aspect_kindsfound aspect_kinds.
[out]ttext formatted found information.
Returns
true if information is available, false otherwise.

Definition at line 181 of file fiff_stream.cpp.

◆ id()

FiffId FiffStream::id ( ) const

Returns the file identifier

Returns
The file identifier.

Definition at line 117 of file fiff_stream.cpp.

◆ make_subtree()

FiffDirNode::SPtr FiffStream::make_subtree ( QList< FiffDirEntry::SPtr > & dentry)

Create the directory tree structure

Parameters
[in]dentryThe dir entries of which the tree should be constructed.
Returns
The created dir tree.

Definition at line 326 of file fiff_stream.cpp.

◆ nent()

int FiffStream::nent ( ) const

How many entries?

Returns
The number of directory entries.

Definition at line 138 of file fiff_stream.cpp.

◆ open()

bool FiffStream::open ( QIODevice::OpenModeFlag mode = QIODevice::ReadOnly)

QFile::open

unmask base class open function Opens a fif file and provides the directory of tags

Parameters
[in]modeThe open mode (Default = ReadOnly).
Returns
true if succeeded, false otherwise.

Definition at line 231 of file fiff_stream.cpp.

◆ open_update()

FiffStream::SPtr FiffStream::open_update ( QIODevice & p_IODevice)
static

Open fiff file for update

Parameters
[in]p_IODeviceThe IODevice (like QFile or QTCPSocket) to open. It is recommended that the name ends with .fif.
Returns
The opened file stream.

Definition at line 1948 of file fiff_stream.cpp.

◆ read_bad_channels()

QStringList FiffStream::read_bad_channels ( const FiffDirNode::SPtr & p_Node)

fiff_read_bad_channels

Reads the bad channel list from a node if it exists Note: In difference to mne-matlab this is not a static function. This is a method of the FiffDirNode class, that's why a tree object doesn't need to be handed to the function.

Parameters
[in]p_NodeThe node of interest.
Returns
the bad channel list.

Definition at line 391 of file fiff_stream.cpp.

◆ read_cov()

bool FiffStream::read_cov ( const FiffDirNode::SPtr & p_Node,
fiff_int_t cov_kind,
FiffCov & p_covData )

mne_read_cov - also for mne_read_noise_cov

Reads a covariance matrix from a fiff file

Parameters
[in]p_Nodelook for the matrix in here.
[in]cov_kindwhat kind of a covariance matrix do we want?.
[in,out]p_covDatathe read covariance matrix.
Returns
true if succeeded, false otherwise.

Definition at line 533 of file fiff_stream.cpp.

◆ read_ctf_comp()

QList< FiffCtfComp > FiffStream::read_ctf_comp ( const FiffDirNode::SPtr & p_Node,
const QList< FiffChInfo > & p_Chs )

fiff_read_ctf_comp

Read the CTF software compensation data from the given node

Parameters
[in]p_NodeThe node of interest.
[in]p_Chschannels with the calibration info.
Returns
the CTF software compensation data.

Definition at line 725 of file fiff_stream.cpp.

◆ read_digitizer_data()

bool FiffStream::read_digitizer_data ( const FiffDirNode::SPtr & p_Node,
FiffDigitizerData & p_digData )

Reimplemntation of load_digitizer_data (digitizer.c)

Read the digitizer data from the given node.

Parameters
[in]p_NodeThe node of interest.
[out]p_digDataThe read digitizer data.
Returns
true if succeeded, false otherwise.

Definition at line 862 of file fiff_stream.cpp.

◆ read_meas_info()

bool FiffStream::read_meas_info ( const FiffDirNode::SPtr & p_Node,
FiffInfo & p_Info,
FiffDirNode::SPtr & p_NodeInfo )

fiff_read_meas_info

Read the measurement info Source is assumed to be an open fiff file.

Parameters
[in]p_NodeThe node of interest.
[out]p_InfoThe read measurement info.
[out]p_NodeInfoThe to measurement corresponding fiff_dir_node.
Returns
true if successful.

Definition at line 992 of file fiff_stream.cpp.

◆ read_meas_info_base()

bool FiffStream::read_meas_info_base ( const FiffDirNode::SPtr & p_Node,
FiffInfoBase & p_InfoForward )

python read_forward_meas_info

Read light measurement info from forward operator.

Parameters
[in]p_NodeThe node of interest.
[out]p_InfoForwardThe read light measurement info.
Returns
true when successful.

Definition at line 928 of file fiff_stream.cpp.

◆ read_named_matrix()

bool FiffStream::read_named_matrix ( const FiffDirNode::SPtr & p_Node,
fiff_int_t matkind,
FiffNamedMatrix & mat )

fiff_read_named_matrix

Reads a named matrix.

Parameters
[in]p_NodeThe node of interest.
[in]matkindThe matrix kind to look for.
[out]matThe named matrix.
Returns
true if succeeded, false otherwise.

Definition at line 1352 of file fiff_stream.cpp.

◆ read_proj()

QList< FiffProj > FiffStream::read_proj ( const FiffDirNode::SPtr & p_Node)

Read the SSP data under a given directory node

Parameters
[in]p_NodeThe node of interest.
Returns
a list of SSP projectors.

Definition at line 1439 of file fiff_stream.cpp.

◆ read_rt_tag()

bool FiffStream::read_rt_tag ( std::unique_ptr< FiffTag > & p_pTag)

Read one tag from a fif real-time stream. difference to the other read tag functions is: that this function has blocking behaviour (waitForReadyRead)

Parameters
[out]p_pTagthe read tag.
Returns
true if succeeded, false otherwise.

Definition at line 1631 of file fiff_stream.cpp.

◆ read_tag()

bool FiffStream::read_tag ( std::unique_ptr< FiffTag > & p_pTag,
fiff_long_t pos = -1 )

Read one tag from a fif file. if pos is not provided, reading starts from the current file position

Parameters
[out]p_pTagthe read tag.
[in]posposition of the tag inside the fif file.
Returns
true if succeeded, false otherwise.

Definition at line 1651 of file fiff_stream.cpp.

◆ read_tag_data()

bool FiffStream::read_tag_data ( std::unique_ptr< FiffTag > & p_pTag,
fiff_long_t pos = -1 )

Read tag data from a fif file. if pos is not provided, reading starts from the current file position

Parameters
[out]p_pTagthe read tag.
[in]posposition of the tag inside the fif file.
Returns
true if succeeded, false otherwise.

Definition at line 1560 of file fiff_stream.cpp.

◆ read_tag_info()

fiff_long_t FiffStream::read_tag_info ( std::unique_ptr< FiffTag > & p_pTag,
bool p_bDoSkip = true )

Read tag information of one tag from a fif file. if pos is not provided, reading starts from the current file position

Parameters
[out]p_pTagthe read tag info.
[in]p_bDoSkipif true it skips the data of the tag (optional, default = true).
Returns
the position where the tag info was read from.

Definition at line 1585 of file fiff_stream.cpp.

◆ setup_read_raw()

bool FiffStream::setup_read_raw ( QIODevice & p_IODevice,
FiffRawData & data,
bool allow_maxshield = true,
bool is_littleEndian = false )
static

fiff_setup_read_raw

Read information about raw data file

Parameters
[in]p_IODeviceAn fiff IO device like a fiff QFile or QTCPSocket.
[out]dataThe raw data information - contains the opened fiff file.
[in]allow_maxshieldAccept unprocessed MaxShield data.
[in]is_littleEndianThe file is stored in little-endian byte order.
Returns
true if succeeded, false otherwise.

Definition at line 1699 of file fiff_stream.cpp.

◆ split_name_list()

QStringList FiffStream::split_name_list ( QString p_sNameList)
static

fiff_split_name_list

Splits a string by looking for seperator ":"

Parameters
[in]p_sNameListstring to split.
Returns
the splitted string list.

Definition at line 1906 of file fiff_stream.cpp.

◆ start_block()

fiff_long_t FiffStream::start_block ( fiff_int_t kind)

Writes a FIFF_BLOCK_START tag

Parameters
[in]kindThe block kind to start.
Returns
the position where the start block struct was written to.

Definition at line 1913 of file fiff_stream.cpp.

◆ start_file()

FiffStream::SPtr FiffStream::start_file ( QIODevice & p_IODevice)
static

Opens a fiff file for writing and writes the compulsory header tags

Parameters
[in]p_IODeviceThe IODevice (like QFile or QTCPSocket) to open. It is recommended that the name ends with .fif.
Returns
The opened file.

Definition at line 1920 of file fiff_stream.cpp.

◆ start_writing_raw()

FiffStream::SPtr FiffStream::start_writing_raw ( QIODevice & p_IODevice,
const FiffInfo & info,
Eigen::RowVectorXd & cals,
Eigen::MatrixXi sel = defaultMatrixXi,
bool bResetRange = true )
static

fiff_start_writing_raw

function [fid,cals] = fiff_start_writing_raw(name,info,sel)

Parameters
[in]p_IODeviceA fiff IO device like a fiff QFile or QTCPSocket.
[in]infoThe measurement info block of the source file.
[out]calsA copy of the calibration values.
[in]selWhich channels will be included in the output file (optional).
[in]bResetRangeFlag whether to reset the channel range to 1.0. Default is true.
Returns
the started fiff file, or null if the device cannot be opened for writing.

Definition at line 2024 of file fiff_stream.cpp.

◆ streamName()

QString FiffStream::streamName ( )

Get the stream name

Returns
the name of the current stream.

Definition at line 103 of file fiff_stream.cpp.

◆ write_bad_channels()

void FiffStream::write_bad_channels ( const QStringList & bads)

Write a bad channel list as a FIFFB_MNE_BAD_CHANNELS block.

Parameters
[in]badsThe list of bad channel names.

Definition at line 407 of file fiff_stream.cpp.

◆ write_ch_info()

fiff_long_t FiffStream::write_ch_info ( const FiffChInfo & ch)

Writes a channel information record to a fif file The type, cal, unit, and pos members are explained in Table 9.5 of the MNE manual

Parameters
[in]chThe channel information structure to write.
Returns
the position where the channel info struct was written to.

Definition at line 2232 of file fiff_stream.cpp.

◆ write_ch_pos()

fiff_long_t FiffStream::write_ch_pos ( const FiffChPos & chpos)

Writes a channel position to a fif file

Parameters
[in]chposChannel position structure to write.
Returns
the position where the channel position struct was written to.

Definition at line 2308 of file fiff_stream.cpp.

◆ write_coord_trans()

fiff_long_t FiffStream::write_coord_trans ( const FiffCoordTrans & trans)

Writes a coordinate transformation structure

Parameters
[in]transThe coordinate transfomation structure.
Returns
the position where the coordinate transformation struct was written to.

Definition at line 2336 of file fiff_stream.cpp.

◆ write_cov()

fiff_long_t FiffStream::write_cov ( const FiffCov & p_FiffCov)

Write a noise covariance matrix

Parameters
[in]p_FiffCovThe noise covariance matrix to write.
Returns
the position where the covaraince was written to.

Definition at line 2385 of file fiff_stream.cpp.

◆ write_ctf_comp()

fiff_long_t FiffStream::write_ctf_comp ( const QList< FiffCtfComp > & comps)

fiff_write_ctf_comp

Writes the CTF compensation data into a fif file

Parameters
[in]compsThe compensation data to write.
Returns
the position where the ctf compensators struct was written to.

Definition at line 2458 of file fiff_stream.cpp.

◆ write_dig_point()

fiff_long_t FiffStream::write_dig_point ( const FiffDigPoint & dig)

fiff_write_dig_point

Writes a digitizer data point into a fif file

Parameters
[in]digThe point to write.
Returns
the position where the digitizer points struct was written to.

Definition at line 2495 of file fiff_stream.cpp.

◆ write_dir_entries()

fiff_long_t FiffStream::write_dir_entries ( const QList< FiffDirEntry::SPtr > & dir,
fiff_long_t pos = -1 )

Writes a list of dir entries to a fif file, as a FIFFT_DIR_ENTRY_STRUCT Returns the postion where the structure was written to.

Parameters
[in]dirThe dir entries to write.
[in]posthe position where the entires should be written to (default -1, i.e. end of the file).
Returns
the position where the directory entries struct was written to.

Directories are composed of these structures. * typedef struct _fiffDirEntryRec { fiff_int_t kind; /**< Tag number * fiff_int_t type; /**< Data type * fiff_int_t size; /**< How many bytes * fiff_int_t pos; /**< Location in file Note: the data is located at pos + FIFFC_DATA_OFFSET * } fiffDirEntryRec,*fiffDirEntry;/**< Directory is composed of these *

/*
   Write entires to specified position

Definition at line 2554 of file fiff_stream.cpp.

◆ write_dir_pointer()

fiff_long_t FiffStream::write_dir_pointer ( fiff_int_t dirpos,
fiff_long_t pos = -1,
fiff_int_t next = FIFFV_NEXT_SEQ )

Writes directory position pointer FIFF_DIR_POINTER Returns the postion where the structure was written to.

Parameters
[in]dirposThe directory position pointer.
[in]posthe position where the directory pointer should be written to (default -1, i.e. end of the file).
[in]nextPosition of the next tag (default = FIFFV_NEXT_SEQ).
Returns
the position where the directory position pointer was written to.

Definition at line 2526 of file fiff_stream.cpp.

◆ write_double()

fiff_long_t FiffStream::write_double ( fiff_int_t kind,
const double * data,
fiff_int_t nel = 1 )

Writes a double-precision floating point tag to a fif file

Parameters
[in]kindTag kind.
[in]dataThe float data pointer.
[in]nelNumber of doubles to write (default = 1).
Returns
the position where the double struct was written to.

Definition at line 2602 of file fiff_stream.cpp.

◆ write_evoked_set()

fiff_long_t FiffStream::write_evoked_set ( const FiffEvokedSet & p_FiffEvokedSet)

fiff_write_evoked_set

Writes a complete evoked data set to a fif stream (file). This writes FIFFB_MEAS containing measurement info and one FIFFB_EVOKED/FIFFB_ASPECT block per evoked response.

Parameters
[in]p_FiffEvokedSetThe evoked data set to write.
Returns
the position where the evoked set was written to, or -1 on failure.

Definition at line 3086 of file fiff_stream.cpp.

◆ write_float()

fiff_long_t FiffStream::write_float ( fiff_int_t kind,
const float * data,
fiff_int_t nel = 1 )

Writes a single-precision floating point tag to a fif file

Parameters
[in]kindTag kind.
[in]dataThe float data pointer.
[in]nelNumber of floats to write (default = 1).
Returns
the position where the float struct was written to.

Definition at line 2630 of file fiff_stream.cpp.

◆ write_float_matrix()

fiff_long_t FiffStream::write_float_matrix ( fiff_int_t kind,
const Eigen::MatrixXf & mat )

Writes a single-precision floating-point matrix tag

Parameters
[in]kindThe tag kind.
[in]matThe data matrix.
Returns
the position where the float matrix struct was written to.

Definition at line 2649 of file fiff_stream.cpp.

◆ write_float_sparse_ccs()

fiff_long_t FiffStream::write_float_sparse_ccs ( fiff_int_t kind,
const Eigen::SparseMatrix< float > & mat )

fiff_write_float_sparse_ccs

Writes a single-precision sparse (ccs) floating-point matrix tag

Parameters
[in]kindThe tag kind.
[in]matThe data matrix.
Returns
the position where the float sparse ccs matrix struct was written to.

Definition at line 2681 of file fiff_stream.cpp.

◆ write_float_sparse_rcs()

fiff_long_t FiffStream::write_float_sparse_rcs ( fiff_int_t kind,
const Eigen::SparseMatrix< float > & mat )

fiff_write_float_sparse_rcs

Writes a single-precision sparse (RCS) floating-point matrix tag

Parameters
[in]kindThe tag kind.
[in]matThe data matrix.
Returns
the position where the float sparse rcs matrix struct was written to.

Definition at line 2772 of file fiff_stream.cpp.

◆ write_id()

fiff_long_t FiffStream::write_id ( fiff_int_t kind,
const FiffId & id = FiffId::getDefault() )

Writes fiff id If the id argument is missing it will be generated here

Parameters
[in]kindThe tag kind.
[in]idThe id to write.
Returns
the position where the file id struct was written to.

Definition at line 2869 of file fiff_stream.cpp.

◆ write_info_base()

fiff_long_t FiffStream::write_info_base ( const FiffInfoBase & p_FiffInfoBase)

Write measurement info stored in forward solution

Parameters
[in]p_FiffInfoBaseThe measurement info.
Returns
the position where the info base struct was written to.

Definition at line 2908 of file fiff_stream.cpp.

◆ write_int()

fiff_long_t FiffStream::write_int ( fiff_int_t kind,
const fiff_int_t * data,
fiff_int_t nel = 1,
fiff_int_t next = FIFFV_NEXT_SEQ )

Writes a 32-bit integer tag to a fif file

Parameters
[in]kindTag kind.
[in]dataThe integer data pointer.
[in]nelNumber of integers to write (default = 1).
[in]nextPosition of the next tag (default = FIFFV_NEXT_SEQ).
Returns
the position where the int was written to.

Definition at line 2972 of file fiff_stream.cpp.

◆ write_int_matrix()

fiff_long_t FiffStream::write_int_matrix ( fiff_int_t kind,
const Eigen::MatrixXi & mat )

fiff_write_int_matrix

Writes a integer matrix tag

Parameters
[in]kindThe tag kind.
[in]matThe data matrix.
Returns
the position where the write_int_matrix was written to.

Definition at line 2991 of file fiff_stream.cpp.

◆ write_name_list()

fiff_long_t FiffStream::write_name_list ( fiff_int_t kind,
const QStringList & data )

fiff_write_name_list

Writes a colon-separated list of names

Parameters
[in]kindThe tag kind.
[in]dataAn array of names to create the list from.
Returns
the position where the name list struct was written to.

Definition at line 3026 of file fiff_stream.cpp.

◆ write_named_matrix()

fiff_long_t FiffStream::write_named_matrix ( fiff_int_t kind,
const FiffNamedMatrix & mat )

fiff_write_named_matrix

Writes a named single-precision floating-point matrix

Parameters
[in]kindThe tag kind to use for the data.
[in]matThe data matrix.
Returns
the position where the named matrix struct was written to.

Definition at line 3034 of file fiff_stream.cpp.

◆ write_proj()

fiff_long_t FiffStream::write_proj ( const QList< FiffProj > & projs)

fiff_write_proj

Writes the projection data into a fif stream (file)

Parameters
[in]projsThe compensation data to write.
Returns
the position where the projector struct was written to.

Definition at line 3053 of file fiff_stream.cpp.

◆ write_raw_buffer() [1/3]

bool FIFFLIB::FiffStream::write_raw_buffer ( const Eigen::MatrixXd & buf)

fiff_write_raw_buffer

Writes a raw buffer without calibrations.

Parameters
[in]bufthe buffer to write.
Returns
true if succeeded, false otherwise.

◆ write_raw_buffer() [2/3]

bool FIFFLIB::FiffStream::write_raw_buffer ( const Eigen::MatrixXd & buf,
const Eigen::RowVectorXd & cals )

fiff_write_raw_buffer

Writes a raw buffer.

Parameters
[in]bufthe buffer to write.
[in]calscalibration factors.
Returns
true if succeeded, false otherwise.

◆ write_raw_buffer() [3/3]

bool FIFFLIB::FiffStream::write_raw_buffer ( const Eigen::MatrixXd & buf,
const Eigen::SparseMatrix< double > & mult )

fiff_write_raw_buffer

Writes a raw buffer.

Parameters
[in]bufthe buffer to write.
[in]multthe used multiplication matrix consisting out of projection,calibration and compensation.
Returns
true if succeeded, false otherwise.

◆ write_rt_command()

void FiffStream::write_rt_command ( fiff_int_t command,
const QString & data )

Writes a real-time command

Parameters
[in]commandThe real time command.
[in]dataThe string data to write.

Definition at line 3241 of file fiff_stream.cpp.

◆ write_string()

fiff_long_t FiffStream::write_string ( fiff_int_t kind,
const QString & data )

Writes a string tag

Parameters
[in]kindThe tag kind.
[in]dataThe string data to write.
Returns
the position where the string struct was written to.

Definition at line 3222 of file fiff_stream.cpp.

◆ write_tag()

fiff_long_t FiffStream::write_tag ( const std::unique_ptr< FiffTag > & p_pTag,
fiff_long_t pos = -1 )

Write one tag to file including its data Data is not written if it is nullptr. The payload is taken in host byte order (as read_tag returns it).

Parameters
[in]p_pTagTag to write;.
[in]posthe position where the entires should be written to (default -1, i.e. end of the file).
Returns
the position where the tag struct was written to.

Definition at line 2196 of file fiff_stream.cpp.


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