# Average with MNE: Memory Allocation Failed

**URL:** https://mne.discourse.group/t/average-with-mne-memory-allocation-failed/124
**Category:** Mailing List Archive (read-only)
**Tags:** list-archive
**Created:** [May 14, 2009, 5:33pm UTC](https://mne.discourse.group/t/average-with-mne-memory-allocation-failed/124 "2009-05-14T17:33:23Z")
**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 14, 2009, 5:33pm UTC](https://mne.discourse.group/t/average-with-mne-memory-allocation-failed/124/1 "2009-05-14T17:33:23Z")

</div>

Hello everyone,

I have a problem to average my data across subjects.  
I have 7 files per subject of 750 Mo each and 7 subjects.  
I tried mne\_process\_raw to average my data all together. At around the two  
third of the process I have this error message : 'fiff\_read\_tag: memory  
allocation failed'.  
I tried to use the MNE matlab toolbox. I averaged my subjects separately and  
then try to load the averages in Matlab to average all the subjects together  
in matlab. But there also is a problem of memory while loading the data.

Does anybody have an idea of how I could solve this ?

Also, does anybody know how to save the terminal info while using the  
mne\_process\_raw command ? I would like to know how many trials mne averaged  
in each category and save it in a file.

Thanks in advance,

Lucie

2009/4/28 Matti Hamalainen \<msh at nmr.mgh.harvard.edu\>

> Hello all,
> 
> Thanks to Fran?ois Tadel from USC and John Mosher from Cleveland Clinic,  
> one major and a few minor bottlenecks were identified in the MNE Matlab  
> Toolbox. I modified the code on the basis of their findings and, as a  
> result, the fif file I/O is now much faster. I packaged the improved version  
> as MNE Matlab 2.6.1 and this new version is now available on the download  
> web site.
> 
> This new package is highly recommended for those of you who use the MNE  
> Matlab tools.
> 
> The Martinos Center public MNE installation has been updated.
> 
> Other users need to:
> 
> 1. Download MNE-dist-matlab-2.6.1-090428065405.tar.gz from the MNE download  
> web site.
> 
> 2. Goto the directory \*containing\* $MNE\_ROOT, i.e., $MNE\_ROOT/..
> 
> 3. Say
> 
> tar zxvf \<where the download is\>/MNE-dist-matlab-2.6.1-090428065405.tar.gz
> 
> \<where the download is\> is the path to the directory where you downloaded  
> the software.
> 
> Best,  
> Matti
> 
> &nbsp;&nbsp;---------
> 
> Matti Hamalainen, Ph.D.  
> Athinoula A. Martinos Center for Biomedical Imaging  
> Massachusetts General Hospital
> 
> msh at nmr.mgh.harvard.edu
> 
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> 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)

-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20090514/c25be590/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20090514/c25be590/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: [May 14, 2009, 8:00pm UTC](https://mne.discourse.group/t/average-with-mne-memory-allocation-failed/124/2 "2009-05-14T20:00:08Z")

</div>

Hi Lucie,

See some replies in text.

> Hello everyone,
> 
> I have a problem to average my data across subjects.  
> I have 7 files per subject of 750 Mo each and 7 subjects.  
> I tried mne\_process\_raw to average my data all together. At around  
> the two third of the process I have this error message :  
> 'fiff\_read\_tag: memory allocation failed'.  
> I tried to use the MNE matlab toolbox. I averaged my subjects  
> separately and then try to load the averages in Matlab to average  
> all the subjects together in matlab. But there also is a problem of  
> memory while loading the data.
> 
> Does anybody have an idea of how I could solve this ?

Load them one at a time i.e.  
data=fiff\_read\_evoked('subject1')  
for i=2:6)  
data2=fiff\_read\_evoked(['subject' i])  
data.evoked=data.evoked+data2.evoked;  
end  
data.evoked=data.evoked./7;

> Also, does anybody know how to save the terminal info while using  
> the mne\_process\_raw command ? I would like to know how many trials  
> mne averaged in each category and save it in a file.

Lucie this is already in both the fif file and in the log file  
generated by mne\_process\_raw.

> Thanks in advance,
> 
> Lucie
> 
> 2009/4/28 Matti Hamalainen \<msh at nmr.mgh.harvard.edu\>
> 
> Hello all,
> 
> Thanks to Fran?ois Tadel from USC and John Mosher from Cleveland  
> Clinic, one major and a few minor bottlenecks were identified in  
> the MNE Matlab Toolbox. I modified the code on the basis of their  
> findings and, as a result, the fif file I/O is now much faster. I  
> packaged the improved version as MNE Matlab 2.6.1 and this new  
> version is now available on the download web site.
> 
> This new package is highly recommended for those of you who use the  
> MNE Matlab tools.
> 
> The Martinos Center public MNE installation has been updated.
> 
> Other users need to:
> 
> 1. Download MNE-dist-matlab-2.6.1-090428065405.tar.gz from the MNE  
> download web site.
> 
> 2. Goto the directory \*containing\* $MNE\_ROOT, i.e., $MNE\_ROOT/..
> 
> 3. Say
> 
> tar zxvf \<where the download is\>/MNE-dist-  
> matlab-2.6.1-090428065405.tar.gz
> 
> \<where the download is\> is the path to the directory where you  
> downloaded the software.
> 
> Best,  
> Matti
> 
> ---------
> 
> Matti Hamalainen, Ph.D.  
> Athinoula A. Martinos Center for Biomedical Imaging  
> Massachusetts General Hospital
> 
> msh at nmr.mgh.harvard.edu
> 
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> 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)
> 
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> 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/20090514/599a1588/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20090514/599a1588/attachment.html)
