Ordered list of trigger events with comments. More...
#include <mne_event_list.h>
Public Member Functions | |
| bool | writeFif (const QString &path, int offset=0) const |
| void | sort () |
| void | append (const MNEEventList &other) |
| MNEEventList | selectOnsets (unsigned int value=0) const |
| unsigned int | maxOnset () const |
| Eigen::MatrixXi | toMatrix () const |
| int | nevent () const |
| Returns the number of events in the list. | |
Static Public Member Functions | |
| static std::optional< MNEEventList > | readFif (const QString &path, int offset=0) |
| static std::optional< MNEEventList > | readText (const QString &path, int offset, int oldOffset, float sfreq) |
| static MNEEventList | fromMatrix (const Eigen::MatrixXi &matrix) |
Public Attributes | |
| std::vector< MNEEvent > | events |
Ordered list of trigger events with comments.
Definition at line 49 of file mne_event_list.h.
| void MNEEventList::append | ( | const MNEEventList & | other | ) |
Appends the events of another list (MNE-C mne_add_to_event_list).
| [in] | other | The events to append. |
Definition at line 191 of file mne_event_list.cpp.
|
static |
Builds a list from rows of sample, value before and value after.
| [in] | matrix | nEvents x 3 matrix as returned by toMatrix(). |
Definition at line 233 of file mne_event_list.cpp.
| unsigned int MNEEventList::maxOnset | ( | ) | const |
Returns the largest trigger value that starts from 0.
Definition at line 209 of file mne_event_list.cpp.
|
inline |
Returns the number of events in the list.
Definition at line 151 of file mne_event_list.h.
|
static |
Reads the event block of a FIFF file (MNE-C mne_load_events_fiff).
| [in] | path | A -eve.fif file or a raw file carrying an event block. |
| [in] | offset | Samples to subtract from every event, e.g. the first sample of the recording. |
Definition at line 50 of file mne_event_list.cpp.
|
static |
Reads an MNE-C text event file (MNE-C mne_load_events).
Each line holds sample, time, trigger value before and after, and an optional comment; # starts a comment line. A negative sample is computed from the time. A first line with both trigger values 0 marks the current format: it gives the first sample of the recording and is not an event. Old files have no such line; their samples are shifted by oldOffset instead.
| [in] | path | The text file. |
| [in] | offset | Samples to subtract from every event (the recording's first sample). |
| [in] | oldOffset | Extra offset used by files in the old format. |
| [in] | sfreq | Sampling frequency, to convert times of events without a sample. |
Definition at line 85 of file mne_event_list.cpp.
| MNEEventList MNEEventList::selectOnsets | ( | unsigned int | value = 0 | ) | const |
Keeps the onsets of one trigger value (MNE-C filter_events): events rising from 0 to value, or every onset if value is 0.
| [in] | value | The trigger value to keep, or 0 for all onsets. |
Definition at line 198 of file mne_event_list.cpp.
| void MNEEventList::sort | ( | ) |
Sorts the events by sample; events at the same sample keep their order.
Definition at line 182 of file mne_event_list.cpp.
| Eigen::MatrixXi MNEEventList::toMatrix | ( | ) | const |
Returns the events as rows of sample, value before and value after, the layout of FIFFLIB::FiffEvents::events and of mne.read_events.
Definition at line 222 of file mne_event_list.cpp.
| bool MNEEventList::writeFif | ( | const QString & | path, |
| int | offset = 0 ) const |
Writes the list as an event block with comments, readable by mne.read_events.
| [in] | path | The output file. |
| [in] | offset | Samples to add back to every event. |
Definition at line 139 of file mne_event_list.cpp.
| std::vector<MNEEvent> MNELIB::MNEEventList::events |
The events.
Definition at line 156 of file mne_event_list.h.