v2.0.0
Loading...
Searching...
No Matches
mne_event_list.h
Go to the documentation of this file.
1//=============================================================================================================
18
19#ifndef MNE_EVENT_LIST_H
20#define MNE_EVENT_LIST_H
21
22//=============================================================================================================
23// INCLUDES
24//=============================================================================================================
25
26#include "mne_global.h"
27#include "mne_event.h"
28
29#include <QString>
30
31#include <optional>
32#include <vector>
33
34#include <Eigen/Core>
35
36//=============================================================================================================
37// DEFINE NAMESPACE MNELIB
38//=============================================================================================================
39
40namespace MNELIB
41{
42
43//=============================================================================================================
50{
51public:
52 //=========================================================================================================
61 static std::optional<MNEEventList> readFif(const QString& path, int offset = 0);
62
63 //=========================================================================================================
80 static std::optional<MNEEventList> readText(const QString& path, int offset, int oldOffset, float sfreq);
81
82 //=========================================================================================================
91 bool writeFif(const QString& path, int offset = 0) const;
92
93 //=========================================================================================================
97 void sort();
98
99 //=========================================================================================================
105 void append(const MNEEventList& other);
106
107 //=========================================================================================================
116 MNEEventList selectOnsets(unsigned int value = 0) const;
117
118 //=========================================================================================================
124 unsigned int maxOnset() const;
125
126 //=========================================================================================================
133 Eigen::MatrixXi toMatrix() const;
134
135 //=========================================================================================================
143 static MNEEventList fromMatrix(const Eigen::MatrixXi& matrix);
144
145 //=========================================================================================================
151 int nevent() const
152 {
153 return static_cast<int>(events.size());
154 }
155
156 std::vector<MNEEvent> events;
157};
158
159} // namespace MNELIB
160
161#endif // MNE_EVENT_LIST_H
Single recorded event (sample, previous and new trigger code, comment).
MNELIB shared-library export/import macros and library build metadata.
#define MNESHARED_EXPORT
Definition mne_global.h:40
Core MNE data structures (source spaces, source estimates, hemispheres).
Ordered list of trigger events with comments.
static MNEEventList fromMatrix(const Eigen::MatrixXi &matrix)
bool writeFif(const QString &path, int offset=0) const
unsigned int maxOnset() const
static std::optional< MNEEventList > readText(const QString &path, int offset, int oldOffset, float sfreq)
void append(const MNEEventList &other)
std::vector< MNEEvent > events
MNEEventList selectOnsets(unsigned int value=0) const
static std::optional< MNEEventList > readFif(const QString &path, int offset=0)
int nevent() const
Returns the number of events in the list.
Eigen::MatrixXi toMatrix() const