90 qint32 kind = this->
chs[idx].kind;
116 qWarning(
"Unknown channel type\n");
136RowVectorXi
FiffInfoBase::pick_types(
const QString meg,
bool eeg,
bool stim,
const QStringList& include,
const QStringList& exclude)
const
138 RowVectorXi pick = RowVectorXi::Zero(this->
nchan);
142 for(k = 0; k < this->
nchan; ++k)
144 kind = this->
chs[k].kind;
148 if(meg.compare(
"all") == 0) {
150 }
else if(meg.compare(
"grad") == 0 && this->chs[k].unit ==
FIFF_UNIT_T_M) {
152 }
else if(meg.compare(
"mag") == 0 && this->chs[k].unit ==
FIFF_UNIT_T) {
164 QStringList myinclude;
165 for(k = 0; k < this->nchan; ++k)
174 if (include.size() > 0)
176 for (k = 0; k < include.size(); ++k)
178 myinclude << include[k];
195 return this->
pick_types(QString(
"all"), eeg, stim, include, exclude);
197 return this->
pick_types(QString(
""), eeg, stim, include, exclude);
204 RowVectorXi sel = RowVectorXi::Zero(
ch_names.size());
206 QStringList t_includedSelection;
209 for(qint32 k = 0; k <
ch_names.size(); ++k)
211 if( (include.size() == 0 || include.contains(
ch_names[k])) && !exclude.contains(
ch_names[k]))
214 if(!t_includedSelection.contains(
ch_names[k]))
222 sel.conservativeResize(count);
239 for(qint32 i = 0; i < sel->size(); ++i)
242 res.
chs.append(this->
chs[idx]);
245 res.
nchan = sel->size();
253 QList<FiffChInfo>& meg_compp,
255 QList<FiffChInfo>& eegp,
260 for (
int k = 0; k <
nchan; k++) {
265 meg_compp.append(
chs[k]);
280 QStringList lChannelTypes;
282 for(
int i = 0; i <
chs.size(); ++i)
284 switch(
chs.at(i).kind) {
287 if(!lChannelTypes.contains(
"grad")) {
288 lChannelTypes <<
"grad";
291 if(!lChannelTypes.contains(
"mag")) {
292 lChannelTypes <<
"mag";
299 if(!lChannelTypes.contains(
"ref_meg")) {
300 lChannelTypes <<
"ref_meg";
306 if(!lChannelTypes.contains(
"eeg")) {
307 lChannelTypes <<
"eeg";
313 if(!lChannelTypes.contains(
"ecg")) {
314 lChannelTypes <<
"ecg";
319 if(!lChannelTypes.contains(
"emg")) {
320 lChannelTypes <<
"emg";
325 if(!lChannelTypes.contains(
"eog")) {
326 lChannelTypes <<
"eog";
332 if(!lChannelTypes.contains(
"stim")) {
333 lChannelTypes <<
"stim";
339 if(!lChannelTypes.contains(
"misc")) {
340 lChannelTypes <<
"misc";
347 return lChannelTypes;
354 if (name.isEmpty()) {
360 if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
361 qCritical() <<
"Cannot open bad channel file:" << name;
366 QTextStream in(&file);
367 while (!in.atEnd()) {
368 QString line = in.readLine().trimmed();
369 if (line.isEmpty() || line.startsWith(
'#'))
374 if (file.error() != QFileDevice::NoError) {
375 qCritical() <<
"Error reading bad channel file:" << name;
FiffInfoBase class declaration.
FIFF file I/O and data structures (raw, epochs, evoked, covariance, forward).
Coordinate transformation description.
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
void mne_read_meg_comp_eeg_ch_info(QList< FiffChInfo > &megp, int &nmegp, QList< FiffChInfo > &meg_compp, int &nmeg_compp, QList< FiffChInfo > &eegp, int &neegp, FiffCoordTrans &meg_head_t, FiffId &idp) const
static bool readBadChannelsFromFile(const QString &name, QStringList &listOut)
FiffCoordTrans dev_head_t