86 qint32 kind = this->
chs[idx].kind;
112 printf(
"Unknown channel type\n");
132RowVectorXi
FiffInfoBase::pick_types(
const QString meg,
bool eeg,
bool stim,
const QStringList& include,
const QStringList& exclude)
const
134 RowVectorXi pick = RowVectorXi::Zero(this->
nchan);
138 for(k = 0; k < this->
nchan; ++k)
140 kind = this->
chs[k].kind;
144 if(meg.compare(
"all") == 0) {
146 }
else if(meg.compare(
"grad") == 0 && this->chs[k].unit ==
FIFF_UNIT_T_M) {
148 }
else if(meg.compare(
"mag") == 0 && this->chs[k].unit ==
FIFF_UNIT_T) {
160 QStringList myinclude;
161 for(k = 0; k < this->nchan; ++k)
170 if (include.size() > 0)
172 for (k = 0; k < include.size(); ++k)
174 myinclude << include[k];
191 return this->
pick_types(QString(
"all"), eeg, stim, include, exclude);
193 return this->
pick_types(QString(
""), eeg, stim, include, exclude);
200 RowVectorXi sel = RowVectorXi::Zero(
ch_names.size());
202 QStringList t_includedSelection;
205 for(qint32 k = 0; k <
ch_names.size(); ++k)
207 if( (include.size() == 0 || include.contains(
ch_names[k])) && !exclude.contains(
ch_names[k]))
210 if(!t_includedSelection.contains(
ch_names[k]))
218 sel.conservativeResize(count);
235 for(qint32 i = 0; i < sel->size(); ++i)
238 res.
chs.append(this->
chs[idx]);
241 res.
nchan = sel->size();
249 QStringList lChannelTypes;
251 for(
int i = 0; i <
chs.size(); ++i)
253 switch(
chs.at(i).kind) {
256 if(!lChannelTypes.contains(
"grad")) {
257 lChannelTypes <<
"grad";
260 if(!lChannelTypes.contains(
"mag")) {
261 lChannelTypes <<
"mag";
268 if(!lChannelTypes.contains(
"ref_meg")) {
269 lChannelTypes <<
"ref_meg";
275 if(!lChannelTypes.contains(
"eeg")) {
276 lChannelTypes <<
"eeg";
282 if(!lChannelTypes.contains(
"ecg")) {
283 lChannelTypes <<
"ecg";
288 if(!lChannelTypes.contains(
"emg")) {
289 lChannelTypes <<
"emg";
294 if(!lChannelTypes.contains(
"eog")) {
295 lChannelTypes <<
"eog";
301 if(!lChannelTypes.contains(
"stim")) {
302 lChannelTypes <<
"stim";
308 if(!lChannelTypes.contains(
"misc")) {
309 lChannelTypes <<
"misc";
316 return lChannelTypes;
FiffInfoBase class declaration.
FIFF file I/O and data structures (raw, epochs, evoked, covariance, forward).
Universally unique identifier.
static Eigen::RowVectorXi pick_channels(const QStringList &ch_names, const QStringList &include=defaultQStringList, const QStringList &exclude=defaultQStringList)
QString channel_type(qint32 idx) const
FiffInfoBase pick_info(const Eigen::RowVectorXi *sel=nullptr) const
FiffCoordTrans ctf_head_t
QStringList get_channel_types()
Eigen::RowVectorXi pick_types(const QString meg, bool eeg=false, bool stim=false, const QStringList &include=defaultQStringList, const QStringList &exclude=defaultQStringList) const
FiffCoordTrans dev_head_t