# The issue of converting EDF to FIF format

**URL:** <https://mne.discourse.group/t/the-issue-of-converting-edf-to-fif-format/753>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [July 2, 2014, 3:20pm UTC](https://mne.discourse.group/t/the-issue-of-converting-edf-to-fif-format/753 "2014-07-02T15:20:10Z")\
**Posts on this page:** 15\
**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 2, 2014, 3:20pm UTC](https://mne.discourse.group/t/the-issue-of-converting-edf-to-fif-format/753/1 "2014-07-02T15:20:10Z")

</div>

Hi all MEN users,

I used Net station to save recorded EEG data to EDF format. When I used  
mne\_edf2fiff to convert our EDF file to FIF file, I got this error message,

$ mne\_edf2fiff --edf Recording\_9\_fil.edf --fif Recording\_9\_fil.fif

mne\_edf2fiff version 1.6 compiled at Dec 21 2009 19:46:35

EDF/EDF+/BDF file (input) : Recording\_9\_fil.edf  
No electrode position data specified.  
fif file (output) : Recording\_9\_fil.fif

Parsing EDF/EDF+/BDF header...[failed]  
Unequal sampling rates across data channels are not supported.

Best

Xiaoxiao  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20140702/929d5949/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20140702/929d5949/attachment.html)

---

<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 2, 2014, 4:13pm UTC](https://mne.discourse.group/t/the-issue-of-converting-edf-to-fif-format/753/2 "2014-07-02T16:13:18Z")

</div>

Hi Xiaoxiao,

What types of data are in there? The error message suggests that there is  
data with different sampling rates. Do you have channels with different  
sampling rates? If yes, can you re-export the data removing the data with  
different sampling rates?

HTH,  
D

---

<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 2, 2014, 4:38pm UTC](https://mne.discourse.group/t/the-issue-of-converting-edf-to-fif-format/753/3 "2014-07-02T16:38:18Z")

</div>

Dear Dgw,

Thank you for you help. This file only includes signals of 128 channels  
with same sample rate.

After that, I input EGI Net Station data into BrainVision and then save as  
EDF file. This BrainVision EDF file can be converted to FIF file.

I used matlab toolbox to read this FIF file and its header information and  
data are correct.

But I can not display it in the mne\_browse\_raw (see attached screenshot).

Best

Xiaoxiao

> Hi Xiaoxiao,
> 
> What types of data are in there? The error message suggests that there is  
> data with different sampling rates. Do you have channels with different  
> sampling rates? If yes, can you re-export the data removing the data with  
> different sampling rates?
> 
> HTH,  
> D
> 
> > Hi all MEN users,
> > 
> > I used Net station to save recorded EEG data to EDF format. When I used  
> > mne\_edf2fiff to convert our EDF file to FIF file, I got this error message,
> > 
> > $ mne\_edf2fiff --edf Recording\_9\_fil.edf --fif Recording\_9\_fil.fif
> > 
> > mne\_edf2fiff version 1.6 compiled at Dec 21 2009 19:46:35
> > 
> > EDF/EDF+/BDF file (input) : Recording\_9\_fil.edf  
> > No electrode position data specified.  
> > fif file (output) : Recording\_9\_fil.fif
> > 
> > Parsing EDF/EDF+/BDF header...[failed]  
> > Unequal sampling rates across data channels are not supported.
> > 
> > Best
> > 
> > Xiaoxiao
> > 
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > Mne\_analysis mailing list  
> > Mne\_analysis at nmr.mgh.harvard.edu  
> > [Mne\_analysis Info Page](https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis)
> > 
> > The information in this e-mail is intended only for the person to whom it  
> > is  
> > addressed. If you believe this e-mail was sent to you in error and the  
> > e-mail  
> > contains patient information, please contact the Partners Compliance  
> > HelpLine at  
> > [MyComplianceReport.com: Compliance and Ethics Reporting](http://www.partners.org/complianceline) . If the e-mail was sent to you  
> > in error  
> > but does not contain patient information, please contact the sender and  
> > properly  
> > dispose of the e-mail.
> 
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> Mne\_analysis mailing list  
> Mne\_analysis at nmr.mgh.harvard.edu  
> [Mne\_analysis Info Page](https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis)
> 
> The information in this e-mail is intended only for the person to whom it  
> is  
> addressed. If you believe this e-mail was sent to you in error and the  
> e-mail  
> contains patient information, please contact the Partners Compliance  
> HelpLine at  
> [MyComplianceReport.com: Compliance and Ethics Reporting](http://www.partners.org/complianceline) . If the e-mail was sent to you in  
> error  
> but does not contain patient information, please contact the sender and  
> properly  
> dispose of the e-mail.

-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20140702/b52322e3/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20140702/b52322e3/attachment.html)  
-------------- next part --------------  
A non-text attachment was scrubbed...  
Name: Screenshot from 2014-07-02 12:30:46.png  
Type: image/png  
Size: 78121 bytes  
Desc: not available  
Url : [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20140702/b52322e3/attachment.png](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20140702/b52322e3/attachment.png)

---

<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 2, 2014, 4:49pm UTC](https://mne.discourse.group/t/the-issue-of-converting-edf-to-fif-format/753/4 "2014-07-02T16:49:05Z")

</div>

Hi Xiaoxiao,

we meanwhile have direct reading + conversion support for EGI data  
in MNE-Python (development version),

Take a look at: mne.io.egi.read\_raw\_egi

It supports the native egi raw format.

Hope this helps,  
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 2, 2014, 5:30pm UTC](https://mne.discourse.group/t/the-issue-of-converting-edf-to-fif-format/753/5 "2014-07-02T17:30:08Z")

</div>

Well, you will need to add a selection type to fit the Channel names. This  
section describes what you need to do:

[http://martinos.org/mne/stable/manual/browse.html?highlight=selection#caccjejd](http://martinos.org/mne/stable/manual/browse.html?highlight=selection#caccjejd)

HTH,  
D

---

<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 2, 2014, 6:35pm UTC](https://mne.discourse.group/t/the-issue-of-converting-edf-to-fif-format/753/6 "2014-07-02T18:35:44Z")

</div>

Dear Dgw,

Thank you for your help. I can display them.

Best

Xiaoxiao

---

<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 2, 2014, 6:36pm UTC](https://mne.discourse.group/t/the-issue-of-converting-edf-to-fif-format/753/7 "2014-07-02T18:36:53Z")

</div>

Dear Denis,

I have installed MNE python. It can read EGI raw file.

Best

Xiaoxiao

---

<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 2, 2014, 6:50pm UTC](https://mne.discourse.group/t/the-issue-of-converting-edf-to-fif-format/753/8 "2014-07-02T18:50:53Z")

</div>

Xiaoxiao, great!

Glad to hear it worked.

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 2, 2014, 10:17pm UTC](https://mne.discourse.group/t/the-issue-of-converting-edf-to-fif-format/753/9 "2014-07-02T22:17:26Z")

</div>

Dear Denis,

Thank you for your help. I have another simple question about saving elp  
and EGI raw as a fif file.

I use raw = mne.io.egi.read\_raw\_egi() to read EGI raw data and elc =  
mne.fiff.kit.read\_elp() to read elp file.

How can I combine raw and elc and save them into one fif file?

Best

Xiaoxiao

---

<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 2, 2014, 10:32pm UTC](https://mne.discourse.group/t/the-issue-of-converting-edf-to-fif-format/753/10 "2014-07-02T22:32:15Z")

</div>

Hi,

we currently only support that at the epochs stage:

[http://martinos.org/mne/dev/generated/mne.epochs.add\_channels\_epochs.html](http://martinos.org/mne/dev/generated/mne.epochs.add_channels_epochs.html)

you need compatible sampling rates

HTH,  
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 3, 2014, 12:15am UTC](https://mne.discourse.group/t/the-issue-of-converting-edf-to-fif-format/753/11 "2014-07-03T00:15:30Z")

</div>

Dear Denis,

Thank you for your help.

elc = mne.fiff.kit.read\_elp() get electrode locations acquired from  
Polhemus system.

raw = mne.io.egi.read\_raw\_egi() get fif data object from EGI raw data file.

We want to add electrode locations elc into raw rather than epochs.

Best

Xiaoxiao

---

<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 3, 2014, 2:24am UTC](https://mne.discourse.group/t/the-issue-of-converting-edf-to-fif-format/753/12 "2014-07-03T02:24:36Z")

</div>

Hi

You can add the digitizer data from the raw kit data to the raw egi data. There are no built in functions for this but it shouldn't be too hard just be sure to match them up correctly. However currently raw data from one MEG and a different EEG system can't be combined because a lot of checks and potentially some corrections need to be done to combine these data. The kind of approximation the epic hung code makes is not safe to use on long stretches of data like you have in raw files.  
Hth  
D

---

<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 3, 2014, 12:57pm UTC](https://mne.discourse.group/t/the-issue-of-converting-edf-to-fif-format/753/13 "2014-07-03T12:57:33Z")

</div>

Hi Xiaoxiao,

it turns out I misread your question.  
If you want to add the electrode positions manually  
you have to update the corresponding fields in the raw.info['chs'] for each  
channel. It's the first three entries in the 'loc' and the the first row of  
the matrix in 'eeg\_loc'.

To give an example:

[https://github.com/dengemann/mne-python/blob/montage/mne/montages/montage.py#L166](https://github.com/dengemann/mne-python/blob/montage/mne/montages/montage.py#L166)

HTH,  
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 3, 2014, 1:17pm UTC](https://mne.discourse.group/t/the-issue-of-converting-edf-to-fif-format/753/14 "2014-07-03T13:17:39Z")

</div>

HI Denis,

Thank you for your help.

Best

Xiaoxiao

---

<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 3, 2014, 1:18pm UTC](https://mne.discourse.group/t/the-issue-of-converting-edf-to-fif-format/753/15 "2014-07-03T13:18:26Z")

</div>

Hi Dgw,

Thanks a lot.

Best

Xiaoxiao
