AnalyzingData/MNE_FixingFIFF - Meg Wiki

Upload page content

You can upload content for the page named below. If you change the page name, you can also upload content for another page. If the page name is empty, we derive the page name from the file name.

File to load page content from
Page name
Comment
Type the missing letters from: He's no ded, he's jus resing hs eys

location: AnalyzingData / MNE_FixingFIFF

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