v2.0.0
Loading...
Searching...
No Matches
fiff_info.h
Go to the documentation of this file.
1//=============================================================================================================
33
34#ifndef FIFF_INFO_H
35#define FIFF_INFO_H
36
37//=============================================================================================================
38// INCLUDES
39//=============================================================================================================
40
41#include "fiff_global.h"
42
43#include "fiff_info_base.h"
44
45#include "fiff_types.h"
46#include "fiff_id.h"
47#include "fiff_ch_info.h"
48#include "fiff_dig_point.h"
49#include "fiff_ctf_comp.h"
50#include "fiff_coord_trans.h"
51#include "fiff_proj.h"
52
53//=============================================================================================================
54// QT INCLUDES
55//=============================================================================================================
56
57#include <QList>
58#include <QStringList>
59#include <QSharedPointer>
60#include <memory>
61
62//=============================================================================================================
63// DEFINE NAMESPACE FIFFLIB
64//=============================================================================================================
65
66namespace FIFFLIB
67{
68
69//=============================================================================================================
70// FIFFLIB FORWARD DECLARATIONS
71//=============================================================================================================
72
73class FiffStream;
74
75//=============================================================================================================
88{
89public:
90 using SPtr = QSharedPointer<FiffInfo>;
91 using ConstSPtr = QSharedPointer<const FiffInfo>;
92 using UPtr = std::unique_ptr<FiffInfo>;
93 using ConstUPtr = std::unique_ptr<const FiffInfo>;
94
95 //=========================================================================================================
99 FiffInfo();
100
101 //=========================================================================================================
107 FiffInfo(const FiffInfo& p_FiffInfo);
108
109 //=========================================================================================================
113 ~FiffInfo();
114
115 //=========================================================================================================
119 void clear();
120
121 //=========================================================================================================
134 bool make_compensator(fiff_int_t from, fiff_int_t to, FiffCtfComp& ctf_comp, bool exclude_comp_chs = false) const;
135
136 //=========================================================================================================
144 qint32 get_current_comp();
145
146 //=========================================================================================================
156 inline qint32 make_projector(Eigen::MatrixXd& proj) const;
157
158 //=========================================================================================================
169 inline qint32 make_projector(Eigen::MatrixXd& proj, const QStringList& p_chNames) const;
170
171 //=========================================================================================================
181 FiffInfo pick_info(const Eigen::RowVectorXi &sel = defaultVectorXi) const;
182
183 //=========================================================================================================
189 inline void set_current_comp(fiff_int_t value);
190
191 //=========================================================================================================
205 static QList<FiffChInfo> set_current_comp(QList<FiffChInfo>& listFiffChInfo, fiff_int_t value);
206
207 //=========================================================================================================
224 static bool readMegEegChannels(const QString& name,
225 bool do_meg,
226 bool do_eeg,
227 const QStringList& bads,
228 QList<FiffChInfo>& chsp,
229 int& nmegp,
230 int& neegp);
231
232 //=========================================================================================================
238 void writeToStream(FiffStream* p_pStream) const;
239
240 //=========================================================================================================
244 void print() const;
245
246private:
247 //=========================================================================================================
258 bool make_compensator(fiff_int_t kind, Eigen::MatrixXd& this_comp) const;
259
260public: //Public because it's a mne struct
262 fiff_int_t meas_date[2];
263 float sfreq;
264 float linefreq;
265 float highpass;
266 float lowpass;
268 QString proj_name;
270 QString experimenter;
271 QString description;
272 QString utc_offset;
273 fiff_int_t gantry_angle;
275 QList<FiffDigPoint> dig;
277 QList<FiffProj> projs;
278 QList<FiffCtfComp> comps;
279 QString acq_pars;
280 QString acq_stim;
281};
282
283//=============================================================================================================
284// INLINE DEFINITIONS
285//=============================================================================================================
286
287inline qint32 FiffInfo::make_projector(Eigen::MatrixXd& proj) const
288{
289 return FiffProj::make_projector(this->projs,this->ch_names, proj, this->bads);
290}
291
292//=============================================================================================================
293
294inline qint32 FiffInfo::make_projector(Eigen::MatrixXd& proj, const QStringList& p_chNames) const
295{
296 return FiffProj::make_projector(this->projs, p_chNames, proj, this->bads);
297}
298
299//=============================================================================================================
300
301inline void FiffInfo::set_current_comp(fiff_int_t value)
302{
303 this->chs = set_current_comp(this->chs, value);
304}
305} // NAMESPACE
306
307#endif // FIFF_INFO_H
128-bit FIFF identifier record (machine ID + creation time) used to stamp files, blocks and parent re...
Minimal measurement-info subset (channel list, sampling rate, basic transforms) shared by FIFF reader...
SSP projection item: a named projection vector set with active/desired flags, parsed from FIFFB_PROJ_...
FIFF channel descriptor record (FIFF_CH_INFO): per-channel logical/scanner numbers,...
Export/import macros and build-info accessors for the FIFFLIB shared library.
#define FIFFSHARED_EXPORT
Definition fiff_global.h:44
4x4 affine FIFF coordinate transform (FIFF_COORD_TRANS) annotated with source/destination coordinate-...
Single digitization point (FIFF_DIG_POINT) with kind (cardinal/HPI/EEG/extra), identifier and 3D coor...
Primitive scalar typedefs and forward-compatible aliases backing the FIFF type system.
CTF / 4D Neuroimaging software gradient-compensation matrix block (FIFFB_MNE_CTF_COMP_DATA).
FIFF file I/O, in-memory data structures and high-level readers/writers.
Labelled 4x4 FIFF affine: source frame, destination frame, rotation, translation and cached inverse.
One CTF software-gradient compensation matrix: grade kind, calibration flag and the gradiometer × ref...
128-bit FIFF identifier: hardware machine ID plus creation time, stamped on every file and block.
Definition fiff_id.h:66
FiffInfo pick_info(const Eigen::RowVectorXi &sel=defaultVectorXi) const
void set_current_comp(fiff_int_t value)
Definition fiff_info.h:301
void print() const
QSharedPointer< const FiffInfo > ConstSPtr
Definition fiff_info.h:91
static bool readMegEegChannels(const QString &name, bool do_meg, bool do_eeg, const QStringList &bads, QList< FiffChInfo > &chsp, int &nmegp, int &neegp)
QString description
Definition fiff_info.h:271
qint32 make_projector(Eigen::MatrixXd &proj) const
Definition fiff_info.h:287
FiffCoordTrans dev_ctf_t
Definition fiff_info.h:274
std::unique_ptr< FiffInfo > UPtr
Definition fiff_info.h:92
QSharedPointer< FiffInfo > SPtr
Definition fiff_info.h:90
std::unique_ptr< const FiffInfo > ConstUPtr
Definition fiff_info.h:93
fiff_int_t gantry_angle
Definition fiff_info.h:273
void writeToStream(FiffStream *p_pStream) const
FiffCoordTrans dig_trans
Definition fiff_info.h:276
QList< FiffCtfComp > comps
Definition fiff_info.h:278
qint32 get_current_comp()
QString xplotter_layout
Definition fiff_info.h:269
fiff_int_t meas_date[2]
Definition fiff_info.h:262
bool make_compensator(fiff_int_t from, fiff_int_t to, FiffCtfComp &ctf_comp, bool exclude_comp_chs=false) const
QList< FiffDigPoint > dig
Definition fiff_info.h:275
QString experimenter
Definition fiff_info.h:270
QList< FiffProj > projs
Definition fiff_info.h:277
QList< FiffChInfo > chs
static fiff_int_t make_projector(const QList< FiffProj > &projs, const QStringList &ch_names, Eigen::MatrixXd &proj, const QStringList &bads=defaultQStringList, Eigen::MatrixXd &U=defaultMatrixXd)
FIFF tag-stream reader/writer: wraps a QIODevice and exposes typed read_* / write_* methods for every...