# Bad channels

**URL:** <https://mne.discourse.group/t/bad-channels/352>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [August 30, 2011, 2:36pm UTC](https://mne.discourse.group/t/bad-channels/352 "2011-08-30T14:36:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [August 30, 2011, 2:36pm UTC](https://mne.discourse.group/t/bad-channels/352/1 "2011-08-30T14:36:22Z")

</div>

Dear Matti,

I am trying to mark the channels with the value=0 early in the  
pre-process ,as to avoid the NaN error (not a number) ,later on when i  
try to divide by channel sizes.

As per the mne 2.7 manual (part 11.4.1) The command is:

mne\_mark\_bad\_channels --bad subjectid\_bads.bad subjectid.fif

However the .bad file (which is a text file) must contain all the  
channel names ([http://tinyurl.com/3p5pg8h](http://tinyurl.com/3p5pg8h))

So, In the .ds original folder the channel names are found in this  
file called HZ.acq .I assume so because the word "ChannelName" is  
repeated in the the file when opened with notepad.  
However ,The channel names are too scattered in notepad to be of use.  
It can be read via this software ([http://tinyurl.com/43ros3a](http://tinyurl.com/43ros3a)) which  
requires a visual basic platform .  
Any ideas on how to obtain a list of the channel names ?

Thanks  
Mostafa

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [August 30, 2011, 2:53pm UTC](https://mne.discourse.group/t/bad-channels/352/2 "2011-08-30T14:53:41Z")

</div>

Dear Mostafa,

> Dear Matti,

I guess "Dear MNE users" is more adapted 🙂

to answer you question I would either read the channel names from the  
mne\_browse\_raw GUI  
or if you want to extract them automatically I would load the fit file  
in matlab or python and read the created structure.

in matlab

raw = fiff\_setup\_read\_raw('subjectid.fif')  
for k in 1:raw.info.nchan  
&nbsp;&nbsp;&nbsp;&nbsp;raw.info.chs(k).ch\_name  
end

(I think ie. untested)

in python

import mne  
raw = mne.fiff.Raw('subjectid.fif')  
raw.ch\_names

Best,  
Alex

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [August 30, 2011, 8:24pm UTC](https://mne.discourse.group/t/bad-channels/352/3 "2011-08-30T20:24:55Z")

</div>

Hi,
