# ctf file issues

**URL:** <https://mne.discourse.group/t/ctf-file-issues/766>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [July 30, 2014, 4:00pm UTC](https://mne.discourse.group/t/ctf-file-issues/766 "2014-07-30T16:00:48Z")\
**Posts on this page:** 9\
**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:** [July 30, 2014, 4:00pm UTC](https://mne.discourse.group/t/ctf-file-issues/766/1 "2014-07-30T16:00:48Z")

</div>

Hello MNE Experts,

In trying to deal with CTF files for the first, time I'm running into some  
issues that I don't understand and hope someone can easily help with. I  
used the mne\_ctf2fiff command to convert to fiff, but I can't visualize  
the resulting file in mne\_browse\_raw (it loads without error but just  
looks blank). Similarly, all the steps for loading a segment of the file  
as raw data in mne\_python work without error, until I do "raw.plot()",  
when I get this error:

In [20]: raw.plot()

---

<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:** [July 30, 2014, 4:04pm UTC](https://mne.discourse.group/t/ctf-file-issues/766/2 "2014-07-30T16:04:46Z")

</div>

Hi Will,

In mne\_browse\_raw you need to create channel selections suitable for the CTF data to display them. There is a file $MNE\_ROOT/share/mne/mne\_browse\_raw/mne\_browse\_raw\_CTF\_275.sel which contains selections for the 275-channel CTF system.

- Matti

---

<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:** [July 30, 2014, 4:15pm UTC](https://mne.discourse.group/t/ctf-file-issues/766/3 "2014-07-30T16:15:32Z")

</div>

Hi will,

could you share a small snippet (e.g. 100 ms) of your data like that:

raw.crop(None, 0.1)  
raw.save('my-ctf-raw.fif')

I suspect there is some channel type in your data whic is not classified as  
one of these:

['eeg', 'eog', 'ecg', 'emg', 'ref\_meg', 'stim', 'resp', 'misc', 'chpi',  
'syst', 'ias', 'exci']

Maybe your reference channels are not marked as such.  
You could try to identify them by name and remove them just for the purpose  
of plotting using

`raw.drop_channels(channel_names)`

Best,  
Denis

---

<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:** [July 30, 2014, 5:47pm UTC](https://mne.discourse.group/t/ctf-file-issues/766/4 "2014-07-30T17:47:07Z")

</div>

Thanks Matti. You're right, of course. When I invoke mne\_browse\_raw this way:

mne\_browse\_raw --digtrig UPPT001 --sel  
$MNE\_ROOT/share/mne/mne\_browse\_raw/mne\_browse\_raw\_CTF\_275.sel

I can open the raw file and view the traces. It also looks like the entire  
6-min run is continuous, even though it was acquired in short event-keyed  
epochs, so no need for an additional concatenation step I guess.

Thanks again!

-Will

---

<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:** [July 30, 2014, 6:09pm UTC](https://mne.discourse.group/t/ctf-file-issues/766/5 "2014-07-30T18:09:24Z")

</div>

Hi Denis,

Thanks for the suggestions, and for being willing to take a look at a  
snippet of data. Unfortunatley, when I run the first command you have as  
written, this happens:

---

<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:** [July 30, 2014, 6:17pm UTC](https://mne.discourse.group/t/ctf-file-issues/766/6 "2014-07-30T18:17:48Z")

</div>

Hi Will,

sorry for the confusion.

This line would work (crop makes a copy by default and `None` is only valid  
for Epochs and Evokeds):

raw.crop(0, 0.1, copy=False)  
raw.save('my-ctf-raw.fif')

# should fit into an email as attachment

Since I don't know the CTF system very well the channels don't help as  
such. It's more relevant what's in the raw.info dict, actually the type  
information used inside the plotting routine is not inferred from the  
channels names.

Denis

---

<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:** [July 30, 2014, 6:37pm UTC](https://mne.discourse.group/t/ctf-file-issues/766/7 "2014-07-30T18:37:03Z")

</div>

Hi Will,

I meanwhile opened an issue on github. People interested in the solution  
can follow the development there.

Best,  
Denis

---

<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:** [July 31, 2014, 11:53pm UTC](https://mne.discourse.group/t/ctf-file-issues/766/8 "2014-07-31T23:53:33Z")

</div>

hi Will,

I just fixed the pb on current master. The fix will be included in  
v0.8.1 in a few days.

[https://github.com/mne-tools/mne-python/commit/597681d9a7f9516bc8275053001b070f02f287a2](https://github.com/mne-tools/mne-python/commit/597681d9a7f9516bc8275053001b070f02f287a2)

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 1, 2014, 12:52am UTC](https://mne.discourse.group/t/ctf-file-issues/766/9 "2014-08-01T00:52:05Z")

</div>

Very nice, Alex. Thank you!

-Will
