|
Size: 4715
Comment:
|
Size: 5894
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 6: | Line 6: |
| The main ingredients are | The main ingredients are |
| Line 14: | Line 14: |
| There are some [#exampleestimates examples of current estimates] at the bottom. |
|
| Line 15: | Line 17: |
| Line 20: | Line 21: |
| Line 22: | Line 22: |
| Line 24: | Line 23: |
| Line 26: | Line 24: |
| Line 28: | Line 25: |
| Line 31: | Line 27: |
| Line 39: | Line 33: |
| Line 46: | Line 39: |
# MEG subdirectories (your directory structure may differ) |
# MEG subdirectories (your directory structure may differ) |
| Line 53: | Line 45: |
| Line 55: | Line 46: |
| Line 58: | Line 48: |
| Line 61: | Line 50: |
| Line 68: | Line 55: |
| for c in `seq 0 ${lastcond}` do # Current Estimates mne_make_movie \ --subject {subjects[m]} \ --inv ${datapath}/${subj_pre[m]}/${subj_dir[m]}/YourName_1L-MEG-loose0.2-inv.fif \ --meas ${datapath}/${subj_pre[m]}/${subj_dir[m]}/${conds[c]}.fif \ --morph average \ |
for c in `seq 0 ${lastcond}` do # Current Estimates mne_make_movie \ --subject ${subjects[m]} \ --inv ${datapath}/${subj_pre[m]}/${subj_dir[m]}/YourName_1L-MEG-loose0.2-inv.fif \ --meas ${datapath}/${subj_pre[m]}/${subj_dir[m]}/${conds[c]}.fif \ --morph average \ |
| Line 79: | Line 66: |
| --bmin -100 \ | --bmin -100 \ |
| Line 81: | Line 68: |
| --stc ${outpath}/${subj_pre[m]}_${conds[c]} done # conditions |
--stc ${outpath}/${subj_pre[m]}_${conds[c]} |
| Line 85: | Line 70: |
| done # conditions | |
| Line 87: | Line 73: |
| Line 90: | Line 75: |
| Some degree of smoothing (--smooth) is necessary for display. | Some degree of smoothing (--smooth) is necessary for display. |
| Line 92: | Line 77: |
| The baseline definition (--bmin/bmax) can be omitted if input data are already appropriately baseline-corrected. Note that this option will not baseline-correct the source estimates. | The baseline definition (--bmin/bmax) can be omitted if input data are already appropriately baseline-corrected. Note that this option will not baseline-correct the source estimates. |
| Line 94: | Line 79: |
| A few CBSU users have experienced an issue with mne_make_movie. It sometimes misses some output that it is supposed to produce. It is important for you to check whether the number of output stc files matches what you expect. Re-running the script again usually solves the problem. | |
| Line 96: | Line 82: |
| Line 97: | Line 84: |
| Line 101: | Line 87: |
| Line 104: | Line 89: |
| Line 107: | Line 91: |
| Use "--force" to overwrite an existing average brain, "--out" to use an output name other than the default "average". | |
| Line 109: | Line 94: |
| Line 110: | Line 96: |
| For grand-averaging, STC-files should have been created using the --morph option in mne_make_movie (see above). You can then average them using the command | For grand-averaging, STC-files should have been created using the --morph option in mne_make_movie (see above). You can then average them using the command |
| Line 114: | Line 101: |
| Line 121: | Line 107: |
| Line 124: | Line 109: |
| Line 130: | Line 114: |
| Line 135: | Line 118: |
| [[Anchor(stcreadwritesubtract)]] | |
| Line 136: | Line 120: |
| [[Anchor(stcreadwritesubtract)]] | |
| Line 143: | Line 126: |
| Line 145: | Line 127: |
| Line 147: | Line 128: |
| Line 150: | Line 130: |
[[Anchor(exampleestimates)]] == Examples of Current Estimates == attachment:MNE_Estimates.jpg These figures show MNE current estimates for a visually evoked brain response around 170 ms for a single participant. The left presents the unsigned (intensity), the right the signed version of the estimate. Note that the intensity version ignores the cirection of current flow on the cortical surface. In the signed version, the "speckled" pattern of positive and negative values most likely results from the fact that blurring of sources results in reversed directions of current flow on opposing walls of sulci. |
Compute the Source Estimates (mne_make_movie)
Applying the Inverse Operator
This script applies the inverse operator to MEG data and outputs the current estimates. The current estimates are morphed to the [#averagebrain average brain] (see below), for [#grandaverage grand-averaging] (see further below). The results (*.stc-files) can be viewed in mne_analyze, and [#stcreadwritesubtract read into Matlab] using mne_read_stc_file. You can get infos on your stc-files (e.g. maximum value, relevant for scaling your display) using mne_process_stc.
The main ingredients are
* the inverse operator
* the averaged MEG data (fiff-files)
* the average cortical surface (see below)
There are some [#exampleestimates examples of current estimates] at the bottom.
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.
#
## Your variables
datapath='<myMEGdatapath>' # root directory for your MEG data
MRIpath='/myMRIdirectory/' # where your MRI subdirectories are
outpath='/myoutpath' # path for output files
#condition names as used in file names to which inverse operator shall be applied
conds=('cond1' 'cond2' 'cond3')
# subjects names used for MRI data
subjects=(\
'Subject1' \
'Subject2' \
'Subject3' \
)
# 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' \
)
## Processing:
nsubjects=${#subjects[*]}
lastsubj=`expr $nsubjects - 1`
nconds=${#conds[*]}
lastcond=`expr $nconds - 1`
for m in `seq 0 ${lastsubj}`
do
echo " "
echo " Computing movies for SUBJECT ${subjects[m]}"
echo " "
for c in `seq 0 ${lastcond}`
do
# Current Estimates
mne_make_movie \
--subject ${subjects[m]} \
--inv ${datapath}/${subj_pre[m]}/${subj_dir[m]}/YourName_1L-MEG-loose0.2-inv.fif \
--meas ${datapath}/${subj_pre[m]}/${subj_dir[m]}/${conds[c]}.fif \
--morph average \
--smooth 5 \
--bmin -100 \
--bmax 0 \
--stc ${outpath}/${subj_pre[m]}_${conds[c]}
done # conditions
done # subjectsThe --morph option produces source estimates morphed to the average brain (necessary for grand-averaging). If you don't use it, source estimates will be computed on individual cortical surfaces.
Some degree of smoothing (--smooth) is necessary for display.
The baseline definition (--bmin/bmax) can be omitted if input data are already appropriately baseline-corrected. Note that this option will not baseline-correct the source estimates.
A few CBSU users have experienced an issue with mne_make_movie. It sometimes misses some output that it is supposed to produce. It is important for you to check whether the number of output stc files matches what you expect. Re-running the script again usually solves the problem.
Computing the Average Cortical Surface
# make_average_subject --subjects Subject1 Subject2 Subject3
"Subject1, Subject2..." etc. are the MRI sub-directories created by Freesurfer. The paths to these sub-directories have to be specified in the environment variables, e.g. "setenv SUBJECTS_DIR /MyMriDirectory/".
Use "--force" to overwrite an existing average brain, "--out" to use an output name other than the default "average".
Grand-averaging STC-files
For grand-averaging, STC-files should have been created using the --morph option in mne_make_movie (see above). You can then average them using the command
mne_average_estimates --desc <descriptionfile.txt>
where descriptionfile.txt is of the form
stc /yourpath/filetoaverage1.stc stc /yourpath/filetoaverage2.stc stc /yourpath/filetoaverage3.stc deststc <youroutputfile>
You can create description files for every average you want to compute, and execute them in one script
# mne_average_estimates --desc <descriptionfile1.txt> mne_average_estimates --desc <descriptionfile2.txt> mne_average_estimates --desc <descriptionfile3.txt>
Reading, Writing, Subtracting STC-files
This simple Matlab script demonstrates how to read and manipulate STC-files.
data1 = mne_read_stc_file( STCfile1 ); % read STC-file 1 data2 = mne_read_stc_file( STCfile2 ); % read STC-file 2 data3 = data2; % data3 will contain subtracted data, but keep other information from STC-file 2 data3.data = data2.data - data1.data; % subtract STC-file 1 from STC-file 2 mne_write_stc_file( STCfile_out, data3 ); % Write subtracted data to STC-file
Examples of Current Estimates
attachment:MNE_Estimates.jpg
These figures show MNE current estimates for a visually evoked brain response around 170 ms for a single participant. The left presents the unsigned (intensity), the right the signed version of the estimate. Note that the intensity version ignores the cirection of current flow on the cortical surface. In the signed version, the "speckled" pattern of positive and negative values most likely results from the fact that blurring of sources results in reversed directions of current flow on opposing walls of sulci.
