MEG_Data_Processing - Meg Wiki
CbuMeg: MEG_Data_Processing

==What's The Idea?==

Basically, there are several steps in analyzing the data.

====Step 1: Reviewing and Preparing Raw Data====

=====Mark Bad Channels=====

You want to look at the raw data without any filters and without any of the projections.  Filters can filter out significant noise and make it more difficult to tell that there is noise.  Projections can have the same effect.  Filters tend to cause problems for high frequency noise, and Projections tend to cause problems for low frequency noise.  It is also important to turn off the average EEG Reference.  This can cause channels which are flat (not recording any activity) to appear as though they are recording activity.  It can also cause noise to be translated across many channels (making locating the "problem channel" difficult).

=====Determine the Rejection Criteria=====

Here you can have a debate about what technique is most appropriate for your data.  On the one hand, it is nice to use identical settings on each person's data for generic consistency purposes.  On the other hand, it is nice to tweak your rejection settings slightly for each person's specific data.  For example,  If one person was not as far into the helmet as another, they may require different rejection criteria, because the magnetic field will drop off with respect to the distance.  This is a Philosophical question about data analysis that should be determined and justified by each researcher.  If you are going to tweak the rejection settings for each person, be sure to determine the rejection settings using the same filter and projection settings you will use when calculating your averages.

=====Calculate your Averages=====

Here you are going to calculate your basic averages for each run and an average of all the runs.  It is critical that you timeshift your data.  Timeshifting is when you adjust the timing of your triggers to reflect what actually occurred.  In most (if not all) studies, a stimulus is not presented at the same time that you send a trigger to the MEG machine.  Prior to beginning a study, a measurement is done where you measure the stimulus onset with respect to the trigger time.  If you are doing a visual study you would use a visual stimulus 

VisMot MEG/EEG Processing Workflow

<tt>cd <MEG directory></tt>

<tt>mkdir <participant> <participant>/raw</tt>

<tt>cd <participant>/raw/</tt>

<tt>cp <raw data path(s)> ./</tt>

<tt>cp ../../proc_files/avecov_rr/* ./</tt>

<tt>mne_browse_raw --filtersize <20*sampling rate></tt>

Go through each raw data set.  
Turn off the projections and turn off the filters.  
Mark all bad channels.  
Turn on the projections and the filters, which will be used during processing
Evaluate what the appropriate EOG, MEG, and EEG reject threshold should be in volts.  e.g.(EOG-150microV, EEG-150)
Look at both the EOG channel's and the corresponding effects in the EEG and MEG channels as well as for any artifacts.

Adjust the rejection rates in the .ave and .cov files

Save events (txt)       <run_##_raw.eve>

<tt>matlab.new &</tt>

[[change_trigger_all]]
[[timeshift_all]]

quit

<tt>mne_process_raw --raw run_01_raw.fif --ave run_01.ave --cov run_01.cov --raw run_02_raw.fif --ave run_02.ave --cov run_02.cov --raw run_03_raw.fif --ave run_03.ave --cov run_03.cov --raw run_04_raw.fif --ave run_04.ave --cov run_04.cov --raw run_05_raw.fif --ave run_05.ave --cov run_05.cov --raw run_06_raw.fif --ave run_06.ave --cov run_06.cov --raw run_07_raw.fif --ave run_07.ave --cov run_07.cov --raw run_08_raw.fif --ave run_08.ave --cov run_08.cov --raw run_09_raw.fif --ave run_09.ave --cov run_09.cov --raw run_10_raw.fif --ave run_10.ave --cov run_10.cov --raw run_11_raw.fif --ave run_11.ave --cov run_11.cov --raw run_12_raw.fif --ave run_12.ave --cov run_12.cov --raw run_13_raw.fif --ave run_13.ave --cov run_13.cov --projon --filtersize 16385 --highpass 0.1 --lowpass 50 --gave ../CVM.fif --gcov ../CVM-cov.fif</tt>

<tt>cd ..</tt>

<tt>mne_setup_mri</tt>

<tt>mne_setup_source_space --spacing 5</tt>

<tt>mv <participant>-head.fif real-<participant>-head.fif</tt>

<tt>mkheadsurf</tt>

<tt>mne_surf2bem --surf $SUBJECTS_DIR/<participant>/surf/lh.smseghead --id 4 --fif <participant>-head.fif</tt>

<tt>mne_analyze</tt>

File/Load digitizer data <pick a file>

Load an inflated surface

Windows/Show Viewer

Options
Select the fiducials on the 'Options' window one at a time and then select the closest point you can find

Press 'Align using fiducials'

Check for any wildly incorrect points and discard them using 'Discard'

If everything looks good, use ICP align w/~20 steps.

If this looks good, click 'Save MRI set'

<tt>mne_do_forward_solution --mindist 5 --spacing 5 --meas CVM.fif</tt>

<tt>mne_do_inverse_operator --fwd CVM-5-fwd.fif --depth --loose 0.3 --meg --eeg --senscov CVM-cov.fif</tt>

CbuMeg: MEG_Data_Processing (last edited 2013-03-08 10:02:45 by localhost)