Diff for "SpmAnalysis" - Meg Wiki
location: Diff for "SpmAnalysis"
Differences between revisions 51 and 52
Revision 51 as of 2009-01-27 11:38:56
Size: 3446
Editor: RikHenson
Comment:
Revision 52 as of 2009-01-27 12:04:29
Size: 3562
Editor: RikHenson
Comment:
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
At the moment, we are using SPM5 (with any latest updates automatically pulled from the FIL, http://www.fil.ion.ucl.ac.uk/spm/). SPM also offers some unique features, not available in other packages:
Line 7: Line 7:
---- == The code ==

SPM has been developed at the FIL (in London), with input from people round the world. Here is its home: http://www.fil.ion.ucl.ac.uk/spm/

At the moment, we are using "SPM5" (with any latest updates automatically pulled from the FIL). At the CBU, SPM5 is installed here:

/imaging/local/spm/spm5

We have edited/refined some of these functions. These modifications are stored here:

/imaging/local/spm/spm5/cbu_updates

If you start SPM5 from Linux using Rhodri's wrappers, both these directories will be added to your Matlab path, with the cbu_updates directory higher in the path (so you will be using local CBU versions of any functions duplicated across these directories).

The functions in cbu_updates may be periodically updated, which will be preceded by an email to CBU imagers. More recent changes are under subversion control (SVN): If you are an external collaborator (outside the CBU network), or want access to the most recent changes (at your own risk), consult SpmCodeSVN.
 
In the future, we will move to "SPM8". One exciting reason for this is that SPM8 will share the same data format with FieldTrip and EEGLAB (which are also Matlab packages for analysing EEG+MEG data). This will allow us to take the best features of each (e.g, source localisation and dynamic causal modelling in SPM8; time-frequency analysis and beam-formers in FieldTrip; Independent Component Analysis in EEGLAB). This is another advantage of Matlab-based academic-community-based freeware.

Basic preprocessing and source localisation in SPM8 will not differ much from SPM5. Tne main improvements concern Dynamic Causal Modelling (DCM) for EEG/MEG (together with better graphics and GUI). The reason that we are sticking with SPM5 for the moment is that the data format and forward modelling for Neuromag data is not quite finalised in FieldTrip/SPM8.

== Demos ==
Line 11: Line 31:
----
Here are some relevant papers:

== Some relevant papers ==
Line 19: Line 39:
----
Additional SPM5 functions:

 * If you are not using the version of SPM5 installed on the CBU network (ie do not have */spm5/cbu_updates on your Matlab path) - eg are an external collaborator - you will need to download the latest versions of some site-specific SPM5 functions in order to read the FIF format data files from our MEG scanner. These SPM functions can be downloaded from here: http://imaging.mrc-cbu.cam.ac.uk/svn/spm5_cbu_updates/devel (see also http://www.mrc-cbu.cam.ac.uk/~rh01/fif2spm.html).

 * Miscellaneous helpful SPM/Matlab functions we've written can be found here: http://imaging.mrc-cbu.cam.ac.uk/svn/meg_misc/devel/ For permission to contribute to or edit this repository, contact Ian Nimmo-Smith.

 * A meta-toolbox of functions that allow you to apply EEGLAB functions (eg. ICA, plot raw data, plot ERFimage) to SPM-format MEG data can be found here: http://imaging.mrc-cbu.cam.ac.uk/svn/spmeeglab/devel/ For further information, contact Jason Taylor. Help on artefact correction using ICA is forthcoming...

 * This page describes the procedure for creating a 3D SensorSpm (topography x time).

----
General note:

 * SPM5 can read raw and averaged FIF files, though you will probably first want to run your raw data through the [:Maxfilter:Maxfilter utility], particularly if you 1) used Active Shielding during acquisition, 2) if you want to apply (temporal) SSS to remove noise, 3) if you used continuous HPI and/or 4) if you want to transform all subjects to a common (device) space. Max Filter can also downsample (eg from 1000Hz to 200Hz) and convert the data into different datatypes (e.g, short), which will help reduce filesize and processing time.

Analysis of MEG Data in SPM5

Many of us here use SPM for EEG and/or MEG analysis. The main reason is that SPM is freeware (requiring only Matlab), and thus modifiable and relatively easily to understand (if you have basic knowledge of a procedural computer language, given that Matlab is a fairly high-level language). Several of us are actively extending SPM for our own purposes, particularly in relation to the Neuromag type of MEG data.

SPM also offers some unique features, not available in other packages:

The code

SPM has been developed at the FIL (in London), with input from people round the world. Here is its home: http://www.fil.ion.ucl.ac.uk/spm/

At the moment, we are using "SPM5" (with any latest updates automatically pulled from the FIL). At the CBU, SPM5 is installed here:

/imaging/local/spm/spm5

We have edited/refined some of these functions. These modifications are stored here:

/imaging/local/spm/spm5/cbu_updates

If you start SPM5 from Linux using Rhodri's wrappers, both these directories will be added to your Matlab path, with the cbu_updates directory higher in the path (so you will be using local CBU versions of any functions duplicated across these directories).

The functions in cbu_updates may be periodically updated, which will be preceded by an email to CBU imagers. More recent changes are under subversion control (SVN): If you are an external collaborator (outside the CBU network), or want access to the most recent changes (at your own risk), consult SpmCodeSVN.

In the future, we will move to "SPM8". One exciting reason for this is that SPM8 will share the same data format with FieldTrip and EEGLAB (which are also Matlab packages for analysing EEG+MEG data). This will allow us to take the best features of each (e.g, source localisation and dynamic causal modelling in SPM8; time-frequency analysis and beam-formers in FieldTrip; Independent Component Analysis in EEGLAB). This is another advantage of Matlab-based academic-community-based freeware.

Basic preprocessing and source localisation in SPM8 will not differ much from SPM5. Tne main improvements concern Dynamic Causal Modelling (DCM) for EEG/MEG (together with better graphics and GUI). The reason that we are sticking with SPM5 for the moment is that the data format and forward modelling for Neuromag data is not quite finalised in FieldTrip/SPM8.

Demos

  • For specific demo using data from our Neuromag MEG machine, see SpmDemo

  • For a fuller demo of other EEG/MEG analysis in SPM5 (though from a different MEG machine), including more general features (e.g, time-freq analysis, 3D statistical maps), with proper step-by-step instructions via the GUI, see: http://www.fil.ion.ucl.ac.uk/spm/data/mmfaces.html

  • For a more theoretical introduction to source localisation in SPM5, see these slides: attachment:henson-SPM-Grad08-4-meeg.ppt

Some relevant papers

  • Summary of localisation approach using ReML for evoked and induced responses (mathematical; cites earlier development papers too): attachment:FristonEtAl_hbm_06.pdf

  • Basic considerations for Group Analyses (though using individual meshes): attachment:HensonEtAl_NI_07.pdf

  • Use of inverse-normalised ("canonical") cortical meshes: attachment:MattoutEtAl_JCIN_07.pdf

  • Choice of forward models for MEG (e.g, single-sphere vs BEM), including further validation of canonical meshes: attachment:HensonEtAl_NI_inpress.pdf

  • New method of Multiple Sparse Priors (MSP): attachment:FristonEtAl_NI_08_MSP.pdf

CbuMeg: SpmAnalysis (last edited 2013-03-08 10:02:27 by localhost)