# write fif files

**URL:** <https://mne.discourse.group/t/write-fif-files/2203>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [May 27, 2020, 4:56pm UTC](https://mne.discourse.group/t/write-fif-files/2203 "2020-05-27T16:56:12Z")\
**Posts on this page:** 2\
**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:** [May 27, 2020, 4:56pm UTC](https://mne.discourse.group/t/write-fif-files/2203/1 "2020-05-27T16:56:12Z")

</div>

External Email - Use Caution

Dear mne programmers,

I load from a tutorial in brainstorm the fif file:  
mind004\_050924\_median01\_raw.fif  
as you seen in the attached image after loading we have the channel and raw  
file

The information from the file coil\_def.dat is integrated in the channel  
file when loading data from CTF .res4 or Elekta .fif files. But in my case  
I I edited the coil\_def.dat file and aslo I edited the channel file after  
loading the fif file mind004\_050924\_median01\_raw.fif,

My questions:

-Brainstorm does not provide any FIF writer. How can I write those file in  
MNE Python?  
-How can I deal with problem in mne ? editing the meg channel files and  
coil\_def.dat channel, and making the information from the file  
coil\_def.dat is integrated in the channel file then compute the forward  
problem?

Best regards  
A  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20200527/6a771a3b/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200527/6a771a3b/attachment.html)  
-------------- next part --------------  
A non-text attachment was scrubbed...  
Name: loading.png  
Type: image/png  
Size: 5019 bytes  
Desc: not available  
Url : [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20200527/6a771a3b/attachment.png](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200527/6a771a3b/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:** [May 27, 2020, 6:21pm UTC](https://mne.discourse.group/t/write-fif-files/2203/2 "2020-05-27T18:21:16Z")

</div>

External Email - Use Caution

> -Brainstorm does not provide any FIF writer. How can I write those file  
> in MNE Python?

Read, edit, save:

raw = mne.io.read\_raw\_fif(...) # filename, etc.  
raw.info['chs'][idx][...] = ... # edit however you need  
raw.save(...) # write to some new filename

> -How can I deal with problem in mne ? editing the meg channel files and  
> coil\_def.dat channel, and making the information from the file  
> coil\_def.dat is integrated in the channel file then compute the forward  
> problem?

Make your own coil\_def.dat and use  
[mne.use\_coil\_def — MNE 1.6.0 documentation](https://mne.tools/stable/generated/mne.use_coil_def.html), see for example  
[Page Redirection](https://mne.tools/stable/auto_examples/datasets/plot_opm_data.html#sphx-glr-auto-examples-datasets-plot-opm-data-py)

Eric  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20200527/168cf530/attachment-0001.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200527/168cf530/attachment-0001.html)
