Note that this reference documentation is identical to the help that is displayed in Matlab when you type “help ft_prepare_leadfield”.
FT_PREPARE_LEADFIELD computes the forward model for many dipole locations on a regular 2D or 3D grid and stores it for efficient inverse modelling Use as [grid] = ft_prepare_leadfield(cfg, data); It is neccessary to input the data on which you want to perform the inverse computations, since that data generally contain the gradiometer information and information about the channels that should be included in the forward model computation. The data structure can be either obtained from FT_PREPROCESSING, FT_FREQANALYSIS or FT_TIMELOCKANALYSIS. If the data is empty, all channels will be included in the forward model. The configuration should contain cfg.channel = Nx1 cell-array with selection of channels (default = 'all'), see FT_CHANNELSELECTION for details The positions of the sources 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 Alternatively the position of a few sources at locations of interest can be specified, for example obtained from an anatomical or functional MRI cfg.grid.pos = Nx3 matrix with position of each source cfg.grid.dim = [Nx Ny Nz] vector with dimensions in case of 3-D grid (optional) cfg.grid.inside = vector with indices of the sources inside the brain (optional) cfg.grid.outside = vector with indices of the sources outside the brain (optional) You should specify the volume conductor model, see FT_FETCH_VOL, and the sensor information, see FT_FETCH_SENS. Optionally, 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 = 'yes' or 'no' (default = 'no') cfg.normalizeparam = depth normalization parameter (default = 0.5) To facilitate data-handling and distributed computing with the peer-to-peer module, this function has the following option: cfg.inputfile = ... If you specify this option the input data will be read from a *.mat file on disk. This mat files should contain only a single variable named 'data', corresponding to the input structure. See also FT_SOURCEANALYSIS
Share this page: