mne_raw2mat (inverse)

Hi everyone,

Does anyone know if there is a way to effectively invert mne_raw2mat? Basically, we have dumped all of our MEG channels to Matlab where we run a series of preprocessing steps, but now we want to replace the MEG channels (and just the MEG channels, we want to leave all the other channels alone) in the original raw .fif file. I tried using the read and write fif commands in Matlab for this, but ran into some errors and was wondering if there was an alternative since this seems like a simple replacing of specific data channels in a fif file (otherwise I will play around with the Matlab commands some more). Many thanks.

Avniel

I would recommend looking into the matlab function "mne_ex_read_write_raw" and trying it again in matlab. I just did something very similar to what you describe, using their script as a skeleton for mine, and it worked flawlessly. Good luck!

Elli

Hi Elli,

This is actually the first thing that came to my mind as well, however I got the following error: "Reference to non-existent field 'FIFFB_HPI_MEAS'." The error is in fiff_start_writing_raw . I am thinking this is because my data is from a CTF machine and due to some difference in the way the data is referenced in CTF vs. Neuromag data, but have no idea how to work around this error. Anyone have any ideas of how to work around this or another way to replace the MEG channels in a raw .fif file? Many thanks!

Avniel

I would recommend looking into the matlab function "mne_ex_read_write_raw" and trying it again in matlab. I just did something very similar to what you describe, using their script as a skeleton for mine, and it worked flawlessly. Good luck!

Elli