Differences

This shows you the differences between two versions of the page.

Link to this comparison view

reference:ft_sourceanalysis [2018/08/23 14:43] (current)
Line 1: Line 1:
 +=====  FT_SOURCEANALYSIS =====
 +
 +Note that this reference documentation is identical to the help that is displayed in MATLAB when you type "help ft_sourceanalysis"​.
 +
 +<​html><​pre>​
 +  <a href=/​reference/​ft_sourceanalysis><​font color=green>​FT_SOURCEANALYSIS</​font></​a>​ performs beamformer dipole analysis on EEG or MEG data
 +  after preprocessing and a timelocked or frequency analysis
 + 
 +  Use as
 +    [source] = ft_sourceanalysis(cfg,​ freq)
 +  or
 +    [source] = ft_sourceanalysis(cfg,​ timelock)
 + 
 +  where the second input argument with the data should be organised in a structure
 +  as obtained from the <a href=/​reference/​ft_freqanalysis><​font color=green>​FT_FREQANALYSIS</​font></​a>​ or <a href=/​reference/​ft_timelockanalysis><​font color=green>​FT_TIMELOCKANALYSIS</​font></​a>​ function. The
 +  configuration "​cfg"​ is a structure containing information about source positions
 +  and other options.
 + 
 +  The different source reconstruction algorithms that are implemented are
 +    cfg.method ​    = '​lcmv' ​   linear constrained minimum variance beamformer
 +                     '​sam' ​    ​synthetic aperture magnetometry
 +                     '​dics' ​   dynamic imaging of coherent sources
 +                     '​pcc' ​    ​partial cannonical correlation/​coherence
 +                     '​mne' ​    ​minimum norm estimation
 +                     '​rv' ​     scan residual variance with single dipole
 +                     '​music' ​  ​multiple signal classification
 +                     '​sloreta'​ standardized low-resolution electromagnetic tomography
 +                     '​eloreta'​ exact low-resolution electromagnetic tomography
 +  The DICS and PCC methods are for frequency or time-frequency domain data, all other
 +  methods are for time domain data. ELORETA can be used both for time, frequency and
 +  time-frequency domain data.
 + 
 +  The source model to use in the reconstruction should be specified as
 +    cfg.grid ​           = structure, see <a href=/​reference/​ft_prepare_sourcemodel><​font color=green>​FT_PREPARE_SOURCEMODEL</​font></​a>​ or <a href=/​reference/​ft_prepare_leadfield><​font color=green>​FT_PREPARE_LEADFIELD</​font></​a>​
 +  The positions of the dipoles can be specified as a regular 3-D
 +  grid that is aligned with the axes of the head coordinate system
 +    cfg.grid.xgrid ​     = vector (e.g. -20:1:20) or '​auto'​ (default = '​auto'​)
 +    cfg.grid.ygrid ​     = vector (e.g. -20:1:20) or '​auto'​ (default = '​auto'​)
 +    cfg.grid.zgrid ​     = vector (e.g.   ​0:​1:​20) or '​auto'​ (default = '​auto'​)
 +    cfg.grid.resolution = number (e.g. 1 cm) for automatic grid generation
 +    cfg.grid.inside ​    = N*1 vector with boolean value whether grid point is inside brain (optional)
 +    cfg.grid.dim ​       = [Nx Ny Nz] vector with dimensions in case of 3-D grid (optional)
 +  If the source model destribes a triangulated cortical sheet, it is described as
 +    cfg.grid.pos ​       = N*3 matrix with the vertex positions of the cortical sheet
 +    cfg.grid.tri ​       = M*3 matrix that describes the triangles connecting the vertices
 +  Alternatively the position of a few dipoles at locations of interest can be
 +  specified, for example obtained from an anatomical or functional MRI
 +    cfg.grid.pos ​       = N*3 matrix with position of each source
 + 
 +  Besides the source positions, you may also include previously computed
 +  spatial filters and/or leadfields like this
 +    cfg.grid.filter
 +    cfg.grid.leadfield
 + 
 +  The following strategies are supported to obtain statistics for the source parameters using
 +  multiple trials in the data, either directly or through a resampling-based approach
 +    cfg.rawtrial ​     = '​no'​ or '​yes' ​  ​construct filter from single trials, apply to single trials. Note that you also may want to set cfg.keeptrials='​yes'​ to keep all trial information,​ especially if using in combination with grid.filter
 +    cfg.jackknife ​    = '​no'​ or '​yes' ​  ​jackknife resampling of trials
 +    cfg.pseudovalue ​  = '​no'​ or '​yes' ​  ​pseudovalue resampling of trials
 +    cfg.bootstrap ​    = '​no'​ or '​yes' ​  ​bootstrap resampling of trials
 +    cfg.numbootstrap ​ = number of bootstrap replications (e.g. number of original trials)
 +  If none of these options is specified, the average over the trials will
 +  be computed prior to computing the source reconstruction.
 + 
 +  To obtain statistics over the source parameters between two conditions, you
 +  can also use a resampling procedure that reshuffles the trials over both
 +  conditions. In that case, you should call the function with two datasets
 +  containing single trial data like
 +    [source] = ft_sourceanalysis(cfg,​ freqA, freqB)
 +    [source] = ft_sourceanalysis(cfg,​ timelockA, timelockB)
 +  and you should specify
 +    cfg.randomization ​     = '​no'​ or '​yes'​
 +    cfg.permutation ​       = '​no'​ or '​yes'​
 +    cfg.numrandomization ​  = number, e.g. 500
 +    cfg.numpermutation ​    = number, e.g. 500 or '​all'​
 + 
 +  If you have not specified a grid with pre-computed leadfields,
 +  the leadfield for each grid location will be computed on the fly.
 +  In that case you can modify the leadfields by reducing the rank
 +  (i.e.  remove the weakest orientation),​ or by normalizing each
 +  column.
 +    cfg.reducerank ​ = '​no',​ or number (default = 3 for EEG, 2 for MEG)
 +    cfg.normalize ​  = '​no'​ or '​yes'​ (default = '​no'​)
 + 
 +  Other configuration options are
 +    cfg.channel ​      = Nx1 cell-array with selection of channels (default = '​all'​),​
 +                        see <a href=/​reference/​ft_channelselection><​font color=green>​FT_CHANNELSELECTION</​font></​a>​ for details
 +    cfg.frequency ​    = single number (in Hz)
 +    cfg.latency ​      = single number in seconds, for time-frequency analysis
 +    cfg.lambda ​       = number or empty for automatic default
 +    cfg.refchan ​      = reference channel label (for coherence)
 +    cfg.refdip ​       = reference dipole location (for coherence)
 +    cfg.supchan ​      = suppressed channel label(s)
 +    cfg.supdip ​       = suppressed dipole location(s)
 +    cfg.keeptrials ​   = '​no'​ or '​yes'​
 +    cfg.keepleadfield = '​no'​ or '​yes'​
 +    cfg.projectnoise ​ = '​no'​ or '​yes'​
 +    cfg.keepfilter ​   = '​no'​ or '​yes'​
 +    cfg.keepcsd ​      = '​no'​ or '​yes'​
 +    cfg.keepmom ​      = '​no'​ or '​yes'​
 +    cfg.feedback ​     = '​no',​ '​text',​ '​textbar',​ '​gui'​ (default = '​text'​)
 + 
 +  The volume conduction model of the head should be specified as
 +    cfg.headmodel ​    = structure with volume conduction model, see <a href=/​reference/​ft_prepare_headmodel><​font color=green>​FT_PREPARE_HEADMODEL</​font></​a>​
 + 
 +  The EEG or MEG sensor positions can be present in the data or can be specified as
 +    cfg.elec ​         = structure with electrode positions, see <a href=/​reference/​ft_datatype_sens><​font color=green>​FT_DATATYPE_SENS</​font></​a>​
 +    cfg.grad ​         = structure with gradiometer definition, see <a href=/​reference/​ft_datatype_sens><​font color=green>​FT_DATATYPE_SENS</​font></​a>​
 +    cfg.elecfile ​     = name of file containing the electrode positions, see <a href=/​reference/​ft_read_sens><​font color=green>​FT_READ_SENS</​font></​a>​
 +    cfg.gradfile ​     = name of file containing the gradiometer definition, see <a href=/​reference/​ft_read_sens><​font color=green>​FT_READ_SENS</​font></​a>​
 + 
 +  To facilitate data-handling and distributed computing you can use
 +    cfg.inputfile ​  ​= ​ ...
 +    cfg.outputfile ​ =  ...
 +  If you specify one of these (or both) the input data will be read from a *.mat
 +  file on disk and/or the output data will be written to a *.mat file. These mat
 +  files should contain only a single variable, corresponding with the
 +  input/​output structure.
 + 
 +  See also <a href=/​reference/​ft_sourcedescriptives><​font color=green>​FT_SOURCEDESCRIPTIVES</​font></​a>,​ <a href=/​reference/​ft_sourcestatistics><​font color=green>​FT_SOURCESTATISTICS</​font></​a>,​ <a href=/​reference/​ft_prepare_leadfield><​font color=green>​FT_PREPARE_LEADFIELD</​font></​a>,​
 +  <a href=/​reference/​ft_prepare_headmodel><​font color=green>​FT_PREPARE_HEADMODEL</​font></​a>,​ <a href=/​reference/​ft_prepare_sourcemodel><​font color=green>​FT_PREPARE_SOURCEMODEL</​font></​a>​
 +</​pre></​html>​