Diff for "AnalyzingData/MNE_FixingFIFF" - Meg Wiki
location: Diff for "AnalyzingData/MNE_FixingFIFF"
Differences between revisions 2 and 3
Revision 2 as of 2012-08-30 17:02:37
Size: 1568
Editor: YaaraErez
Comment:
Revision 3 as of 2013-03-08 10:02:29
Size: 1568
Editor: localhost
Comment: converted to 1.6 markup
No differences found!

Fixing EEG electrode positions in Fiff-files

According to the MNE manual, "Some versions of the Neuromag acquisition software did not copy the EEG channel location information properly from the Polhemus digitizer information data block to the EEG channel information records if the number of EEG channels exceeds 60." We have this problem at the CBSU. Unless you apply mne_check_eeg_locations to your data, MNE will get confused with the EEG electrode digitisation, and e.g. the creation of the forward solution for EEG will fail. Apply this function to your data as early as possible in your processing stream.


# Your variables

datapath='<myMEGdatapath>'       # root directory for your MEG data

# 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' \
        )

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

# Processing:

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

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


for m in `seq 0 ${lastsubj}`
do
  echo " "
  echo " Fixing electrodes for SUBJECT  ${subjects[m]}"
  echo " "
        for c in `seq 0 ${lastcond}`
        do
        
                mne_check_eeg_locations \
                        --file ${datapath}/${subj_pre[m]}/${subj_dir[m]}/${conds[c]}.fif \
                        --fix                           
                
        done # conditions

done # subjects

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