- In general, source-level data can be parcellated with ft_sourceparcellate, but only if
**your atlas is in the same space as your functional data**. - That is, there should be a one-to-one mapping between the source locations in your functional data, and the source locations in your atlas. If you want to use the AAL atlas, which is essentially defined as a volumetric image (probably at a voxel resolution of 1 or 2 mm),
**you need to interpolate/downsample this atlas onto your sourcemodel at the appropriate resolution**.This would make most sense if your sourcemodel is also defined as a 3D grid, but it is not absolutely necessary. In order to interpolate the atlas onto your sourcemodel,- you could use ft_sourceinterpolate (provided both atlas and sourcemodel are defined in the same coordinate system).

- The lcmv beamformer (by default) estimates the time series of the source, given that the source has an unknown orientation.
**The result is a 3xNtime matrix as the source activation, which is in source.avg.mom (or in source.trial(i).mom). The three rows of the moment are the strength of the source in the x-, y- and z-direction.**

- Using ft_sourcedescriptives with the option cfg.projectmom=yes you can project the source to its strongest orientation, i.e. the direction that explains most of the source variance. That is equivalent to taking the largest eigenvector of the source timeseries (which is a phrasing that is often used in papers, also on combining fMRI bold timeseries over multiple voxels).

- you should do a mtmfft with a center frequency of interest (in your case cfg.foil = [11 11]) and then you do a frequency smoothing of 3 Hz (cfg.tapsmofrq = 3). Of course you need a time window big enough to allow such a smoothing. The CSD should represent a frequency window of 8 to 14 Hz then. Then you put the result of the mtmfft into the dics beamformer.

- In fact when you do DICS beamformer , there is no need input of headmodel, just a code bug.

- Note that a true oscillation is usually considered to last at least three cycles (of course, opinions differ her – I go with four). The length of the window of interest reflects the number of cycles that can be estimated. For source reconstruction, make sure cfg.toilim is as long as the number of cycles you want to estimate, e.g. when using cfg.foi = 10, then cfg.toilim(2)-cfg.toilim(1) should be at least 400ms when you want an estimate of 4 cycles.

- For all these connectivity measures, we need the phase information from the Fourier transform (FFT) to compute the cross-spectral density matrix (CSD). The CSD can be regarded as the equivalent in the frequency domain to the covariance matrix in the time domain, thus it is a measures how a certain channels activity is co-modulated with another channels activity (for a particular frequency) – makes pretty much sense to make use of this when computing connectivity, right?
- As you might know, a Fourier transform returns complex numbers, where the imaginary part of this number contains phase information. When calling ft_freqanalysis, you can decide if it shall only return the (squared) real part of the frequency spectrum (cfg.output=’pow’), or instead the full CSD (cfg.output = ‘powandcsd’). Alternatively, you can also let ft_freqanalysis return the raw Fourier coefficients (cfg.output=’fourier’). From the Fourier coefficients, however, you can easily obtain the CSD or the power spectrum basically by multiplication the Fourier matrix with itself (transposed).
- All of these measures quantify the phase relation between channels across trials, and as phase information is coded in the imaginary part of the fourier output, thus for connectivityanalysis you need the CSD which can be obtained either by ‘powandcsd’ or by ‘fourier’.