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

junpeng.zhang junpeng.zhang at gmail.com
Wed Mar 19 06:43:24 EDT 2014
Search archives:

Hi Alex, 
   Thank you very much! 
   I got the direction to solve the problem! I will try it! 
Best wishes and thank you for your great contribution to the community! 

Jupeng Zhang, Ph.D
Associate Professor
Sichuan Applied Psychology Research Center
Chengdu Medical College 
Chengdu, China
email: junpeng.zhang at gmail.com

2014-03-19



junpeng.zhang



发件人:Alexandre Gramfort <alexandre.gramfort at telecom-paristech.fr>
发送时间:2014-03-19 04:01
主题: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, 

> 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. 

> 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/e6dd7b8a/attachment.html 


More information about the Mne_analysis mailing list