Diff for "AnalyzingData/MNE_Labels" - Meg Wiki
location: Diff for "AnalyzingData/MNE_Labels"
Differences between revisions 2 and 7 (spanning 5 versions)
Revision 2 as of 2010-06-11 11:54:51
Size: 3324
Editor: YaaraErez
Comment:
Revision 7 as of 2010-06-11 12:11:45
Size: 4089
Editor: YaaraErez
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
ROIs in MNE are defined as "label" files. Freesurfer already creates a parcellation of the cortical surface in various regions of interest (see subdirectory "label" in your subjects' MRI directory). These can be converted to label files for MNE. If you've morphed all your individual STC-files to an average brain (called "average" in the example), you can create MNE-labels from these: ROIs in MNE are defined as "label" files. Freesurfer already creates a parcellation of the cortical surface in various regions of interest (see subdirectory "label" in your subjects' MRI directory). These can be converted to label files for MNE. You can then use mne_make_movie in order to extract amplitudes for these ROIs, e.g. for statistical analysis.

The parameters below are reasonable choices for standard analyses. However, these Wiki pages are not supposed to substitute the [http://www.nmr.mgh.harvard.edu/meg/manuals/MNE-manual-2.6.pdf MNE manual], [http://imaging.mrc-cbu.cam.ac.uk/meg/MEGpapers reading papers], and [http://imaging.mrc-cbu.cam.ac.uk/imaging/ImagersInterestGroup discussions] with more experienced researchers.

If you've morphed all your individual STC-files to an average brain (called "average" in the example), you can create MNE-labels from these:
Line 12: Line 16:

Then you can extract ROI information using mne_make_movie. The following script does it for multiple subjects, conditions, labels and both hemispheres. The resulting *.amp-files are text files that you can read into Excel, Matlab etc.
Line 54: Line 60:
 'frontalpole'\
Line 57: Line 62:
 'inferiortemporal'\
 'insula'\
 'lateraloccipital'\
 'lateralorbitofrontal'\
 'lingual'\
 'medialorbitofrontal'\
 'middletemporal'\
 'paracentral'\
 'parahippocampal'\
Line 68: Line 64:
 'parstriangularis'\
 'pericalcarine'\
 'postcentral'\
 'posteriorcingulate'\
 'precentral'\
 'precuneus'\
 'rostralanteriorcingulate'\
 'rostralmiddlefrontal'\
 'superiorfrontal'\
 'superiorparietal'\
 'superiortemporal'\
Line 81: Line 66:
 'transversetemporal'\
Line 145: Line 129:

= Create your own labels =

1) Display a cortical surface (and e.g. an STC file) in mne_analyze

2) Define the borders of your ROI by defining points using your right mouse button

3) Hold the "CTRL" key and click into the centre of your points with your right mouse button

4) Save the label.

5) Use mne_make_movie to extract information for this label.

Note that you can use mne_morph_labels to morph labels between subjects, for example to the average brain.

Processing ROIs

ROIs in MNE are defined as "label" files. Freesurfer already creates a parcellation of the cortical surface in various regions of interest (see subdirectory "label" in your subjects' MRI directory). These can be converted to label files for MNE. You can then use mne_make_movie in order to extract amplitudes for these ROIs, e.g. for statistical analysis.

The parameters below are reasonable choices for standard analyses. However, these Wiki pages are not supposed to substitute the [http://www.nmr.mgh.harvard.edu/meg/manuals/MNE-manual-2.6.pdf MNE manual], [http://imaging.mrc-cbu.cam.ac.uk/meg/MEGpapers reading papers], and [http://imaging.mrc-cbu.cam.ac.uk/imaging/ImagersInterestGroup discussions] with more experienced researchers.

If you've morphed all your individual STC-files to an average brain (called "average" in the example), you can create MNE-labels from these:

mne_annot2labels --subject average --parc aparc

This will result in files such as "fusiform-lh.label" in the MRI label subdirectory. These are text files that you can read into a text editor etc.

Then you can extract ROI information using mne_make_movie. The following script does it for multiple subjects, conditions, labels and both hemispheres. The resulting *.amp-files are text files that you can read into Excel, Matlab etc.

#

## Your variables:

datapath='/myMEGdatapath/'    # root directory for your MEG data

MRIpath='/myMRIdirectory/'    # where your MRI subdirectories are

outpath='/myoutputdirectory'  # where the results should go



#condition names as used in file names
conds=('cond1' 'cond2' 'cond3')


# subjects names used for MRI data
subjects=(\
        'Subject1' \
        'Subject1' \
        'Subject1' \
)

# MEG IDs (your directory structure may differ)
subj_pre=(\
        'meg10_0001' \
        'meg10_0002' \
        'meg10_0003' \
        )

# MEG subdirectories (your directory structure may differ)      
subj_dir=(\
         '100001' \
         '100002' \
         '100003' \
        )

# labels to be processed        
labels=(\
        'fusiform'\
        'inferiorparietal'\
        'parsopercularis'\
        'parsorbitalis'\
        'supramarginal'\
        'temporalpole'\
        )
        
hemispheres=(\
        'lh' \
        'rh' \
        )
        

# Processing:

nsubjects=${#subjects[*]}
lastsubj=`expr $nsubjects - 1`

nconds=${#conds[*]}
lastcond=`expr $nconds - 1`

nlabels=${#labels[*]}
lastlabel=`expr $nlabels - 1`

nhemispheres=${#hemispheres[*]}
lasthemisphere=`expr $nhemispheres - 1`



# Processing:

for ss in `seq 0 ${lastsubj}`
do
  echo " "
  echo " Computing movies  for SUBJECT  ${subjects[m]}"
  echo " "
        for cc in `seq 0 ${lastcond}`
        do
          echo " "
          echo " Computing movies for condition  ${conds[c]}"
          echo " "
                        for bb in `seq 0 ${lastlabel}`
                        do
                          echo " "
                          echo " Computing movies  for label  ${labels[b]}"
                          echo " "                      
                                for hh in `seq 0 ${lasthemisphere}`
                                do
                                echo " "
                                echo " Computing movies  for hemisphere  ${hemispheres[h]}"
                                echo " "        
                                                                                        
                                        mne_make_movie \
                                          --subject ${subjects[ss]} \
                                          --stcin ${STCpath}/${subj_pre[m]}_0${subjects[m]}_${conds[c]}_-${hemispheres[h]}.stc \
                                          --label ${MRIpath}/average/label/${labels[b]}-${hemispheres[h]}.label \
                                          --labelverts \
                                          --labeltag -${subjects[m]}_${conds[c]}.amp \
                                          --labeloutdir ${outpath}

                                done # hemispheres
                                
                        done # labels                   
        
        done # conditions

done # subjects

Create your own labels

1) Display a cortical surface (and e.g. an STC file) in mne_analyze

2) Define the borders of your ROI by defining points using your right mouse button

3) Hold the "CTRL" key and click into the centre of your points with your right mouse button

4) Save the label.

5) Use mne_make_movie to extract information for this label.

Note that you can use mne_morph_labels to morph labels between subjects, for example to the average brain.

CbuMeg: AnalyzingData/MNE_Labels (last edited 2013-03-08 10:02:16 by localhost)