The Fiff library implements the FIFF (Functional Image File Format) used throughout the MNE ecosystem for MEG/EEG data. It provides file I/O, in-memory data containers, channel and sensor metadata, digitisation points, coordinate transforms, SSP projections, and CTF compensation — everything required to read, manipulate, and write neurophysiological recordings. All classes reside in the FIFFLIB namespace and depend only on Qt and Eigen.
Architecture
Class Inventory
File I/O
| Class | Description | MNE-Python | MNE-C |
|---|
FiffStream | Low-level tag-based FIFF file reader/writer — open, read/write individual tags, navigate directory tree | mne._fiff.open.fiff_open() | fiffFile |
FiffIO | High-level convenience reader/writer for complete measurement files | mne.io.read_raw_fif() | mne_read_*() family |
FiffTag | Single data tag: kind, type, size, position, and typed payload | mne._fiff.tag.Tag | fiffTag |
FiffDirEntry | Directory entry describing a tag's location within the file | mne._fiff.tree | fiffDirEntry |
FiffDirNode | Tree node representing a block in the FIFF directory hierarchy (e.g., FIFFB_MEAS, FIFFB_MNE_ENV) | mne._fiff.tree.dir_tree_find() | fiffDirTree |
FiffId | Universally unique file/block identifier (UUID + timestamp) | mne._fiff.tag | fiffId |
Data Containers
| Class | Description | MNE-Python | MNE-C |
|---|
FiffRawData | Raw continuous MEG/EEG data with lazy reading, ring-buffer support, projection, and compensation | mne.io.Raw | mneRawData |
FiffEvoked | Averaged/evoked response data (channels × time) with stimulus metadata | mne.Evoked | mneEvoked |
FiffEvokedSet | Collection of multiple evoked data sets read from a single file | mne.read_evokeds() | — |
FiffCov | Noise or data covariance matrix (dense or diagonal) with eigendecomposition and channel names | mne.Covariance | mneCov |
FiffEvents | Event array (sample × 3 matrix: sample, value-before, value-after) | mne.read_events() | — |
FiffNamedMatrix | Matrix with labelled rows and columns, shared-data semantics | Internal | mneNamedMatrix |
FiffSparseMatrix | Sparse matrix in Compressed Column/Row Storage | scipy.sparse equivalent | mneSparseMatrix |
| Class | Description | MNE-Python | MNE-C |
|---|
FiffInfo | Complete measurement metadata: channels, sampling rate, SSP projections, CTF data, coordinate transforms, subject info, date | mne.Info | mneMeasData |
FiffInfoBase | Lightweight base class for measurement info (channel list, bads, sampling rate) | mne.Info (base interface) | |