[Mne_analysis] how to extract the label time series using MNE-toolbox

junpeng.zhang junpeng.zhang at gmail.com
Wed Mar 19 09:24:04 EDT 2014
Search archives:

Hi Alex, 
Thank you very much! 
The following link tells us how to define events. Thanks 
http://martinos.org/mne/stable/manual/browse.html#babdfaha

Best wishes, 
Junpeng
2014-03-19



junpeng.zhang



发件人:Alexandre Gramfort <alexandre.gramfort at telecom-paristech.fr>
发送时间:2014-03-19 20:07
主题:Re: Re: [Mne_analysis] how to extract the label time series using MNE-toolbox
收件人:"junpeng.zhang"<junpeng.zhang at gmail.com>
抄送:"mne_analysis at nmr.mgh.harvard.edu"<mne_analysis at nmr.mgh.harvard.edu>

hi Junpeng, 

you need to define events visually/manually in mne_browse_raw 

HTH 
A 

On Wed, Mar 19, 2014 at 12:47 PM, junpeng.zhang <junpeng.zhang at gmail.com> wrote: 
> Hi Alex, 
> 
> Thank you for kind response. 
> I still have a question. Please see the highlighted fonts. 
> 
> 
>> Recently I am conducting an epilepy MEG analysis project. 
>> I used MNE toolbox to create a cortex constrained source space (5891 
>> sources) and calculated the lead fead matrix (free orientaion, 5891 
>> (sources) x 3 (directions xyz) x 306 (channels) matrix ). 
>> By on house code, I applied  the inverse problem (beamformer) operator to 
>> a 
>> segment of epileptiform MEG and then got a 5891 (sources) x 3 (directions) 
>> x 
>> 500 (time points) matrix (SDTM), which is source time series. 
> 
> so you have 3 time series per location. Which is not make stc contain. 
> 
>> My questions are as, 
>> 1) how to get the information on which source belong to which regions by 
>> label operations (for example source A  is included in temporal cortex). 
>> If 
>> I got such information, I can get a collective time series for a region by 
>> averaging (or other ways to get a representative time series) all the 
>> source 
>> time series in this region. anyone have a quick code  to share it to me? 
> 
> if you use instances of SourceEstimates (stc objects) you can use labels. 
> I assume you use a surface source space. You can look at the code 
> of the in_label method. 
> 
> http://martinos.org/mne/stable/generated/mne.SourceEstimate.html#mne.SourceEstimate.in_label 
> 
>> 2) epileptiform MEG is difficult to average. and for such MEG, we have 
>> only 
>> one "trial".  MNE python is quite suitable to process multiple trials MEG 
>> data. How to use the several functions to process single "trials" 
>> epileptiform MEG? 
>> for example, 
>> if I know SDTM in matlab format, how to use it as the input of the 
>> function 
>> mne.extract_label_time_course? 
>> The stcs para equals to the SDTM? 
> 
> you can get an Evoked instance by average a single Epoch. 
> I ever tried to create a instance but in the epilepy raw data,  there is no 
> any events  writed in the file. 
> When I import  a .eve file, the error will be no event to average... 
> How to transform a  raw.fif into a  ave.fif when the raw file has no events 
> indicated? 
> My epilepsy raw file info: 11s ----702s. 
> 
> Best wishes, 
> Junpeng Zhang 
> 
> 
>> The following is the three examples for the functions extracted from 
>> 
>> http://martinos.org/mne/stable/auto_examples/connectivity/plot_mne_inverse_label_connectivity.html#example-connectivity-plot-mne-inverse-label-connectivity-py 
>> 
>> stcs = apply_inverse_epochs(epochs, inverse_operator, lambda2, method, 
>>                             pick_ori="normal", return_generator=True) 
>> 
>> # Get labels for FreeSurfer 'aparc' cortical parcellation with 34 
>> labels/hemi 
>> labels, label_colors = mne.labels_from_parc('sample', parc='aparc', 
>>                                             subjects_dir=subjects_dir) 
>> 
>> # Average the source estimates within each label using sign-flips to 
>> reduce 
>> # signal cancellations, also here we return a generator 
>> src = inverse_operator['src'] 
>> label_ts = mne.extract_label_time_course(stcs, labels, src, 
>> mode='mean_flip', 
>>                                          return_generator=True) 
> 
> it does not make sense to you mean_flip unless you have fixed orient 
> source space 
> or used pick_ori='normal'. You can just average you have positive 
> values in the stc. 
> 
> Hope this helps, 
> 
> Alex 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20140319/47734c25/attachment.html 


More information about the Mne_analysis mailing list