FiffRawDir
Namespace: FIFFLIB · Library: FIFF Library
#include <fiff/fiff_raw_dir.h>
class FIFFLIB::FiffRawDir
Per-buffer raw-data directory entry: data kind, first sample, sample count, on-disk tag position.
One entry per FIFF_DATA_BUFFER tag. The (first, nsamp) fields let FiffRawData::read_segment binary-search the directory for the buffers that cover a requested sample window and stream them in without rescanning the file.
// The raw data directory: one FiffRawDir per data buffer, each pointing at its FiffDirEntry in the file.
int samples = 0;
for (const FiffRawDir& buffer : raw.rawdir)
samples += buffer.nsamp;
const FiffDirEntry::SPtr firstBuffer = raw.rawdir.first().ent;
Public Methods
FiffRawDir()
Default constructor.
FiffRawDir(p_FiffRawDir)
Copy constructor.
Parameters:
- p_FiffRawDir : const FiffRawDir & Raw directory entry which should be copied.
operator=(other)
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:
- other : const FiffRawDir & Object to assign from.
Returns:
- FiffRawDir & — reference to this object.
~FiffRawDir()
Destroys the raw Directory entry.
Example
- Full source:
src/examples/ex_fiff_structure/main.cpp - Build target:
ex_fiff_structure(runs under CTest) - Data: mne-cpp-test-data
Used in examples
ex_fiff_structure
FIFF library: fixed-length epochs, CTF compensation, the file directory and raw buffers, and handing.
// The raw data directory: one FiffRawDir per data buffer, each pointing at its FiffDirEntry in the file.
int samples = 0;
for (const FiffRawDir& buffer : raw.rawdir)
samples += buffer.nsamp;
const FiffDirEntry::SPtr firstBuffer = raw.rawdir.first().ent;
// mne.io.read_raw_fif: 2 buffers, 6007 samples from first_samp 12900; fiff_open lists 640 directory entries
ok &= expect(raw.rawdir.size() == 2 && samples == 6007 && raw.rawdir.first().first == 12900 && firstBuffer->kind == FIFF_DATA_BUFFER,
"FiffRawDir/FiffDirEntry: 2 data buffers cover the 6007 samples from sample 12900");
Authors of this file
- Christoph Dinh <christoph.dinh@mne-cpp.org>
- Christof Pieloth <pieloth@labp.htwk-leipzig.de>
- Lorenz Esch <lorenz.esch@tu-ilmenau.de>
- Juan GPC <jgarciaprieto@mgh.harvard.edu>
- Gabriel Motta <gabrielbenmotta@gmail.com>