v2.0.0
Loading...
Searching...
No Matches
fiff_info_base.h
Go to the documentation of this file.
1//=============================================================================================================
30
31#ifndef FIFF_INFO_BASE_H
32#define FIFF_INFO_BASE_H
33
34//=============================================================================================================
35// INCLUDES
36//=============================================================================================================
37
38#include "fiff_global.h"
39#include "fiff_types.h"
40#include "fiff_id.h"
41#include "fiff_ch_info.h"
42#include "fiff_dig_point.h"
43#include "fiff_ctf_comp.h"
44#include "fiff_coord_trans.h"
45#include "fiff_proj.h"
46
47//=============================================================================================================
48// QT INCLUDES
49//=============================================================================================================
50
51#include <QList>
52#include <QMap>
53#include <QStringList>
54#include <QSharedPointer>
55#include <memory>
56
57//=============================================================================================================
58// DEFINE NAMESPACE FIFFLIB
59//=============================================================================================================
60
61namespace FIFFLIB
62{
63
64//=============================================================================================================
77{
78public:
79 using SPtr = QSharedPointer<FiffInfoBase>;
80 using ConstSPtr = QSharedPointer<const FiffInfoBase>;
81 using UPtr = std::unique_ptr<FiffInfoBase>;
82 using ConstUPtr = std::unique_ptr<const FiffInfoBase>;
83
84 //=========================================================================================================
89
90 //=========================================================================================================
96 FiffInfoBase(const FiffInfoBase& p_FiffInfoBase);
97
98 //=========================================================================================================
109 FiffInfoBase& operator=(const FiffInfoBase& other) = default;
110
111 //=========================================================================================================
115 virtual ~FiffInfoBase();
116
117 //=========================================================================================================
121 void clear();
122
123 //=========================================================================================================
131 QString channel_type(qint32 idx) const;
132
133 //=========================================================================================================
141 QMap<QString, QList<int>> channel_indices_by_type(const QList<int>& picks = {}) const;
142
143 //=========================================================================================================
152 static Eigen::RowVectorXi pick_channels_regexp(const QStringList& ch_names, const QString& regexp);
153
154 //=========================================================================================================
160 inline bool isEmpty() const;
161
162 //=========================================================================================================
174 static Eigen::RowVectorXi pick_channels(const QStringList& ch_names,
175 const QStringList& include = defaultQStringList,
176 const QStringList& exclude = defaultQStringList);
177
178 //=========================================================================================================
188 FiffInfoBase pick_info(const Eigen::RowVectorXi* sel = nullptr) const;
189
190 //=========================================================================================================
204 Eigen::RowVectorXi pick_types(const QString meg,
205 bool eeg = false,
206 bool stim = false,
207 const QStringList& include = defaultQStringList,
208 const QStringList& exclude = defaultQStringList) const;
209
210 //=========================================================================================================
225 Eigen::RowVectorXi pick_types(bool meg,
226 bool eeg = false,
227 bool stim = false,
228 const QStringList& include = defaultQStringList,
229 const QStringList& exclude = defaultQStringList) const;
230
239 friend bool operator==(const FiffInfoBase& a, const FiffInfoBase& b);
240
256 void mne_read_meg_comp_eeg_ch_info(QList<FiffChInfo>& megp,
257 int& nmegp,
258 QList<FiffChInfo>& meg_compp,
259 int& nmeg_compp,
260 QList<FiffChInfo>& eegp,
261 int& neegp,
262 FiffCoordTrans& meg_head_t,
263 FiffId& idp) const;
264
270 QStringList get_channel_types();
271
272 //=========================================================================================================
280 static bool readBadChannelsFromFile(const QString& name, QStringList& listOut);
281
282public:
283 QString filename;
284 QStringList bads;
287 QList<FiffChInfo> chs;
288 QStringList ch_names;
291 QList<FiffCoordTrans> all_coord_trans;
292};
293
294//=============================================================================================================
295// INLINE DEFINITIONS
296//=============================================================================================================
297
298inline bool FiffInfoBase::isEmpty() const
299{
300 return this->nchan <= 0;
301}
302
303//=============================================================================================================
304
305inline bool operator==(const FiffInfoBase& a, const FiffInfoBase& b)
306{
307 return (a.bads == b.bads &&
308 //a.meas_id == b.meas_id &&
309 a.nchan == b.nchan &&
310 a.chs == b.chs &&
311 a.ch_names == b.ch_names &&
312 a.dev_head_t == b.dev_head_t &&
313 a.ctf_head_t == b.ctf_head_t);
314}
315} // NAMESPACE
316
317#endif // FIFF_INFO_BASE_H
FIFF channel descriptor record (FIFF_CH_INFO): per-channel logical/scanner numbers,...
4x4 affine FIFF coordinate transform (FIFF_COORD_TRANS) annotated with source/destination coordinate-...
Export/import macros and build-info accessors for the FIFFLIB shared library.
#define FIFFSHARED_EXPORT
Definition fiff_global.h:44
Single digitization point (FIFF_DIG_POINT) with kind (cardinal/HPI/EEG/extra), identifier and 3D coor...
SSP projection item: a named projection vector set with active/desired flags, parsed from FIFFB_PROJ_...
128-bit FIFF identifier record (machine ID + creation time) used to stamp files, blocks and parent re...
CTF / 4D Neuroimaging software gradient-compensation matrix block (FIFFB_MNE_CTF_COMP_DATA).
Primitive scalar typedefs and forward-compatible aliases backing the FIFF type system.
FIFF file I/O, in-memory data structures and high-level readers/writers.
qint32 fiff_int_t
Definition fiff_types.h:86
bool operator==(const FiffChInfo &a, const FiffChInfo &b)
Labelled 4x4 FIFF affine: source frame, destination frame, rotation, translation and cached inverse.
128-bit FIFF identifier: hardware machine ID plus creation time, stamped on every file and block.
Definition fiff_id.h:69
Stripped FIFF measurement info: channel list, sampling rate, device→head transform and bad-channel li...
QSharedPointer< const FiffInfoBase > ConstSPtr
QList< FiffCoordTrans > all_coord_trans
QSharedPointer< FiffInfoBase > SPtr
std::unique_ptr< FiffInfoBase > UPtr
QMap< QString, QList< int > > channel_indices_by_type(const QList< int > &picks={}) const
QString channel_type(qint32 idx) const
QList< FiffChInfo > chs
FiffCoordTrans ctf_head_t
std::unique_ptr< const FiffInfoBase > ConstUPtr
FiffInfoBase & operator=(const FiffInfoBase &other)=default
FiffCoordTrans dev_head_t