52 using namespace Eigen;
70 : filename(p_FiffInfoBase.filename)
71 , bads(p_FiffInfoBase.bads)
72 , meas_id(
FiffId(p_FiffInfoBase.meas_id))
73 , nchan(p_FiffInfoBase.nchan)
74 , ch_names(p_FiffInfoBase.ch_names)
75 , dev_head_t(p_FiffInfoBase.dev_head_t)
76 , ctf_head_t(p_FiffInfoBase.ctf_head_t)
79 for(i = 0; i < p_FiffInfoBase.
chs.size(); ++i)
80 chs.append(p_FiffInfoBase.
chs[i]);
96 qint32 kind = this->
chs[idx].kind;
97 if(kind == FIFFV_MEG_CH)
101 else if(this->
chs[idx].unit == FIFF_UNIT_T)
104 else if(kind == FIFFV_REF_MEG_CH)
106 else if(kind == FIFFV_EEG_CH)
108 else if(kind == FIFFV_STIM_CH)
110 else if(kind == FIFFV_EOG_CH)
112 else if(kind == FIFFV_EMG_CH)
114 else if(kind == FIFFV_ECG_CH)
116 else if(kind == FIFFV_MISC_CH)
122 printf(
"Unknown channel type\n");
144 RowVectorXi
FiffInfoBase::pick_types(
const QString meg,
bool eeg,
bool stim,
const QStringList& include,
const QStringList& exclude)
const
146 RowVectorXi pick = RowVectorXi::Zero(this->
nchan);
150 for(k = 0; k < this->
nchan; ++k)
152 kind = this->
chs[k].kind;
154 if ((kind == FIFFV_MEG_CH || kind == FIFFV_REF_MEG_CH))
156 if(meg.compare(
"all") == 0)
160 else if(meg.compare(
"mag") == 0 && this->
chs[k].unit == FIFF_UNIT_T)
163 else if (kind == FIFFV_EEG_CH && eeg)
165 else if (kind == FIFFV_STIM_CH && stim)
171 QStringList myinclude;
172 for(k = 0; k < this->
nchan; ++k)
181 if (include.size() > 0)
183 for (k = 0; k < include.size(); ++k)
185 myinclude << include[k];
202 return this->
pick_types(QString(
"all"), eeg, stim, include, exclude);
204 return this->
pick_types(QString(
""), eeg, stim, include, exclude);
212 RowVectorXi sel = RowVectorXi::Zero(ch_names.size());
214 QStringList t_includedSelection;
217 for(qint32 k = 0; k < ch_names.size(); ++k)
219 if( (include.size() == 0 || include.contains(ch_names[k])) && !exclude.contains(ch_names[k]))
222 if(!t_includedSelection.contains(ch_names[k]))
226 t_includedSelection << ch_names[k];
230 sel.conservativeResize(count);
248 for(qint32 i = 0; i < sel->size(); ++i)
251 res.
chs.append(this->
chs[idx]);
254 res.
nchan = sel->size();
Universially unique identifier.
FiffCoordTrans ctf_head_t
FiffInfoBase class declaration.
FiffCoordTrans dev_head_t
RowVectorXi pick_types(const QString meg, bool eeg=false, bool stim=false, const QStringList &include=defaultQStringList, const QStringList &exclude=defaultQStringList) const
QString channel_type(qint32 idx) const
FiffInfoBase pick_info(const RowVectorXi *sel=NULL) const
static RowVectorXi pick_channels(const QStringList &ch_names, const QStringList &include=defaultQStringList, const QStringList &exclude=defaultQStringList)