# Overwriting data in raw fif file

**URL:** <https://mne.discourse.group/t/overwriting-data-in-raw-fif-file/1261>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [July 17, 2017, 5:21pm UTC](https://mne.discourse.group/t/overwriting-data-in-raw-fif-file/1261 "2017-07-17T17:21:39Z")\
**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:** [July 17, 2017, 5:21pm UTC](https://mne.discourse.group/t/overwriting-data-in-raw-fif-file/1261/1 "2017-07-17T17:21:39Z")

</div>

Hi,

I have some data saved in a matlab array that I'd like to do source  
localization on. I was thinking of replacing the data in an existing raw  
fif file (created in mne-python by reading in a brainvision file) with the  
matlab data, so that the subject-specific info and other parameters in the  
mne raw object will be preserved. I'm doing this using:

rawcopy = raw.copy()  
rawcopy.\_data = matlabdata

I noticed that raw.\_data is in a 'memmap' format, whereas matlab data read  
into Python is in the 'array' format. Is it ok to replace the memmap data  
with the array data as I'm doing above, or will it cause processing  
problems? What's the difference between the memmap and array formats?

Thanks and Best Regards,  
Gladia  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20170717/71633ac0/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20170717/71633ac0/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 17, 2017, 7:49pm UTC](https://mne.discourse.group/t/overwriting-data-in-raw-fif-file/1261/2 "2017-07-17T19:49:39Z")

</div>

Hi Gladia,

> I have some data saved in a matlab array that I'd like to do source  
> localization on. I was thinking of replacing the data in an existing raw fif  
> file (created in mne-python by reading in a brainvision file) with the  
> matlab data, so that the subject-specific info and other parameters in the  
> mne raw object will be preserved. I'm doing this using:
> 
> rawcopy = raw.copy()  
> rawcopy.\_data = matlabdata

yes that will work but you'll need channel locations for source reconstruction.

> I noticed that raw.\_data is in a 'memmap' format, whereas matlab data read  
> into Python is in the 'array' format. Is it ok to replace the memmap data  
> with the array data as I'm doing above, or will it cause processing  
> problems? What's the difference between the memmap and array formats?

memmap allows to have the data on disk and not in memory.

HTH  
Alex
