splitting fif files

Dear. all.

This is Ji Won Bang from Dr. Sasaki's group at MGH.

I came up with a problem regarding splitting fif files.

Do you know how I can split them into 2 or 3 as I want?

I would appreciate that!

Best regards,
Ji Won Bang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20110524/7484a50a/attachment.html

Hi,

if you're willing to give it a try you could easily split your raw fif
file in python.

From a Linux machine at MGH do in a terminal:

setenv PATH /usr/pubsw/packages/python/epd/bin:${PATH}

then the following python script should help you do what you want:

-------- beginning of script

from mne import fiff
from mne.datasets import sample
data_path = sample.data_path('.')

fname = data_path + '/MEG/sample/sample_audvis_raw.fif'

raw = fiff.Raw(fname)

# save the first 150s of MEG data in FIF file
raw.save('sample_audvis_meg_raw_part1.fif', tmin=0, tmax=150)
# save the rest in a second FIF file
raw.save('sample_audvis_meg_raw_part2.fif', tmin=150)

--- end of script

if you're lost I can help you tomorrow.

you can get more info at https://martinos.org/mne/mne-python.html
(visible internally only for now)
and if you feel like it the code is public at
GitHub - mne-tools/mne-python: MNE: Magnetoencephalography (MEG) and Electroencephalography (EEG) in Python

Alex

You can also split the file into equal-size pieces using mne_process_raw:

mne_process_raw --split <size/MB> --projoff --raw <raw file> --save <output file>

- Matti

Dear. Dr. Hamalainen

Hello. I've tried what you suggested, but I still have a problem.

I typed:

mne_process_raw --split <40911222> --projoff --raw <svl2_day2_032511.fif>
--save <svl2_day2_split.fif>

Then I got:
Ambiguous input redirect.

Do you have any idea about this?

I appreciate that!

Best,
Ji Won Bang

2011/5/25 Matti Hamalainen <msh at nmr.mgh.harvard.edu>

You can also split the file into equal-size pieces using mne_process_raw:

mne_process_raw --split <size/MB> --projoff --raw <raw file> --save
<output file>

- Matti

> Dear. all.
>
> This is Ji Won Bang from Dr. Sasaki's group at MGH.
>
> I came up with a problem regarding splitting fif files.
>
> Do you know how I can split them into 2 or 3 as I want?
>
> I would appreciate that!
>
> Best regards,
> Ji Won Bang
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis

The information in this e-mail is intended only for the person to whom it
is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in
error
but does not contain patient information, please contact the sender and
properly
dispose of the e-mail.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20110525/85d149cc/attachment.html

I looks like it's the <'s and >'s that you included in your command line which caused the problem. I think he used those to indicate fields that you have to fill in but not that you should actually include those symbols.

Don

Don Krieger, Ph.D., D.ABNM
Department of Neurological Surgery
University of Pittsburgh
(412)648-9654
(412)606-2189 Cell