[Mne_analysis] concatenation raws and events

dgw dgwakeman at gmail.com
Thu Sep 11 12:20:16 EDT 2014
Search archives:

You have many options,

My recommendation is to just epoch each run separately (read don't
create one big raw file) and then average the epochs together.

option 2
figure out how much you need to add to the second events file add it
and then use the big raw file.

option 3
run find_events on your big raw file, then save those events, run your
matlab script on those events then use the new event file to average

HTH,
D

On Thu, Sep 11, 2014 at 11:42 AM, J.A. Entakli <jae40 at cam.ac.uk> wrote:
> Hi,
>
> I would like, for all the MEG processing, to work only on one big raw
> file (that's to say bloc 1 + bloc 2). Concerning the events, I extracted
> the events (events.txt) from mne_browse and I modified manually some
> values in these files (with Matlab).
>
> So actually, I have 2 blocs with 1 events.txt file each corresponding.
> raw_fname1= '...' with event_fname1= '...'
> raw_fname2= '...' with event_fname2= '...'
>
> Cheers,
> John
>
>
> On 11/09/2014 16:19, dgw wrote:
>> Hi John,
>>
>> Can you explain in more detail what you are trying to do? The original
>> events are in the raw fif files. Do you want to change them or are you
>> worried you changed them, or have you already changed them?
>>
>> (if you already have changed them, where did you change them: in the
>> raw file? how did you change them? etc.)
>>
>> HTH,
>> D
>>
>> On Thu, Sep 11, 2014 at 11:14 AM, J.A. Entakli <jae40 at cam.ac.uk> wrote:
>>> Hi D,
>>> I understand but the problem is that I modified manually some number
>>> in
>>> the events file and now I not able to extract directly them. Tell me
>>> if
>>> I make a mistake. I am a really beginner.
>>>
>>> Thanks,
>>> John
>>>
>>> On 11/09/2014 16:07, dgw wrote:
>>>> You should be able to read the events straight from the raw object.
>>>> (mne.find_events). This is the safest way to deal with events.
>>>>
>>>> HTH
>>>> D
>>>>
>>>> On Thu, Sep 11, 2014 at 11:06 AM, J.A. Entakli <jae40 at cam.ac.uk>
>>>> wrote:
>>>>> Thank you Steve,
>>>>>
>>>>> I suppose something like that:
>>>>> raws = mne.io.Raw(['raw1_fname','raw2_fname'])
>>>>>
>>>>> and what about the events??
>>>>>
>>>>> Bests,
>>>>> Jonathan
>>>>>
>>>>> On 11/09/2014 15:58, Stephen Politzer-Ahles wrote:
>>>>>> Hi Jonathan,
>>>>>>
>>>>>> When you read your raw file, you can pass the function a list of
>>>>>> filenames (instead of one filename) to automatically read all those
>>>>>> files into a single Raw object. Then you shouldn't need to worry
>>>>>> about
>>>>>> concatenating later.
>>>>>>
>>>>>> Best,
>>>>>> Steve
>>>>>>
>>>>>> Stephen Politzer-Ahles
>>>>>> New York University, Abu Dhabi
>>>>>> Neuroscience of Language Lab
>>>>>> http://www.nyu.edu/projects/politzer-ahles/ [5]
>>>>>>
>>>>>> On Thu, Sep 11, 2014 at 6:44 PM, J.A. Entakli <jae40 at cam.ac.uk>
>>>>>> wrote:
>>>>>>
>>>>>>> Hello Everybody,
>>>>>>> During my experiment I recorded 2 blocs per subject. I am just
>>>>>>> started
>>>>>>> with mne_python.
>>>>>>>
>>>>>>> I have two questions in one ::
>>>>>>> 1) I would like to know how can I concatenate the blocs and above
>>>>>>> all
>>>>>>> the events (corresponding to each bloc) to have just one bloc.
>>>>>>> In brief, for each subject I have one bloc with its events and
>>>>>>> another
>>>>>>> bloc with its events also.
>>>>>>>
>>>>>>> raw_fname1= '...'
>>>>>>> raw_fname2= '...'
>>>>>>> event_fname1= '...'
>>>>>>> event_fname2= '...'
>>>>>>>
>>>>>>> raw1 = io.Raw(raw_fname1)
>>>>>>> raw2 = io.Raw(raw_fname2)
>>>>>>>
>>>>>>> events1 = mne.read_events(event_fname1)
>>>>>>> events2 = mne.read_events(event_fname2)
>>>>>>> events_list = [events1,events2]
>>>>>>>
>>>>>>> raw_conc= concatenate_raws([raw1,raw2], events_list=events_list)
>>>>>>>
>>>>>>> Until here I think these several code lines work correctly...
>>>>>>>
>>>>>>> 2) But when I try to extract the epochs from raw_conc I have some
>>>>>>> error
>>>>>>> messages (concerning I think the events_list)
>>>>>>>
>>>>>>> picks =
>>>>>>> mne.pick_types(raw1.info
>>>>>>> [1],meg='mag',eeg=False,ecg=False,eog=False,stim=False,
>>>>>>> exclude='bads')
>>>>>>> epochs = mne.Epochs(raw, events_list, event_id, tmin, tmax,
>>>>>>> picks=picks,
>>>>>>> baseline= baseline, reject=reject)
>>>>>>>
>>>>>>> The aim of both questions is to use the tfr_morlet function which
>>>>>>> asks
>>>>>>> in input the epochs.
>>>>>>>
>>>>>>> power, itc = tfr_morlet(epochs, freqs=freqs, n_cycles=n_cycles,
>>>>>>> use_fft=False, return_itc=True, decim=3,n_jobs=1)
>>>>>>>
>>>>>>> Someone has an idea about this?
>>>>>>>
>>>>>>> Bests,
>>>>>>>
>>>>>>> Jonathan
>>>>>>> --
>>>>>>> Dr Jonathan Entakli - Research Associate Post doctoral position
>>>>>>>
>>>>>>> Department of Psychology
>>>>>>> University of Cambridge, Downing St
>>>>>>> Cambridge CB2 3EB
>>>>>>>
>>>>>>> Sir William Hardy Building
>>>>>>> Office : 314
>>>>>>> Mobile : 07778 692 458
>>>>>>>
>>>>>>> http://www.viscog.psychol.cam.ac.uk/ [2]
>>>>>>> _______________________________________________
>>>>>>> Mne_analysis mailing list
>>>>>>> Mne_analysis at nmr.mgh.harvard.edu
>>>>>>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis [3]
>>>>>>>
>>>>>>> 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 [4] . 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.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Links:
>>>>>> ------
>>>>>> [1] http://raw1.info
>>>>>> [2] http://www.viscog.psychol.cam.ac.uk/
>>>>>> [3] https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>>>>>> [4] http://www.partners.org/complianceline
>>>>>> [5] 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
>>>>>>
>>>>>>
>>>>>> 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.
>>>>>
>>>>> --
>>>>> Dr Jonathan Entakli - Research Associate
>>>>>
>>>>> Department of Psychology
>>>>> University of Cambridge, Downing St
>>>>> Cambridge CB2 3EB
>>>>>
>>>>> Sir William Hardy Building
>>>>> Office : 314
>>>>> Mobile : 07778 692 458
>>>>>
>>>>> http://www.viscog.psychol.cam.ac.uk/
>>>>> _______________________________________________
>>>>> Mne_analysis mailing list
>>>>> Mne_analysis at nmr.mgh.harvard.edu
>>>>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>>>> _______________________________________________
>>>> Mne_analysis mailing list
>>>> Mne_analysis at nmr.mgh.harvard.edu
>>>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>>>
>>> --
>>> Dr Jonathan Entakli - Research Associate
>>>
>>> Department of Psychology
>>> University of Cambridge, Downing St
>>> Cambridge CB2 3EB
>>>
>>> Sir William Hardy Building
>>> Office : 314
>>> Mobile : 07778 692 458
>>>
>>> http://www.viscog.psychol.cam.ac.uk/
>>> _______________________________________________
>>> Mne_analysis mailing list
>>> Mne_analysis at nmr.mgh.harvard.edu
>>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>> _______________________________________________
>> Mne_analysis mailing list
>> Mne_analysis at nmr.mgh.harvard.edu
>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>
> --
> Dr Jonathan Entakli - Research Associate
>
> Department of Psychology
> University of Cambridge, Downing St
> Cambridge CB2 3EB
>
> Sir William Hardy Building
> Office : 314
> Mobile : 07778 692 458
>
> http://www.viscog.psychol.cam.ac.uk/
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis



More information about the Mne_analysis mailing list