v2.0.0
Loading...
Searching...
No Matches
fiff_annotation_event_utils.h File Reference

Conversion helpers between FIFF annotations and the integer stim-channel event list used by epoching / averaging. More...

#include "fiff_global.h"
#include "fiff_annotations.h"
#include <QMap>
#include <QString>
#include <Eigen/Core>
Include dependency graph for fiff_annotation_event_utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

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

Functions

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

Detailed Description

Conversion helpers between FIFF annotations and the integer stim-channel event list used by epoching / averaging.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors

Author
Christoph Dinh chris.nosp@m.toph.nosp@m..dinh.nosp@m.@mne.nosp@m.-cpp..nosp@m.org
Since
2.2.1
Date
May 2026

Two representations coexist in MNE workflows: free-text FiffAnnotation entries (onset / duration / description) and integer (sample, prev, code) event triples extracted from a stim channel or fed to mne.Epochs. These free functions translate between the two: mapping annotation descriptions to event codes via a description→code table, exploding annotation durations into start / stop event pairs, and the reverse aggregation. They mirror mne.events_from_annotations and mne.annotations_from_events in MNE-Python.

Definition in file fiff_annotation_event_utils.h.