[FieldTrip] understanding ft_dipolfitting function
Sara Cinelli
sara.cinelli at studenti.unipd.it
Tue Apr 16 16:37:18 CEST 2024
Hello,
I have a question regarding the following function:
function [source] = ft_dipolefitting(cfg, data)
which is reported at the following link:
https://github.com/fieldtrip/fieldtrip/blob/release/ft_dipolefitting.m
I would like to understand what changes in the following lines when the
question is about doing the grid search or not and what is the difference
between sourcemodel and dipole.
In particular, it is not very clear for me what the function does from
lines 11-15 and from 17-18: what is the difference between this two
sections?
Thank you,
Sara
1 % If you start with a grid search, the complete grid with dipole
positions is
2 % constructed using FT_PREPARE_SOURCEMODEL. It can be specified as as a
regular 3-D
3 % grid that is aligned with the axes of the head coordinate system using
4 % cfg.xgrid = vector (e.g. -20:1:20) or 'auto' (default = 'auto')
5 % cfg.ygrid = vector (e.g. -20:1:20) or 'auto' (default = 'auto')
6 % cfg.zgrid = vector (e.g. 0:1:20) or 'auto' (default = 'auto')
7 % cfg.resolution = number (e.g. 1 cm) for automatic grid generation
8 % If the source model destribes a triangulated cortical sheet, it is
described as
9 % cfg.sourcemodel.pos = N*3 matrix with the vertex positions of the
cortical sheet
10 % cfg.sourcemodel.tri = M*3 matrix that describes the triangles
connecting the vertices
11 % Alternatively the position of a few dipoles at locations of interest
can be
12 % user-specified, for example obtained from an anatomical or functional
MRI
13 % cfg.sourcemodel.pos = N*3 matrix with position of each source
14 % cfg.sourcemodel.inside = N*1 vector with boolean value whether grid
point is inside brain (optional)
15 % cfg.sourcemodel.dim = [Nx Ny Nz] vector with dimensions in case of 3-D
grid (optional)
16 %
17 % If you do not start with a grid search, you have to give a starting
location
18 % for the nonlinear search
19 % cfg.dip.pos = initial dipole position, matrix of Ndipoles x 3
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20240416/dc1fa89c/attachment.htm>
More information about the fieldtrip
mailing list