Diff for "AnalyzingData/MNE_ForwardSolution" - Meg Wiki
location: Diff for "AnalyzingData/MNE_ForwardSolution"
Differences between revisions 2 and 4 (spanning 2 versions)
Revision 2 as of 2010-06-09 15:22:51
Size: 2468
Editor: YaaraErez
Comment:
Revision 4 as of 2010-06-09 15:26:11
Size: 2470
Editor: YaaraErez
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
The following scripts creates the forward model, from which the inverse operator will be computed. It is essential that you have created the [http://imaging.mrc-cbu.cam.ac.uk/meg/AnalyzingData/MNE_MRI_processing source space and BEM model], and coregistered your MRIs with the MEG data.
The following script creates the forward model, from which the inverse operator will be computed. It is essential that you have created the [http://imaging.mrc-cbu.cam.ac.uk/meg/AnalyzingData/MNE_MRI_processing source space and BEM model], and realigned your MRI and MEG coordinate systems.

Forward Solution

The following script creates the forward model, from which the inverse operator will be computed. It is essential that you have created the [http://imaging.mrc-cbu.cam.ac.uk/meg/AnalyzingData/MNE_MRI_processing source space and BEM model], and realigned your MRI and MEG coordinate systems.

#

## Your variables:

path='<myMEGdatapath>'    # where your MEG fiff-files are
MRIpath='/myMRIdirectory/'    # where your MRI subdirectories are

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

# MEG IDs
subj_pre=(\
        'meg10_0001' \
        'meg10_0002' \
        'meg10_0003' \
        )

# MEG subdirectories    
subj_dir=(\
         '100001' \
         '100002' \
         '100003' \
        )
        
dirbem='subject'


## Processing:

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


# REPORT number of files to be processed:

for m in `seq 0 ${lastsubj}`
do
  echo " "
  echo " Computing forward & inverse solution for SUBJECT  ${subjects[m]}"
  echo " "
  
  subject=Subject${subjects[m]}


## setup model 3 layers (EEG+MEG)
mne_setup_forward_model --overwrite  --subject ${subject} --surf --ico 4
 
mne_do_forward_solution \
                        --overwrite \
                        --subject ${subject} \
                        --mindist 5 \
                        --spacing 5 \
                        --bem ${MRIpath}/${subject}/bem/${subject}-5120-5120-5120-bem-sol.fif \
                        --src ${MRIpath}/${subject}/bem/${subject}-5-src.fif \
                        --meas ${path}/${subj_pre[m]}/${subj_dir[m]}/MEGfile.fif  \
                        --fwd ${path}/${subj_pre[m]}/${subj_dir[m]}/lex_go_5-3L-EMEG-fwd.fif



## setup model 1 layer (MEG only)
mne_setup_forward_model --overwrite  --subject ${subject} --surf --homog --ico 4

mne_do_forward_solution \
                        --overwrite \
                        --subject ${subject} \
                        --mindist 5 \
                        --spacing 5 \
                        --megonly \
                        --bem ${MRIpath}/${subject}/bem/${subject}-5120-bem-sol.fif \
                        --src ${MRIpath}/${subject}/bem/${subject}-5-src.fif \
                        --meas ${path}/${subj_pre[m]}/${subj_dir[m]}/MEGfile.fif \
                        --fwd ${path}/${subj_pre[m]}/${subj_dir[m]}/lex_go_5-1L-MEG-fwd.fif



done # subject loop

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