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
 Container for the FIFF coordinate transforms found in (or written to) a FIFFB_MRI / FIFFB_HPI_MEAS block. 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...
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  FiffExplainEntry
 FIFF tag explanation entry: pairs a FIFF_* tag kind with the fixed-width label printed by show_fiff. More...
class  FiffFileSharer
 Refcounted memory-mapped view of a FIFF file shared between cooperating consumers. 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  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  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 FiffDataReffiffDataRef
 Backward-compatible pointer typedef for the old fiffDataRef pointer.

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

◆ fiffDataRef

Backward-compatible pointer typedef for the old fiffDataRef pointer.

Definition at line 97 of file fiff_data_ref.h.

◆ fiffDataRefRec

Backward-compatible typedef for the old fiffDataRefRec struct.

Definition at line 95 of file fiff_data_ref.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.

Definition at line 30 of file fiff_global.cpp.

◆ buildHash()

const char * FIFFLIB::buildHash ( )

Returns abbreviated build git hash.

Definition at line 34 of file fiff_global.cpp.

◆ buildHashLong()

const char * FIFFLIB::buildHashLong ( )

Returns full build git hash.

Definition at line 38 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 128 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 268 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 201 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 197 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]objectThe object which should be compared to.
Returns
true if equal, false otherwise.

Definition at line 175 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]objectThe object which should be compared to.
Returns
true if equal, false otherwise.

Definition at line 130 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]objectThe object which should be compared to.
Returns
true if equal, false otherwise.

Definition at line 494 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]f1First FiffId.
[in]f2Second FiffId.
Returns
true if both IDs are equal, false otherwise.

Definition at line 201 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]objectThe object which should be compared to.
Returns
true if equal, false otherwise.

Definition at line 268 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]objectThe object which should be compared to.
Returns
true if equal, false otherwise.

Definition at line 281 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 113 of file fiff_time.h.

◆ swap_doublep()

void FIFFLIB::swap_doublep ( double * source)
inline

Swap a 64-bit double in place.

Definition at line 150 of file fiff_byte_swap.h.

◆ swap_float()

float FIFFLIB::swap_float ( float source)
inline

Swap a 32-bit float.

Definition at line 122 of file fiff_byte_swap.h.

◆ swap_floatp()

void FIFFLIB::swap_floatp ( float * source)
inline

Swap a 32-bit float in place.

Definition at line 138 of file fiff_byte_swap.h.

◆ swap_int()

qint32 FIFFLIB::swap_int ( qint32 source)
inline

Swap a 32-bit integer.

Definition at line 60 of file fiff_byte_swap.h.

◆ swap_intp()

void FIFFLIB::swap_intp ( qint32 * source)
inline

Swap a 32-bit integer in place.

Definition at line 76 of file fiff_byte_swap.h.

◆ swap_long()

qint64 FIFFLIB::swap_long ( qint64 source)
inline

Swap a 64-bit long.

Definition at line 88 of file fiff_byte_swap.h.

◆ swap_longp()

void FIFFLIB::swap_longp ( qint64 * source)
inline

Swap a 64-bit long in place.

Definition at line 108 of file fiff_byte_swap.h.

◆ swap_short()

qint16 FIFFLIB::swap_short ( qint16 source)
inline

Swap a 16-bit short.

Definition at line 46 of file fiff_byte_swap.h.