49 using namespace FIFFLIB;
50 using namespace Eigen;
65 : filename(p_FiffInfoBase.filename)
66 , bads(p_FiffInfoBase.bads)
67 , meas_id(
FiffId(p_FiffInfoBase.meas_id))
68 , nchan(p_FiffInfoBase.nchan)
69 , chs(p_FiffInfoBase.chs)
70 , ch_names(p_FiffInfoBase.ch_names)
71 , dev_head_t(p_FiffInfoBase.dev_head_t)
72 , ctf_head_t(p_FiffInfoBase.ctf_head_t)
86 qint32 kind = this->
chs[idx].kind;
87 if(kind == FIFFV_MEG_CH)
89 if(this->
chs[idx].unit == FIFF_UNIT_T_M)
91 else if(this->
chs[idx].unit == FIFF_UNIT_T)
96 else if(kind == FIFFV_EEG_CH)
98 else if(kind == FIFFV_STIM_CH)
100 else if(kind == FIFFV_EOG_CH)
102 else if(kind == FIFFV_EMG_CH)
104 else if(kind == FIFFV_ECG_CH)
106 else if(kind == FIFFV_MISC_CH)
112 printf(
"Unknown channel type\n");
132 RowVectorXi
FiffInfoBase::pick_types(
const QString meg,
bool eeg,
bool stim,
const QStringList& include,
const QStringList& exclude)
const
134 RowVectorXi pick = RowVectorXi::Zero(this->
nchan);
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) {
152 else if (kind == FIFFV_EEG_CH && eeg)
154 else if (kind == FIFFV_STIM_CH && stim)
160 QStringList myinclude;
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;
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) {
255 if(
chs.at(i).unit == FIFF_UNIT_T_M ) {
256 if(!lChannelTypes.contains(
"grad")) {
257 lChannelTypes <<
"grad";
259 }
else if(
chs.at(i).unit == FIFF_UNIT_T ) {
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";
300 case FIFFV_STIM_CH: {
301 if(!lChannelTypes.contains(
"stim")) {
302 lChannelTypes <<
"stim";
307 case FIFFV_MISC_CH: {
308 if(!lChannelTypes.contains(
"misc")) {
309 lChannelTypes <<
"misc";
316 return lChannelTypes;