v2.0.0
Loading...
Searching...
No Matches
inv_hpi_data_updater.h
Go to the documentation of this file.
1//=============================================================================================================
21
22#ifndef INV_HPI_DATA_UPDATER_H
23#define INV_HPI_DATA_UPDATER_H
24
25//=============================================================================================================
26// INCLUDES
27//=============================================================================================================
28
29#include "../inv_global.h"
30#include "inv_sensor_set.h"
32#include <fiff/fiff_dig_point.h>
33
34//=============================================================================================================
35// QT INCLUDES
36//=============================================================================================================
37
38#include <QSharedPointer>
39
40//=============================================================================================================
41// EIGEN INCLUDES
42//=============================================================================================================
43
44//=============================================================================================================
45// FORWARD DECLARATIONS
46//=============================================================================================================
47
48namespace FIFFLIB{
49 class FiffInfo;
50 class FiffChInfo;
51 class FiffDigPointSet;
52}
53
54//=============================================================================================================
55// DEFINE NAMESPACE HPILIB
56//=============================================================================================================
57
58namespace INVLIB
59{
60
61//=============================================================================================================
62// Declare all structures to be used
63//=============================================================================================================
64
65//=============================================================================================================
66// HPILIB FORWARD DECLARATIONS
67//=============================================================================================================
68
69//=============================================================================================================
76{
77
78public:
79 typedef QSharedPointer<InvHpiDataUpdater> SPtr;
80 typedef QSharedPointer<const InvHpiDataUpdater> ConstSPtr;
81
82 //=========================================================================================================
86 InvHpiDataUpdater(const QSharedPointer<FIFFLIB::FiffInfo> pFiffInfo);
87
88 //=========================================================================================================
95 void checkForUpdate(const QSharedPointer<FIFFLIB::FiffInfo> pFiffInfo);
96
97 //=========================================================================================================
104 void prepareDataAndProjectors(const Eigen::MatrixXd& matData, const Eigen::MatrixXd& matProjectors);
105
106 //=========================================================================================================
111 inline const QList<FIFFLIB::FiffChInfo>& getChannels();
112 inline const Eigen::MatrixXd& getProjectors();
113 inline const Eigen::MatrixXd& getHpiDigitizer();
114 inline const Eigen::MatrixXd& getData();
115 inline const Eigen::MatrixXd& getProjectedData();
116 inline const InvSensorSet& getSensors();
117
118private:
119 //=========================================================================================================
126 void updateChannels(QSharedPointer<FIFFLIB::FiffInfo> pFiffInfo);
127
128 //=========================================================================================================
135 void updateBadChannels(QSharedPointer<FIFFLIB::FiffInfo> pFiffInfo);
136
137 //=========================================================================================================
143 void updateHpiDigitizer(const QList<FIFFLIB::FiffDigPoint>& lDig);
144
145 //=========================================================================================================
152 void updateSensors(const QList<FIFFLIB::FiffChInfo>& lChannels);
153
154 //=========================================================================================================
163 bool checkIfChanged(const QList<QString>& lBads, const QList<FIFFLIB::FiffChInfo>& lChannels);
164
165 //=========================================================================================================
172 void prepareData(const Eigen::MatrixXd& matData);
173
174 //=========================================================================================================
181 void prepareProjectors(const Eigen::MatrixXd& matProjectors);
182
183 QList<FIFFLIB::FiffChInfo> m_lChannels;
184 QVector<int> m_vecInnerind;
185 QList<QString> m_lBads;
186 Eigen::MatrixXd m_matHpiDigitizer;
187 Eigen::MatrixXd m_matProjectors;
188 Eigen::MatrixXd m_matInnerdata;
189 Eigen::MatrixXd m_matDataProjected;
190 InvSensorSetCreator m_sensorSetCreator;
191 InvSensorSet m_sensors;
192
193};
194
195//=============================================================================================================
196// INLINE DEFINITIONS
197//=============================================================================================================
198
199inline const QList<FIFFLIB::FiffChInfo>& InvHpiDataUpdater::getChannels()
200{
201 return m_lChannels;
202}
203
204inline const Eigen::MatrixXd& InvHpiDataUpdater::getProjectors()
205{
206 return m_matProjectors;
207}
208
209inline const Eigen::MatrixXd& InvHpiDataUpdater::getData()
210{
211 return m_matInnerdata;
212}
213
214inline const Eigen::MatrixXd& InvHpiDataUpdater::getProjectedData()
215{
216 return m_matDataProjected;
217}
218
219inline const Eigen::MatrixXd& InvHpiDataUpdater::getHpiDigitizer()
220{
221 return m_matHpiDigitizer;
222}
223
225{
226 return m_sensors;
227}
228
229} // namespace INVLIB
230
231#endif // INV_HPI_DATA_UPDATER_H
232
Container for the FIFF_DIG_POINT records of a measurement (a parsed FIFFB_ISOTRAK block).
Single digitization point (FIFF_DIG_POINT) with kind (cardinal/HPI/EEG/extra), identifier and 3D coor...
INVLIB library export/import macros, build-info accessors, and namespace docstring for the inverse-so...
#define INVSHARED_EXPORT
Definition inv_global.h:38
Compact MEG sensor-geometry container (positions, orientations, integration weights) used by the HPI ...
FIFF file I/O, in-memory data structures and high-level readers/writers.
Inverse source estimation (MNE, dSPM, sLORETA, dipole fitting).
Per-channel FIFF descriptor: identifiers, kind, calibration, coil type, channel-frame coil position a...
Collection of FiffDigPoint records as parsed from a FIFFB_ISOTRAK block.
Full FIFF measurement info: per-channel descriptors, sampling and filter setup, projectors,...
Definition fiff_info.h:88
const Eigen::MatrixXd & getData()
const InvSensorSet & getSensors()
QSharedPointer< const InvHpiDataUpdater > ConstSPtr
const Eigen::MatrixXd & getHpiDigitizer()
const QList< FIFFLIB::FiffChInfo > & getChannels()
QSharedPointer< InvHpiDataUpdater > SPtr
void checkForUpdate(const QSharedPointer< FIFFLIB::FiffInfo > pFiffInfo)
void prepareDataAndProjectors(const Eigen::MatrixXd &matData, const Eigen::MatrixXd &matProjectors)
InvHpiDataUpdater(const QSharedPointer< FIFFLIB::FiffInfo > pFiffInfo)
const Eigen::MatrixXd & getProjectors()
const Eigen::MatrixXd & getProjectedData()
Stores MEG sensor geometry (positions, orientations, weights, coil count) for a single sensor type.
Builds InvSensorSet objects from FiffInfo channel definitions, applying SSP projections and compensat...