Skip to main content

FiffInfoBase

Namespace: FIFFLIB  ·  Library: FIFF Library

#include <fiff/fiff_info_base.h>

class FIFFLIB::FiffInfoBase

Stripped FIFF measurement info: channel list, sampling rate, device→head transform and bad-channel list.

Owns just the fields needed to interpret a data matrix: chs, ch_names, nchan, sfreq, bads, dev_head_t, ctf_head_t. Base class of FiffInfo, used directly when the rest of the acquisition metadata is not available (e.g. realtime client streams, trimmed evoked files).

src/examples/ex_fiff_api/main.cpp
QFile rawFile(dir + "/sample_audvis_trunc_raw.fif");
FiffRawData raw(rawFile); // reads the measurement info, raw data is read on demand
const FiffInfo& info = raw.info; // channels, sampling rate, bads, projectors, digitizer, transforms
const FiffChInfo& first = info.chs[0];
const RowVectorXi megPicks = info.pick_types(true, false, false, QStringList(), info.bads); // good MEG channels

Inheritance​


Public Methods​

FiffInfoBase()​

Constructors the light fiff measurement file information.


FiffInfoBase(p_FiffInfoBase)​

Copy constructor.

Parameters:

  • p_FiffInfoBase : const FiffInfoBase & light FIFF measurement information 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:

Returns:


~FiffInfoBase()​

Destroys the light fiff measurement file information.


clear()​

Initializes light FIFF measurement information.


channel_type(idx)​

Get channel type.

Parameters:

  • idx : qint32 Index of channel.

Returns:

  • QString — Type of channel as in mne.channel_type ('grad', 'mag', 'eeg', 'seeg', 'ecog', 'hbo', 'eyegaze', ...).

channel_indices_by_type(picks)​

Channel indices of each channel type, like mne.channel_indices_by_type.

Parameters:

  • picks : const QList< int > & Channels to classify (empty: all).

Returns:

  • QMap< QString, QList< int > > — Every channel type mapped to the indices of its channels (empty lists for absent types).

pick_data_channels(exclude)​

The data channels (MEG including reference MEG, EEG, CSD, sEEG, ECoG, DBS, fNIRS), like mne's picks="data".

Parameters:

  • exclude : const QStringList & Channel names to leave out, e.g. the bads.

Returns:

  • Eigen::RowVectorXi — The channel indices in channel order.

isEmpty()​

True if FIFF measurement file information is empty.

Returns:

  • bool — true if FIFF measurement file information is empty.

pick_info(sel)​

fiff_pick_info

Pick desired channels from measurement info

Parameters:

  • sel : *const Eigen::RowVectorXi ** List of channels to select.

Returns:


pick_types(meg, eeg, stim, include, exclude)​

fiff_pick_types (highy diversity in meg picking)

Create a selector to pick desired channel types from data

Parameters:

  • meg : const QString It can be "all", to select all or it can be "mag" or "grad" to select only gradiometers or magnetometers.

  • eeg : bool Include EEG channels.

  • stim : bool Include stimulus channels.

  • include : const QStringList & Additional channels to include (if empty, do not add any).

  • exclude : const QStringList & Channels to exclude (if empty, do not exclude any).

Returns:

  • Eigen::RowVectorXi — the selector matrix (row vector).

pick_types(meg, eeg, stim, include, exclude)​

fiff_pick_types

Create a selector to pick desired channel types from data Use overloaded pick_types method to specify meg (grad, mag, ref_meg)type

Parameters:

  • meg : bool Include MEG channels.

  • eeg : bool Include EEG channels.

  • stim : bool Include stimulus channels.

  • include : const QStringList & Additional channels to include (if empty, do not add any).

  • exclude : const QStringList & Channels to exclude (if empty, do not exclude any).

Returns:

  • Eigen::RowVectorXi — the selector matrix (row vector).

mne_read_meg_comp_eeg_ch_info(megp, nmegp, meg_compp, nmeg_compp, eegp, neegp, meg_head_t, idp)​

Read MEG, compensation, and EEG channel information from this measurement info.

Classifies channels by kind (FIFFV_MEG_CH, FIFFV_REF_MEG_CH, FIFFV_EEG_CH) and returns the device-to-head transform and measurement ID.

Parameters:

  • megp : QList< FiffChInfo > & List of MEG channel info descriptors.

  • nmegp : int & Number of MEG channels found.

  • meg_compp : QList< FiffChInfo > & List of MEG compensation (reference) channel info descriptors.

  • nmeg_compp : int & Number of compensation channels found.

  • eegp : QList< FiffChInfo > & List of EEG channel info descriptors.

  • neegp : int & Number of EEG channels found.

  • meg_head_t : FiffCoordTrans & Device-to-head coordinate transformation.

  • idp : FiffId & Measurement ID.


get_channel_types()​

Parses the channel info information and returns a string list of channel types.

Returns:

  • QStringList — The distinct channel types in channel order, as channel_type() names them (unknown kinds skipped).

Static Methods​

pick_channels_regexp(ch_names, regexp)​

Indices of the channel names that match a regular expression from their start, like mne.pick_channels_regexp.

Parameters:

  • ch_names : const QStringList & The channel names.

  • regexp : const QString & The regular expression (Perl syntax).

Returns:

  • Eigen::RowVectorXi — The selector (row vector).

pick_channels(ch_names, include, exclude)​

fiff_pick_channels

Make a selector to pick desired channels from data

Parameters:

  • ch_names : const QStringList &

    • The channel name list to consult.
  • include : const QStringList &

    • Channels to include (if empty, include all available).
  • exclude : const QStringList &

    • Channels to exclude (if empty, do not exclude any).

Returns:

  • Eigen::RowVectorXi — the selector matrix (row Vector).

readBadChannelsFromFile(name, listOut)​

Read bad channel names from a plain text file (one name per line, '#' comments skipped).

Parameters:

  • name : const QString & Path to the bad channel file (empty string is a no-op).

  • listOut : QStringList & The bad channel names read from the file.

Returns:

  • bool — true on success, false on error.

Example​

Authors of this file​