# writing raw fif files

**URL:** <https://mne.discourse.group/t/writing-raw-fif-files/270>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [October 25, 2010, 5:12pm UTC](https://mne.discourse.group/t/writing-raw-fif-files/270 "2010-10-25T17:12:13Z")\
**Posts on this page:** 5\
**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:** [October 25, 2010, 5:12pm UTC](https://mne.discourse.group/t/writing-raw-fif-files/270/1 "2010-10-25T17:12:13Z")

</div>

Hi MNE users,

in order to update some triggers in my raw data I started working with  
the example script mne\_ex\_read\_write\_raw.m. It works, but the script  
somehow changes the structure of the raw data (which makes it impossible  
to use it afterwards with other software packages). Is it possible to  
get the raw data written in a new file exactly as the original data?  
This is not the case with the example script in its current form.

Suggestions are highly appreciated.

Thanks and best wishes,

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sebastian  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20101025/83a095ba/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20101025/83a095ba/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:** [October 25, 2010, 7:03pm UTC](https://mne.discourse.group/t/writing-raw-fif-files/270/2 "2010-10-25T19:03:40Z")

</div>

Hi Sebastian,

You'll have to provide some more details as to what problems, you are having with the resulting data, and what exactly you are doing to the data. I myself have used the MNE code for reading and writing raw files, and I have not had any problems using them with SPM 5, SPM 8, and FieldTrip. What software are you having difficulty with?

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:** [October 25, 2010, 7:36pm UTC](https://mne.discourse.group/t/writing-raw-fif-files/270/3 "2010-10-25T19:36:53Z")

</div>

Hi Daniel,

thanks for the prompt response and sorry for the missing piece of  
information. I updated some trigger information in order to be able to  
apply the data to ELEKTAs beamformer algorithm. This algorithm works  
with the original data but for the rewritten data I always get an error  
message.  
To make sure that is nothing to do with my trigger updates I ran the  
orignal version of the example script mne\_ex\_read\_write\_raw.m, assuming  
that it simply generates a an identical file of the original data.  
However, comparing both files with ELEKTAs show\_fiff program reveals  
several differences between them. I also checked both files in Matlab  
and found differences in the datastruct.rawdir - then I gave up.

Best,

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sebastian

schrieb Daniel G Wakeman:

> Hi Sebastian,
> 
> You'll have to provide some more details as to what problems, you are having with the resulting data, and what exactly you are doing to the data. I myself have used the MNE code for reading and writing raw files, and I have not had any problems using them with SPM 5, SPM 8, and FieldTrip. What software are you having difficulty with?
> 
> D
> 
> > Hi MNE users,
> > 
> > in order to update some triggers in my raw data I started working with the example script mne\_ex\_read\_write\_raw.m. It works, but the script somehow changes the structure of the raw data (which makes it impossible to use it afterwards with other software packages). Is it possible to get the raw data written in a new file exactly as the original data? This is not the case with the example script in its current form.
> > 
> > Suggestions are highly appreciated.
> > 
> > Thanks and best wishes,
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;Sebastian  
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > 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)

-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20101025/3b3dfd85/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20101025/3b3dfd85/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:** [October 25, 2010, 7:50pm UTC](https://mne.discourse.group/t/writing-raw-fif-files/270/4 "2010-10-25T19:50:20Z")

</div>

Hi,

There are certainly differences, the output is not an exact replica of  
the original. What kind of an error message do you get? Which MNE  
version are you using?

- 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:** [October 25, 2010, 7:54pm UTC](https://mne.discourse.group/t/writing-raw-fif-files/270/5 "2010-10-25T19:54:55Z")

</div>

Hi,

the beamformer algorithm says: 'ERROR in what\_kind\_of\_fiffile: Cannot  
open data file'  
I am using MNE-2.6.1

best,

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sebastian

schrieb Matti Hamalainen:

> Hi,
> 
> There are certainly differences, the output is not an exact replica of  
> the original. What kind of an error message do you get? Which MNE  
> version are you using?
> 
> - Matti
> 
> > Hi Daniel,
> > 
> > thanks for the prompt response and sorry for the missing piece of  
> > information. I updated some trigger information in order to be able  
> > to apply the data to ELEKTAs beamformer algorithm. This algorithm  
> > works with the original data but for the rewritten data I always get  
> > an error message.  
> > To make sure that is nothing to do with my trigger updates I ran the  
> > orignal version of the example script mne\_ex\_read\_write\_raw.m,  
> > assuming that it simply generates a an identical file of the original  
> > data. However, comparing both files with ELEKTAs show\_fiff program  
> > reveals several differences between them. I also checked both files  
> > in Matlab and found differences in the datastruct.rawdir - then I  
> > gave up.
> > 
> > Best,
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sebastian
> > 
> > schrieb Daniel G Wakeman:
> > 
> > > Hi Sebastian,
> > > 
> > > You'll have to provide some more details as to what problems, you are having with the resulting data, and what exactly you are doing to the data. I myself have used the MNE code for reading and writing raw files, and I have not had any problems using them with SPM 5, SPM 8, and FieldTrip. What software are you having difficulty with?
> > > 
> > > D
> > > 
> > > > Hi MNE users,
> > > > 
> > > > in order to update some triggers in my raw data I started working with the example script mne\_ex\_read\_write\_raw.m. It works, but the script somehow changes the structure of the raw data (which makes it impossible to use it afterwards with other software packages). Is it possible to get the raw data written in a new file exactly as the original data? This is not the case with the example script in its current form.
> > > > 
> > > > Suggestions are highly appreciated.
> > > > 
> > > > Thanks and best wishes,
> > > > 
> > > > &nbsp;&nbsp;&nbsp;&nbsp;Sebastian  
> > > > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > > > Mne\_analysis mailing list  
> > > > Mne\_analysis at nmr.mgh.harvard.edu  
> > > > [https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne\_analysis](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  
> > > > [http://www.partners.org/complianceline](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  
> > > [https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne\_analysis](https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis)
> > 
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > Mne\_analysis mailing list  
> > Mne\_analysis at nmr.mgh.harvard.edu  
> > \<mailto:Mne\_analysis at nmr.mgh.harvard.edu\>  
> > [https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne\_analysis](https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis)
> 
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> Mne\_analysis mailing list  
> Mne\_analysis at nmr.mgh.harvard.edu  
> [https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne\_analysis](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  
> [http://www.partners.org/complianceline](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/20101025/23b9bc8f/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20101025/23b9bc8f/attachment.html)
