v2.0.0
Loading...
Searching...
No Matches
fiff_events.h
Go to the documentation of this file.
1//=============================================================================================================
20
21#ifndef FIFF_EVENTS_H
22#define FIFF_EVENTS_H
23
24//=============================================================================================================
25// INCLUDES
26//=============================================================================================================
27
28#include "fiff_global.h"
29
30//=============================================================================================================
31// QT INCLUDES
32//=============================================================================================================
33
34#include <QString>
35
36//=============================================================================================================
37// EIGEN INCLUDES
38//=============================================================================================================
39
40#include <Eigen/Core>
41
42//=============================================================================================================
43// FORWARD DECLARATIONS
44//=============================================================================================================
45
46class QIODevice;
47
48//=============================================================================================================
49// DEFINE NAMESPACE FIFFLIB
50//=============================================================================================================
51
52namespace FIFFLIB
53{
54
55// Forward declaration
56class FiffRawData;
57struct AverageCategory;
58
59//=============================================================================================================
69{
70
71public:
72 //=========================================================================================================
77
78 //=========================================================================================================
86 explicit FiffEvents(QIODevice &p_IODevice);
87
88 //=========================================================================================================
101 static bool read(const QString &t_sEventName,
102 const QString &t_fileRawName,
103 FiffEvents &p_Events);
104
105 //=========================================================================================================
114 static bool read_from_fif(QIODevice &p_IODevice,
115 FiffEvents &p_Events);
116
117 //=========================================================================================================
126 static bool read_from_ascii(QIODevice &p_IODevice,
127 FiffEvents &p_Events);
128
129 //=========================================================================================================
137 bool write_to_fif(QIODevice &p_IODevice) const;
138
139 //=========================================================================================================
148 bool write_to_ascii(QIODevice &p_IODevice,
149 float sfreq = 0.0f) const;
150
151 //=========================================================================================================
164 static bool detect_from_raw(const FiffRawData &raw,
165 FiffEvents &p_Events,
166 const QString &triggerCh = QString("STI 014"),
167 unsigned int triggerMask = 0xFFFFFFFF,
168 bool leadingEdge = true);
169
170 //=========================================================================================================
176 inline int num_events() const;
177
178 //=========================================================================================================
184 inline bool is_empty() const;
185
186 //=========================================================================================================
195 static bool matchEvent(const AverageCategory &cat,
196 const Eigen::MatrixXi &events,
197 int eventIdx);
198
199 Eigen::MatrixXi events;
200};
201
202} // NAMESPACE
203
204//=============================================================================================================
205// INLINE DEFINITIONS
206//=============================================================================================================
207
209{
210 return static_cast<int>(events.rows());
211}
212
213//=============================================================================================================
214
216{
217 return events.rows() == 0;
218}
219
220#endif // FIFF_EVENTS_H
Export/import macros and build-info accessors for the FIFFLIB shared library.
#define FIFFSHARED_EXPORT
Definition fiff_global.h:44
FIFF file I/O, in-memory data structures and high-level readers/writers.
int num_events() const
Eigen::MatrixXi events
bool write_to_ascii(QIODevice &p_IODevice, float sfreq=0.0f) const
static bool matchEvent(const AverageCategory &cat, const Eigen::MatrixXi &events, int eventIdx)
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)
FiffEvents(QIODevice &p_IODevice)
bool write_to_fif(QIODevice &p_IODevice) const
static bool detect_from_raw(const FiffRawData &raw, FiffEvents &p_Events, const QString &triggerCh=QString("STI 014"), unsigned int triggerMask=0xFFFFFFFF, bool leadingEdge=true)
bool is_empty() const
static bool read_from_ascii(QIODevice &p_IODevice, FiffEvents &p_Events)
One averaging category in an MNE-C ave-description file: trigger logic, timing window,...