@Georgios
The dipole scanning basically selects the maximum of the "dipole modeling" maps.
To see the formula used for the various properties of the dipole, you can refer directly to the comments in the code:
Thank you so much Francois for the detailed reply and for trying to figure this out!
It would be great if we could have these references as you mentioned above.
The dipole scanning approach basically sifts through a predefined 3D grid and evaluates the respective goodness of fit of a dipole located at each grid point sequentially, for every time point. It is a straightforward procedure that computes a least-squares fit between the sensor data at each time point and the forward field (from the head model) of the dipole at each time point.
The other method, a non-linear dipole fitting method, is that from FieldTrip and does rely on a precomputed grid: the location of the dipole is fitted on the X-Y-Z continuum.
I hope this helps.