FIFF event container with reading, writing and detection. More...
#include <fiff_events.h>
Public Member Functions | |
| FiffEvents () | |
| FiffEvents (QIODevice &p_IODevice) | |
| bool | write_to_fif (QIODevice &p_IODevice) const |
| bool | write_to_ascii (QIODevice &p_IODevice, float sfreq=0.0f) const |
| int | num_events () const |
| bool | is_empty () const |
Static Public Member Functions | |
| static bool | read (const QString &t_sEventName, const QString &t_fileRawName, FiffEvents &p_Events) |
| static bool | read_from_fif (QIODevice &p_IODevice, FiffEvents &p_Events) |
| static bool | read_from_ascii (QIODevice &p_IODevice, FiffEvents &p_Events) |
| static bool | detect_from_raw (const FiffRawData &raw, FiffEvents &p_Events, const QString &triggerCh=QString("STI 014"), unsigned int triggerMask=0xFFFFFFFF, bool leadingEdge=true) |
| static bool | matchEvent (const AverageCategory &cat, const Eigen::MatrixXi &events, int eventIdx) |
Public Attributes | |
| Eigen::MatrixXi | events |
FIFF event container with reading, writing and detection.
Provides FIFF event storage and I/O operations.
Each event is stored as a row in an Nx3 matrix: [sample, before, after]. The class provides methods to read/write events from/to FIFF or ASCII files, and to detect events from raw data trigger channels.
Definition at line 85 of file fiff_events.h.
| FiffEvents::FiffEvents | ( | ) |
Default constructor. Creates an empty event set.
Definition at line 69 of file fiff_events.cpp.
|
explicit |
Constructs FiffEvents by reading from an I/O device.
Attempts to read as FIFF first; if that fails, tries ASCII format.
| [in] | p_IODevice | The I/O device to read from. |
Definition at line 75 of file fiff_events.cpp.
|
static |
Detect trigger events from raw data using a stimulus channel. Ported from detect_events (MNE-C).
| [in] | raw | The raw data. |
| [out] | p_Events | The detected events. |
| [in] | triggerCh | Name of the trigger channel (empty = default "STI 014"). |
| [in] | triggerMask | Bitmask to apply to trigger values. |
| [in] | leadingEdge | If true, only detect rising edges (default = true). |
Definition at line 287 of file fiff_events.cpp.
|
inline |
Returns true if no events are stored.
Definition at line 232 of file fiff_events.h.
|
static |
Check whether an event matches a category definition.
| [in] | cat | The averaging category to match against. |
| [in] | events | Full event matrix (nEvents x 3): [sample, from, to]. |
| [in] | eventIdx | Index of the current event row. |
Definition at line 351 of file fiff_events.cpp.
|
inline |
Returns the number of events.
Definition at line 225 of file fiff_events.h.
|
static |
Read events from a FIFF or ASCII event file.
If t_sEventName is empty, the event file name is derived from the raw file name (replacing ".fif" with "-eve.fif").
| [in] | t_sEventName | Path to the event file (empty = derive from raw file name). |
| [in] | t_fileRawName | Path to the raw data file (used to derive event file name if needed). |
| [out] | p_Events | The loaded events. |
Definition at line 85 of file fiff_events.cpp.
|
static |
Read a list of events from an ASCII event file.
| [in] | p_IODevice | The I/O device to read from. |
| [out] | p_Events | The loaded events. |
Definition at line 215 of file fiff_events.cpp.
|
static |
Read an event list from a FIFF file.
| [in] | p_IODevice | The I/O device to read from. |
| [out] | p_Events | The loaded events. |
Definition at line 131 of file fiff_events.cpp.
| bool FiffEvents::write_to_ascii | ( | QIODevice & | p_IODevice, |
| float | sfreq = 0.0f ) const |
Write the event list to a text file (MNE-C compatible format).
| [in] | p_IODevice | The I/O device to write to. |
| [in] | sfreq | Sampling frequency for time column computation. |
Definition at line 262 of file fiff_events.cpp.
| bool FiffEvents::write_to_fif | ( | QIODevice & | p_IODevice | ) | const |
Write the event list to a FIFF file.
| [in] | p_IODevice | The I/O device to write to. |
Definition at line 243 of file fiff_events.cpp.
| Eigen::MatrixXi FIFFLIB::FiffEvents::events |
Event matrix (nEvents x 3): [sample, before, after].
Definition at line 216 of file fiff_events.h.