v2.0.0
Loading...
Searching...
No Matches
FIFFLIB Namespace Reference

FIFF file I/O, in-memory data structures and high-level readers/writers. More...

Classes

class  Fiff
 MATLAB-style static facade re-exporting every public FIFFLIB reader/writer for parity with the mne-matlab toolbox. More...
struct  FiffAnnotation
 One FIFF / MNE annotation: onset (s), duration (s) and description string. More...
class  FiffAnnotations
 Container for FiffAnnotation entries with FIFF, JSON and CSV serializers. More...
class  FiffChInfo
 Per-channel FIFF descriptor: identifiers, kind, calibration, coil type, channel-frame coil position and SI unit. More...
class  FiffChPos
 Channel coil-frame placement: origin r0 (m) and orthonormal axes ex / ey / ez in FIFFV_COORD_DEVICE. More...
class  FiffCoordTrans
 Labelled 4x4 FIFF affine: source frame, destination frame, rotation, translation and cached inverse. More...
class  FiffCoordTransSet
 The chain of transforms from MEG head coordinates to MNI and FreeSurfer Talairach coordinates. More...
class  FiffCov
 FIFF noise / data covariance: matrix, channel names, kind, applied projectors, bads, dof and optional whitening eigendecomposition. More...
class  FiffCtfComp
 One CTF software-gradient compensation matrix: grade kind, calibration flag and the gradiometer × reference named matrix. More...
class  FiffDataRef
 External data reference: type, endian, byte size and offset into an external FIFF payload file. More...
class  FiffDigPoint
 One digitizer point: kind (cardinal/HPI/EEG/extra), ident, 3D position in FIFFV_COORD_HEAD. More...
class  FiffDigPointSet
 Collection of FiffDigPoint records as parsed from a FIFFB_ISOTRAK block. More...
class  FiffDigitizerData
 Registration-ready digitization data: dig points, device→head transform and HPI fit metadata. More...
class  FiffDirEntry
 Directory entry: tag kind + on-disk type + byte size + absolute file offset (16-byte record). More...
class  FiffDirNode
 Recursive FIFF block-tree node: block kind, block ID, directly contained directory entries and child sub-blocks. More...
struct  FiffEpochData
 Fixed-length epoching result: the (nepoch × nchan × nsamples) data stack plus the matching FiffInfo. More...
class  FiffEpochs
 Static helpers that cut continuous data into fixed-length epochs, concatenate and average them. More...
class  FiffEvents
 FIFF event list: (sample, prev, new) integer triples with read / write / detect / filter helpers. More...
class  FiffEvoked
 Single averaged evoked response: time axis, data, baseline, channel info and averaging metadata. More...
struct  RejectionParams
 Artifact-rejection thresholds for the MNE-C batch averaging pipeline (gradiometer / magnetometer / EEG / EOG / ECG, peak-to-peak and flatness). More...
struct  AverageCategory
 One averaging category in an MNE-C ave-description file: trigger logic, timing window, baseline interval and display color. More...
struct  AverageDescription
 Top-level MNE-C ave-description record: comment, category list, shared rejection limits and output file paths. More...
class  FiffEvokedSet
 Set of FiffEvoked instances sharing one FiffInfo, plus channel-picking and compensation helpers. More...
struct  FiffExplainEntry
 FIFF tag explanation entry: pairs a FIFF_* tag kind with the fixed-width label printed by show_fiff. More...
class  FiffFileSharer
 Copies FIFF recordings into a shared directory and signals their arrival to a watching consumer. More...
class  FiffId
 128-bit FIFF identifier: hardware machine ID plus creation time, stamped on every file and block. More...
class  FiffInfo
 Full FIFF measurement info: per-channel descriptors, sampling and filter setup, projectors, compensators, transforms and dig points. More...
class  FiffInfoBase
 Stripped FIFF measurement info: channel list, sampling rate, device→head transform and bad-channel list. More...
class  FiffIO
 One-call FIFF reader/writer: opens a file, dispatches to the right specialized loader and returns ready-to-use FIFFLIB containers. More...
class  FiffNamedMatrix
 FIFF named matrix: dense / sparse Eigen matrix plus row-name and column-name string lists. More...
class  FiffProj
 Single SSP projection item: kind, active flag, desired flag and the named projection vector matrix. More...
class  FiffRawData
 Continuous FIFF raw recording: FiffInfo plus a random-access directory of FIFF_DATA_BUFFER tags. More...
class  FiffRawDir
 Per-buffer raw-data directory entry: data kind, first sample, sample count, on-disk tag position. More...
class  FiffSparseMatrix
 Sparse FIFF matrix: CCS or RCS storage with the value / index / pointer triple as written by FiffStream::write_float_sparse_*. More...
class  FiffStream
 FIFF tag-stream reader/writer: wraps a QIODevice and exposes typed read_* / write_* methods for every FIFF block and record kind. More...
class  FiffTag
 FIFF tag: 16-byte header (kind, type, size, next) plus payload, with typed decoders for every FIFFT_* type. More...
class  FiffTime
 FIFF time stamp: Unix seconds plus a microsecond fraction matching the on-disk fiffTimeRec record. More...

Typedefs

typedef FiffDataRef fiffDataRefRec
 Backward-compatible typedef for the old fiffDataRefRec struct.
typedef FiffDataRef * fiffDataRef
 Backward-compatible pointer typedef for the old fiffDataRef pointer.
typedef Eigen::Matrix< qint16, Eigen::Dynamic, Eigen::Dynamic > MatrixDau16
typedef Eigen::Matrix< short, Eigen::Dynamic, Eigen::Dynamic > MatrixShort
typedef unsigned char fiff_byte_t
typedef char fiff_char_t
typedef qint16 fiff_short_t
typedef quint16 fiff_ushort_t
typedef qint32 fiff_int_t
typedef quint32 fiff_uint_t
typedef qint64 fiff_long_t
typedef quint64 fiff_ulong_t
typedef float fiff_float_t
typedef double fiff_double_t
typedef quint16 fiff_dau_pack13_t
typedef quint16 fiff_dau_pack14_t
typedef qint16 fiff_dau_pack16_t
typedef qint32 fiff_julian_t
typedef char fiff_data_t
typedef FiffId fiffIdRec
 Backward-compatible typedef for the old fiffIdRec struct.
typedef FiffId fiff_id_t
 Backward-compatible typedef for the old fiff_id_t.
typedef FiffId * fiffId
 Backward-compatible pointer typedef for the old fiffId pointer.
typedef FiffDirEntry fiffDirEntryRec
 Backward-compatible typedef for the old fiffDirEntryRec struct.
typedef FiffDirEntry fiff_dir_entry_t
 Backward-compatible typedef for the old fiff_dir_entry_t.
typedef FiffDirEntry * fiffDirEntry
 Backward-compatible pointer typedef for the old fiffDirEntry pointer.
typedef FiffDigPoint fiffDigPointRec
 Backward-compatible typedef for the old fiffDigPointRec struct.

Functions

FiffAnnotations annotationsFromEvents (const Eigen::MatrixXi &events, double sfreq, const QMap< int, QString > &eventDescriptions=QMap< int, QString >(), int firstSample=0)
Eigen::MatrixXi eventsFromAnnotations (const FiffAnnotations &annotations, double sfreq, const QMap< QString, int > &eventIds=QMap< QString, int >(), int firstSample=0)
QMap< QString, int > countAnnotations (const FiffAnnotations &annotations)
qint16 swap_short (qint16 source)
qint32 swap_int (qint32 source)
void swap_intp (qint32 *source)
qint64 swap_long (qint64 source)
void swap_longp (qint64 *source)
float swap_float (float source)
void swap_floatp (float *source)
void swap_doublep (double *source)
bool operator== (const FiffChInfo &a, const FiffChInfo &b)
bool operator== (const FiffChPos &a, const FiffChPos &b)
bool operator== (const FiffCoordTrans &a, const FiffCoordTrans &b)
std::ostream & operator<< (std::ostream &out, const FIFFLIB::FiffCov &p_FiffCov)
const char * buildDateTime ()
const char * buildHash ()
const char * buildHashLong ()
bool operator== (const FiffId &a, const FiffId &b)
bool operator== (const FiffInfoBase &a, const FiffInfoBase &b)
std::ostream & operator<< (std::ostream &out, const FIFFLIB::FiffNamedMatrix &p_FiffNamedMatrix)
bool operator== (const FiffNamedMatrix &a, const FiffNamedMatrix &b)
std::ostream & operator<< (std::ostream &out, const FIFFLIB::FiffProj &p_FiffProj)
bool operator== (const FiffTime &a, const FiffTime &b)
bool operator!= (const FiffTime &a, const FiffTime &b)

Detailed Description

FIFF file I/O, in-memory data structures and high-level readers/writers.

Houses every class that round-trips an Elekta/Neuromag FIFF file: the stream layer (FiffStream, FiffTag, FiffDirNode, FiffDirEntry), the measurement metadata (FiffInfo, FiffChInfo, FiffCoordTrans, FiffId, FiffDigPoint), the data containers (FiffRawData, FiffEvoked, FiffEvokedSet, FiffCov, FiffProj, FiffCtfComp, FiffNamedMatrix, FiffSparseMatrix) and the convenience facade FIFF. Surface-level parity with mne.io.fiff in MNE-Python.

Typedef Documentation

◆ fiff_byte_t

typedef unsigned char FIFFLIB::fiff_byte_t

Definition at line 82 of file fiff_types.h.

◆ fiff_char_t

typedef char FIFFLIB::fiff_char_t

Definition at line 83 of file fiff_types.h.

◆ fiff_data_t

typedef char FIFFLIB::fiff_data_t

Definition at line 96 of file fiff_types.h.

◆ fiff_dau_pack13_t

typedef quint16 FIFFLIB::fiff_dau_pack13_t

Definition at line 92 of file fiff_types.h.

◆ fiff_dau_pack14_t

typedef quint16 FIFFLIB::fiff_dau_pack14_t

Definition at line 93 of file fiff_types.h.

◆ fiff_dau_pack16_t

Definition at line 94 of file fiff_types.h.

◆ fiff_dir_entry_t

Backward-compatible typedef for the old fiff_dir_entry_t.

Definition at line 139 of file fiff_types.h.

◆ fiff_double_t

typedef double FIFFLIB::fiff_double_t

Definition at line 91 of file fiff_types.h.

◆ fiff_float_t

typedef float FIFFLIB::fiff_float_t

Definition at line 90 of file fiff_types.h.

◆ fiff_id_t

Backward-compatible typedef for the old fiff_id_t.

Definition at line 125 of file fiff_types.h.

◆ fiff_int_t

typedef qint32 FIFFLIB::fiff_int_t

Definition at line 86 of file fiff_types.h.

◆ fiff_julian_t

typedef qint32 FIFFLIB::fiff_julian_t

Definition at line 95 of file fiff_types.h.

◆ fiff_long_t

typedef qint64 FIFFLIB::fiff_long_t

Definition at line 88 of file fiff_types.h.

◆ fiff_short_t

typedef qint16 FIFFLIB::fiff_short_t

Definition at line 84 of file fiff_types.h.

◆ fiff_uint_t

typedef quint32 FIFFLIB::fiff_uint_t

Definition at line 87 of file fiff_types.h.

◆ fiff_ulong_t

typedef quint64 FIFFLIB::fiff_ulong_t

Definition at line 89 of file fiff_types.h.

◆ fiff_ushort_t

typedef quint16 FIFFLIB::fiff_ushort_t

Definition at line 85 of file fiff_types.h.

◆ fiffDataRef

Backward-compatible pointer typedef for the old fiffDataRef pointer.

Definition at line 99 of file fiff_data_ref.h.

◆ fiffDataRefRec

Backward-compatible typedef for the old fiffDataRefRec struct.

Definition at line 97 of file fiff_data_ref.h.

◆ fiffDigPointRec

Backward-compatible typedef for the old fiffDigPointRec struct.

Definition at line 151 of file fiff_types.h.

◆ fiffDirEntry

Backward-compatible pointer typedef for the old fiffDirEntry pointer.

Definition at line 141 of file fiff_types.h.

◆ fiffDirEntryRec

Backward-compatible typedef for the old fiffDirEntryRec struct.

Definition at line 137 of file fiff_types.h.

◆ fiffId

Backward-compatible pointer typedef for the old fiffId pointer.

Definition at line 127 of file fiff_types.h.

◆ fiffIdRec

Backward-compatible typedef for the old fiffIdRec struct.

Definition at line 123 of file fiff_types.h.

◆ MatrixDau16

typedef Eigen::Matrix<qint16, Eigen::Dynamic, Eigen::Dynamic> FIFFLIB::MatrixDau16

Definition at line 75 of file fiff_types.h.

◆ MatrixShort

typedef Eigen::Matrix<short, Eigen::Dynamic, Eigen::Dynamic> FIFFLIB::MatrixShort

Definition at line 76 of file fiff_types.h.

Function Documentation

◆ annotationsFromEvents()

FiffAnnotations FIFFLIB::annotationsFromEvents ( const Eigen::MatrixXi & events,
double sfreq,
const QMap< int, QString > & eventDescriptions = QMap< int, QString >(),
int firstSample = 0 )

Convert a FIFF event matrix to FiffAnnotations.

Each event becomes an annotation with onset = (sample - firstSample) / sfreq and duration = 0. The description is looked up from eventDescriptions (event_id -> label). If not found, the event id is used as a string.

Parameters
[in]eventsFIFF events (Nx3: [sample, before, after]).
[in]sfreqSampling frequency in Hz.
[in]eventDescriptionsMap from event id (the "after" column) to description string.
[in]firstSampleFirst sample offset (default 0).
Returns
FiffAnnotations containing one annotation per event.

◆ buildDateTime()

const char * FIFFLIB::buildDateTime ( )

Returns build date and time.

Returns
Null-terminated string with the compile date and time of the library.

Definition at line 30 of file fiff_global.cpp.

◆ buildHash()

const char * FIFFLIB::buildHash ( )

Returns abbreviated build git hash.

Returns
Null-terminated string with the short git commit hash the library was built from.

Definition at line 37 of file fiff_global.cpp.

◆ buildHashLong()

const char * FIFFLIB::buildHashLong ( )

Returns full build git hash.

Returns
Null-terminated string with the full git commit hash the library was built from.

Definition at line 44 of file fiff_global.cpp.

◆ countAnnotations()

QMap< QString, int > FIFFLIB::countAnnotations ( const FiffAnnotations & annotations)

Count annotations by description.

Parameters
[in]annotationsThe annotations to count.
Returns
QMap<QString, int> Map from description to count.

Definition at line 127 of file fiff_annotation_event_utils.cpp.

◆ eventsFromAnnotations()

MatrixXi FIFFLIB::eventsFromAnnotations ( const FiffAnnotations & annotations,
double sfreq,
const QMap< QString, int > & eventIds = QMap<QString, int>(),
int firstSample = 0 )

Convert FiffAnnotations to a FIFF event matrix.

Each annotation becomes an event row [sample, 0, event_id]. The event_id is looked up from eventIds (description -> id). If not found, the description is parsed as an integer; if that also fails, event_id is set to 0.

Parameters
[in]annotationsThe annotations to convert.
[in]sfreqSampling frequency in Hz.
[in]eventIdsMap from description string to event id integer.
[in]firstSampleFirst sample offset (default 0).
Returns
Eigen::MatrixXi Nx3 event matrix [sample, 0, event_id].

Definition at line 83 of file fiff_annotation_event_utils.cpp.

◆ operator!=()

bool FIFFLIB::operator!= ( const FiffTime & a,
const FiffTime & b )
inline

Compares two FiffTime instances for inequality.

Parameters
[in]aFirst time value.
[in]bSecond time value.
Returns
true if secs or usecs differ.

Definition at line 130 of file fiff_time.h.

◆ operator<<() [1/3]

std::ostream & FIFFLIB::operator<< ( std::ostream & out,
const FIFFLIB::FiffCov & p_FiffCov )
inline

overloading the stream out operator<<

Parameters
[in]outThe stream to which the fiff covariance should be assigned to.
[in]p_FiffCovFiffCov which should be assigned to the stream.
Returns
the stream with the attached fiff covariance matrix.

Definition at line 272 of file fiff_cov.h.

◆ operator<<() [2/3]

std::ostream & FIFFLIB::operator<< ( std::ostream & out,
const FIFFLIB::FiffNamedMatrix & p_FiffNamedMatrix )
inline

Assignment Operator

Returns
rhs named matrix which hould be assigned. overloading the stream out operator<<
Parameters
[in]outThe stream to which the fiff projector should be assigned to.
[in]p_FiffNamedMatrixFiff named matrix which should be assigned to the stream.
Returns
the stream with the attached fiff named matrix.

< Matrix data.

Definition at line 203 of file fiff_named_matrix.h.

◆ operator<<() [3/3]

std::ostream & FIFFLIB::operator<< ( std::ostream & out,
const FIFFLIB::FiffProj & p_FiffProj )
inline

overloading the stream out operator<<

Parameters
[in]outThe stream to which the fiff projector should be assigned to.
[in]p_FiffProjFiff projector which should be assigned to the stream.
Returns
the stream with the attached fiff projector.

Definition at line 217 of file fiff_proj.h.

◆ operator==() [1/7]

bool FIFFLIB::operator== ( const FiffChInfo & a,
const FiffChInfo & b )
inline

Overloaded == operator to compare an object to this instance.

Parameters
[in]aThe object which should be compared to.
[in]bRight-hand channel info.
Returns
true if equal, false otherwise.

Definition at line 189 of file fiff_ch_info.h.

◆ operator==() [2/7]

bool FIFFLIB::operator== ( const FiffChPos & a,
const FiffChPos & b )
inline

Overloaded == operator to compare an object to this instance.

Parameters
[in]aThe object which should be compared to.
[in]bRight-hand channel position.
Returns
true if equal, false otherwise.

Definition at line 143 of file fiff_ch_pos.h.

◆ operator==() [3/7]

bool FIFFLIB::operator== ( const FiffCoordTrans & a,
const FiffCoordTrans & b )
inline

Overloaded == operator to compare an object to this instance.

Parameters
[in]aThe object which should be compared to.
[in]bRight-hand transform.
Returns
true if equal, false otherwise.

Definition at line 567 of file fiff_coord_trans.h.

◆ operator==() [4/7]

bool FIFFLIB::operator== ( const FiffId & a,
const FiffId & b )
inline

Compares two FiffId instances for equality.

Parameters
[in]aFirst FiffId.
[in]bSecond FiffId.
Returns
true if both IDs are equal, false otherwise.

Definition at line 215 of file fiff_id.h.

◆ operator==() [5/7]

bool FIFFLIB::operator== ( const FiffInfoBase & a,
const FiffInfoBase & b )
inline

Overloaded == operator to compare an object to this instance.

Parameters
[in]aThe object which should be compared to.
[in]bRight-hand measurement info.
Returns
true if equal, false otherwise.

Definition at line 305 of file fiff_info_base.h.

◆ operator==() [6/7]

bool FIFFLIB::operator== ( const FiffNamedMatrix & a,
const FiffNamedMatrix & b )
inline

Overloaded == operator to compare an object to this instance.

Parameters
[in]aThe object which should be compared to.
[in]bRight-hand named matrix.
Returns
true if equal, false otherwise.

Definition at line 274 of file fiff_named_matrix.h.

◆ operator==() [7/7]

bool FIFFLIB::operator== ( const FiffTime & a,
const FiffTime & b )
inline

Compares two FiffTime instances for equality.

Parameters
[in]aFirst time value.
[in]bSecond time value.
Returns
true if both secs and usecs are equal.

Definition at line 115 of file fiff_time.h.

◆ swap_doublep()

void FIFFLIB::swap_doublep ( double * source)
inline

Swap a 64-bit double in place.

Parameters
[in,out]sourcePointer to the value whose eight bytes are reversed in place.

Definition at line 190 of file fiff_byte_swap.h.

◆ swap_float()

float FIFFLIB::swap_float ( float source)
inlinenodiscard

Swap a 32-bit float.

Parameters
[in]sourceValue whose four bytes are to be reversed.
Returns
The value with its byte order reversed.

Definition at line 154 of file fiff_byte_swap.h.

◆ swap_floatp()

void FIFFLIB::swap_floatp ( float * source)
inline

Swap a 32-bit float in place.

Parameters
[in,out]sourcePointer to the value whose four bytes are reversed in place.

Definition at line 172 of file fiff_byte_swap.h.

◆ swap_int()

qint32 FIFFLIB::swap_int ( qint32 source)
inlinenodiscard

Swap a 32-bit integer.

Parameters
[in]sourceValue whose four bytes are to be reversed.
Returns
The value with its byte order reversed.

Definition at line 68 of file fiff_byte_swap.h.

◆ swap_intp()

void FIFFLIB::swap_intp ( qint32 * source)
inline

Swap a 32-bit integer in place.

Parameters
[in,out]sourcePointer to the value whose four bytes are reversed in place.

Definition at line 86 of file fiff_byte_swap.h.

◆ swap_long()

qint64 FIFFLIB::swap_long ( qint64 source)
inlinenodiscard

Swap a 64-bit long.

Parameters
[in]sourceValue whose eight bytes are to be reversed.
Returns
The value with its byte order reversed.

Definition at line 106 of file fiff_byte_swap.h.

◆ swap_longp()

void FIFFLIB::swap_longp ( qint64 * source)
inline

Swap a 64-bit long in place.

Parameters
[in,out]sourcePointer to the value whose eight bytes are reversed in place.

Definition at line 128 of file fiff_byte_swap.h.

◆ swap_short()

qint16 FIFFLIB::swap_short ( qint16 source)
inlinenodiscard

Swap a 16-bit short.

Parameters
[in]sourceValue whose two bytes are to be reversed.
Returns
The value with its byte order reversed.

Definition at line 50 of file fiff_byte_swap.h.