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//=============================================================================================================
90{
91public:
92 using SPtr = QSharedPointer<FiffInfo>;
93 using ConstSPtr = QSharedPointer<const FiffInfo>;
94 using UPtr = std::unique_ptr<FiffInfo>;
95 using ConstUPtr = std::unique_ptr<const FiffInfo>;
96
97 //=========================================================================================================
101 FiffInfo();
102
103 //=========================================================================================================
109 FiffInfo(const FiffInfo& p_FiffInfo);
110
111 //=========================================================================================================
122 FiffInfo& operator=(const FiffInfo& other) = default;
123
124 //=========================================================================================================
128 ~FiffInfo();
129
130 //=========================================================================================================
134 void clear();
135
136 //=========================================================================================================
149 bool make_compensator(fiff_int_t from, fiff_int_t to, FiffCtfComp& ctf_comp, bool exclude_comp_chs = false) const;
150
151 //=========================================================================================================
159 qint32 get_current_comp();
160
161 //=========================================================================================================
171 inline qint32 make_projector(Eigen::MatrixXd& proj) const;
172
173 //=========================================================================================================
184 inline qint32 make_projector(Eigen::MatrixXd& proj, const QStringList& p_chNames) const;
185
186 //=========================================================================================================
196 FiffInfo pick_info(const Eigen::RowVectorXi& sel = defaultVectorXi) const;
197
198 //=========================================================================================================
204 inline void set_current_comp(fiff_int_t value);
205
206 //=========================================================================================================
220 static QList<FiffChInfo> set_current_comp(QList<FiffChInfo>& listFiffChInfo, fiff_int_t value);
221
222 //=========================================================================================================
239 static bool readMegEegChannels(const QString& name,
240 bool do_meg,
241 bool do_eeg,
242 const QStringList& bads,
243 QList<FiffChInfo>& chsp,
244 int& nmegp,
245 int& neegp);
246
247 //=========================================================================================================
253 void writeToStream(FiffStream* p_pStream) const;
254
255 //=========================================================================================================
259 void print() const;
260
261private:
262 //=========================================================================================================
273 bool make_compensator(fiff_int_t kind, Eigen::MatrixXd& this_comp) const;
274
275public: //Public because it's a mne struct
278 float sfreq;
279 float linefreq;
280 float highpass;
281 float lowpass;
283 QString proj_name;
285 QString experimenter;
286 QString description;
287 QString utc_offset;
290 QList<FiffDigPoint> dig;
292 QList<FiffProj> projs;
293 QList<FiffCtfComp> comps;
294 QString acq_pars;
295 QString acq_stim;
296 QList<float> hpi_coil_freqs;
297};
298
299//=============================================================================================================
300// INLINE DEFINITIONS
301//=============================================================================================================
302
303inline qint32 FiffInfo::make_projector(Eigen::MatrixXd& proj) const
304{
305 return FiffProj::make_projector(this->projs, this->ch_names, proj, this->bads);
306}
307
308//=============================================================================================================
309
310inline qint32 FiffInfo::make_projector(Eigen::MatrixXd& proj, const QStringList& p_chNames) const
311{
312 return FiffProj::make_projector(this->projs, p_chNames, proj, this->bads);
313}
314
315//=============================================================================================================
316
318{
319 this->chs = set_current_comp(this->chs, value);
320}
321} // NAMESPACE
322
323#endif // FIFF_INFO_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.
Minimal measurement-info subset (channel list, sampling rate, basic transforms) shared by FIFF reader...
FIFF file I/O, in-memory data structures and high-level readers/writers.
qint32 fiff_int_t
Definition fiff_types.h:86
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:69
FiffInfo pick_info(const Eigen::RowVectorXi &sel=defaultVectorXi) const
void set_current_comp(fiff_int_t value)
Definition fiff_info.h:317
void print() const
QSharedPointer< const FiffInfo > ConstSPtr
Definition fiff_info.h:93
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:286
qint32 make_projector(Eigen::MatrixXd &proj) const
Definition fiff_info.h:303
FiffCoordTrans dev_ctf_t
Definition fiff_info.h:289
std::unique_ptr< FiffInfo > UPtr
Definition fiff_info.h:94
QSharedPointer< FiffInfo > SPtr
Definition fiff_info.h:92
std::unique_ptr< const FiffInfo > ConstUPtr
Definition fiff_info.h:95
QList< float > hpi_coil_freqs
Definition fiff_info.h:296
fiff_int_t gantry_angle
Definition fiff_info.h:288
void writeToStream(FiffStream *p_pStream) const
FiffCoordTrans dig_trans
Definition fiff_info.h:291
QList< FiffCtfComp > comps
Definition fiff_info.h:293
qint32 get_current_comp()
QString xplotter_layout
Definition fiff_info.h:284
fiff_int_t meas_date[2]
Definition fiff_info.h:277
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:290
QString experimenter
Definition fiff_info.h:285
FiffInfo & operator=(const FiffInfo &other)=default
QList< FiffProj > projs
Definition fiff_info.h:292
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...