v2.0.0
Loading...
Searching...
No Matches
fiff_events.h
Go to the documentation of this file.
1//=============================================================================================================
36
37#ifndef FIFF_EVENTS_H
38#define FIFF_EVENTS_H
39
40//=============================================================================================================
41// INCLUDES
42//=============================================================================================================
43
44#include "fiff_global.h"
45
46//=============================================================================================================
47// QT INCLUDES
48//=============================================================================================================
49
50#include <QString>
51
52//=============================================================================================================
53// EIGEN INCLUDES
54//=============================================================================================================
55
56#include <Eigen/Core>
57
58//=============================================================================================================
59// FORWARD DECLARATIONS
60//=============================================================================================================
61
62class QIODevice;
63
64//=============================================================================================================
65// DEFINE NAMESPACE FIFFLIB
66//=============================================================================================================
67
68namespace FIFFLIB
69{
70
71// Forward declaration
72class FiffRawData;
73struct AverageCategory;
74
75//=============================================================================================================
86{
87
88public:
89 //=========================================================================================================
93 FiffEvents();
94
95 //=========================================================================================================
103 explicit FiffEvents(QIODevice &p_IODevice);
104
105 //=========================================================================================================
118 static bool read(const QString &t_sEventName,
119 const QString &t_fileRawName,
120 FiffEvents &p_Events);
121
122 //=========================================================================================================
131 static bool read_from_fif(QIODevice &p_IODevice,
132 FiffEvents &p_Events);
133
134 //=========================================================================================================
143 static bool read_from_ascii(QIODevice &p_IODevice,
144 FiffEvents &p_Events);
145
146 //=========================================================================================================
154 bool write_to_fif(QIODevice &p_IODevice) const;
155
156 //=========================================================================================================
165 bool write_to_ascii(QIODevice &p_IODevice,
166 float sfreq = 0.0f) const;
167
168 //=========================================================================================================
181 static bool detect_from_raw(const FiffRawData &raw,
182 FiffEvents &p_Events,
183 const QString &triggerCh = QString("STI 014"),
184 unsigned int triggerMask = 0xFFFFFFFF,
185 bool leadingEdge = true);
186
187 //=========================================================================================================
193 inline int num_events() const;
194
195 //=========================================================================================================
201 inline bool is_empty() const;
202
203 //=========================================================================================================
212 static bool matchEvent(const AverageCategory &cat,
213 const Eigen::MatrixXi &events,
214 int eventIdx);
215
216 Eigen::MatrixXi events;
217};
218
219} // NAMESPACE
220
221//=============================================================================================================
222// INLINE DEFINITIONS
223//=============================================================================================================
224
226{
227 return static_cast<int>(events.rows());
228}
229
230//=============================================================================================================
231
233{
234 return events.rows() == 0;
235}
236
237#endif // FIFF_EVENTS_H
Fiff library export/import macros.
#define FIFFSHARED_EXPORT
Definition fiff_global.h:52
FIFF file I/O and data structures (raw, epochs, evoked, covariance, forward).
bool write_to_ascii(QIODevice &p_IODevice, float sfreq=0.0f) const
static bool read_from_fif(QIODevice &p_IODevice, FiffEvents &p_Events)
bool write_to_fif(QIODevice &p_IODevice) const
int num_events() const
static bool read_from_ascii(QIODevice &p_IODevice, FiffEvents &p_Events)
Eigen::MatrixXi 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)
bool is_empty() const
static bool read(const QString &t_sEventName, const QString &t_fileRawName, FiffEvents &p_Events)
FIFF raw measurement data.