mne_ex_read_write_raw

Hello MNE users,

I have a question regarding the function mne_ex_read_write_raw.m which
allows to read and write back a raw fif file.

We do have raw files that have been acquired in 2008 and at that time we
exported the events (with mne_browse_raw, v2.6.0). The event file was in the
old format (time correspond to time starting after the HPI -20s). Now if I'm
am exporting again the event on the same data with the same mne_version
(2.6.0) , my events will be in the new format (skipping HPI time on the
first line + 0 0 and now the time correspond to trigger time + skipping
time). If using the newer version (2.7.3) I do have the same thing. My first
question is can we not export anymore event file in the old format even with
an old mne_version(2.6.0)?

I realise that the format event is not a problem, because mne_process_raw
could handle both event formats for those files and creating an appropriate
average (identical whatever the event format is).

However here is my problem:

We want to use the command mne_ex_read_write_raw.m (we are removing blinks
with ICA and write back the raw fiff data). After re-writing the data in
fiff format, mne_process_raw is not able anymore to handle the old event
format (it is still detecting which format it is) but the average with the
old format is wrong. If using the new format event, the average is correct.

I am thinking that this function (mne_ex_read_write_raw.m) is missing to
write back some information (in the header perhaps) that will help
mne_process_raw (and potentially other mne_command) to handle the older
format.

An easy way will be to re-export all our events files (time comsuming), but
I was wondering if you have another idea?

Best,

Elisabeth

Dear Elisabeth,

the only thing that comes to my mind is to check the first_samp attribute of raw
(raw.first_samp) returned by fiff_setup_read_raw.m and check that it's
consistent
before and after ICA correction.

HTH
Alex

Hello again,
Thanks Alex for your answer
I did check this and the first_samp are the same in both files , also number
of total samples.
I also did a test using an original file and passed it through the
mne_read_write_raw function (without ICA stuff)
And I do have the same behaviour, then I am assuming the problem is not
coming from ICA but more about that mne_read_write function
The file is correctly written but the old event format is not handle
anymore.

Any other ideas?
Best,
Elisabeth

hi,

can you share the 2 files with a test script that reproduces the problem?

Best,
Alex