MNE-CPP
0.1.9
A Framework for Electrophysiology
Loading...
Searching...
No Matches
src
libraries
mne
mne_epoch_data.cpp
Go to the documentation of this file.
1
//=============================================================================================================
37
//=============================================================================================================
38
// INCLUDES
39
//=============================================================================================================
40
41
#include "
mne_epoch_data.h
"
42
43
#include <
utils/mnemath.h
>
44
45
//=============================================================================================================
46
// USED NAMESPACES
47
//=============================================================================================================
48
49
using namespace
MNELIB;
50
using namespace
Eigen;
51
using namespace
UTILSLIB;
52
53
//=============================================================================================================
54
// DEFINE MEMBER METHODS
55
//=============================================================================================================
56
57
MNEEpochData::MNEEpochData
()
58
: event(-1)
59
, tmin(-1)
60
, tmax(-1)
61
, bReject(false)
62
{
63
}
64
65
//=============================================================================================================
66
67
MNEEpochData::MNEEpochData
(
const
MNEEpochData
&p_MNEEpochData)
68
: epoch(p_MNEEpochData.epoch)
69
, event(p_MNEEpochData.event)
70
, tmin(p_MNEEpochData.tmin)
71
, tmax(p_MNEEpochData.tmax)
72
, bReject(p_MNEEpochData.bReject)
73
{
74
}
75
76
//=============================================================================================================
77
78
MNEEpochData::~MNEEpochData
()
79
{
80
}
81
82
//=============================================================================================================
83
84
void
MNEEpochData::applyBaselineCorrection
(
const
QPair<float, float>& baseline)
85
{
86
// Run baseline correction
87
RowVectorXf times = RowVectorXf::LinSpaced(this->
epoch
.cols(), this->tmin, this->tmax);
88
this->
epoch
=
MNEMath::rescale
(this->
epoch
, times, baseline, QString(
"mean"
));
89
}
90
91
//=============================================================================================================
92
93
void
MNEEpochData::pick_channels
(
const
RowVectorXi& sel)
94
{
95
if
(sel.cols() == 0) {
96
qWarning(
"MNEEpochData::pick_channels - Warning : No channels were provided.\n"
);
97
return
;
98
}
99
100
// Reduce data set
101
MatrixXd selBlock(1,1);
102
103
if
(selBlock.rows() != sel.cols() || selBlock.cols() !=
epoch
.cols()) {
104
selBlock.resize(sel.cols(),
epoch
.cols());
105
}
106
107
for
(qint32 l = 0; l < sel.cols(); ++l) {
108
if
(sel(l) <=
epoch
.rows()) {
109
selBlock.row(l) =
epoch
.row(sel(0,l));
110
}
else
{
111
qWarning(
"FiffEvoked::pick_channels - Warning : Selected channel index out of bound.\n"
);
112
}
113
}
114
115
epoch
= selBlock;
116
}
mnemath.h
MNEMath class declaration.
mne_epoch_data.h
MNEEpochData class declaration.
MNELIB::MNEEpochData
epoch data
Definition
mne_epoch_data.h:74
MNELIB::MNEEpochData::pick_channels
void pick_channels(const Eigen::RowVectorXi &sel)
Definition
mne_epoch_data.cpp:93
MNELIB::MNEEpochData::applyBaselineCorrection
void applyBaselineCorrection(const QPair< float, float > &baseline)
Definition
mne_epoch_data.cpp:84
MNELIB::MNEEpochData::epoch
Eigen::MatrixXd epoch
Definition
mne_epoch_data.h:134
MNELIB::MNEEpochData::MNEEpochData
MNEEpochData()
Definition
mne_epoch_data.cpp:57
MNELIB::MNEEpochData::~MNEEpochData
~MNEEpochData()
Definition
mne_epoch_data.cpp:78
UTILSLIB::MNEMath::rescale
static Eigen::MatrixXd rescale(const Eigen::MatrixXd &data, const Eigen::RowVectorXf ×, const QPair< float, float > &baseline, QString mode)
Generated on Sat Feb 14 2026 16:30:24 for MNE-CPP by
1.9.8