FiffAnnotations
Namespace: FIFFLIB · Library: FIFF Library
mne.Annotations in MNE-Python.
#include <fiff/fiff_annotations.h>
class FIFFLIB::FiffAnnotations
Container for FiffAnnotation entries with FIFF, JSON and CSV serializers.
Read and written under FIFFB_MNE_ANNOTATIONS so the annotation list travels with the FIFF file. The JSON and CSV exporters let the same annotations be consumed by BIDS sidecars and by external scoring tools that do not understand FIFF directly.
Public Methods
FiffAnnotations()
Constructs an empty FiffAnnotations object.
size()
Returns the number of annotations.
Returns:
- int — Number of annotations.
isEmpty()
Returns true if no annotations are stored.
Returns:
- bool — True if empty.
operator[](index)
Const subscript operator.
Parameters:
- index : int Index of the annotation.
Returns:
- const FiffAnnotation & — Const reference to the annotation.
operator[](index)
Subscript operator.
Parameters:
- index : int Index of the annotation.
Returns:
- FiffAnnotation & — Reference to the annotation.
append(annotation)
Appends an annotation.
Parameters:
- annotation : const FiffAnnotation & The annotation to append.
append(onset, duration, description, channelNames, comment)
Appends an annotation by fields.
Parameters:
-
onset : double Onset in seconds.
-
duration : double Duration in seconds.
-
description : const QString & Description label.
-
channelNames : const QStringList & Channel names (empty for global).
-
comment : const QString & Optional comment.
remove(index)
Removes the annotation at the given index.
Parameters:
- index : int Index to remove.
clear()
Removes all annotations.
toVector()
Returns a const reference to the underlying vector.
Returns:
- const QVector< FiffAnnotation > & — Const reference to annotation vector.
onsetToSample(index, sfreq, firstSample)
Converts onset of annotation at index to a sample number.
Parameters:
-
index : int Annotation index.
-
sfreq : double Sampling frequency in Hz.
-
firstSample : int First sample offset.
Returns:
- int — Sample number.
endToSample(index, sfreq, firstSample)
Converts end (onset+duration) of annotation at index to a sample number.
Parameters:
-
index : int Annotation index.
-
sfreq : double Sampling frequency in Hz.
-
firstSample : int First sample offset.
Returns:
- int — Sample number.
select(descriptionFilter)
Selects annotations whose description starts with the filter string.
Parameters:
- descriptionFilter : const QString & Prefix to match.
Returns:
- FiffAnnotations — Filtered annotations.