[Mne_analysis] Directly editing data values in mne.fiff.Raw object?

Martin Luessi mluessi at nmr.mgh.harvard.edu
Wed Dec 4 08:01:00 EST 2013
Search archives:

Hi Steve,

This is because the data is only loaded from the file when accessing it,
unless you use "preload=True" when opening the raw file. To modify the
data directly, use "preload=True" and then modify "Raw._data", which is
a numpy array with all the data.

Note that this is not officially supported (hence the "_" prefix), so it
may change from one release to the next without warning (we don't have
plans to change it, just so you are aware of it).



On 12/04/13 04:07, Stephen Politzer-Ahles wrote:
> Hello,
> I am trying to replace the data values in a Raw object in Python with
> data I've gotten from somewhere else. (Because I did some ICA-related
> stuff using other software already and rather than re-doing it, I'd like
> to just load the .fif file in Python, load the other file in Python as
> well, and then copy the data values from the other file into the Raw
> object and then save it back to a new .fif file.)
> However, the actual data values in the Raw object don't seem in a matrix
> that I can just modify. It looks like they're inside of tuples which I
> can't change (and it's not a 2-d array; for example, Raw[0] returns a
> tuple of 2 arrays, each of which is <samples> long, the first is the
> data for the first channel and the second is times). Is there any method
> for directly modifying the data in a Raw object?
> Thank you,
> Steve
> Stephen Politzer-Ahles
> New York University, Abu Dhabi
> Neuroscience of Language Lab
> http://www.nyu.edu/projects/politzer-ahles/
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis

Martin Luessi, Ph.D.

Research Fellow

Department of Radiology
Athinoula A. Martinos Center for Biomedical Imaging
Massachusetts General Hospital
Harvard Medical School
149 13th Street
Charlestown, MA 02129

Fax: +1 617 726-7422

More information about the Mne_analysis mailing list