[FieldTrip] Fitting a Magnetic Dipole

Robert Oostenveld r.oostenveld at donders.ru.nl
Wed Nov 16 17:06:54 CET 2011

Hi Graham

If you specify 

cfg.vol      = [];
cfg.vol.type = 'infinite';

and pass a gradiometer structure(*) along to ft_dipolefitting (or ft_sourceanalysis, ft_prepare_leadfield or similar function), it will be interpreted as a magnetic dipole in an infinite vacuum. So this allows you to localize the magnetic HPI coil.

Fitting the complex-valued topography after ft_freqanalysis is in principle also supported in the ft_dipolefitting function, but I should admit that that has not been used a lot (and certainly not recently). The dipole fit implementation of the Fourier data has been more or less hacked into the code and is therefore also not documented (but you can look in the code to see how it works). In case it fails on the frequency data, you are probably better off to work your way around it and convert the topography into a datastructure that resembles the output of ft_timelockanalysis before feeding it into ft_dipolefitting.

best regards,

PS *) Note that with the same vol structure and an eeg electrode structure it would have been interpreted as an electric current dipole in an infinite homogenous conduction medium

On 16 Nov 2011, at 14:51, Little, Graham wrote:

> Hi all,
> I am currently trying to Fit a dipole to HPI coil locations to perform head position correction in fieldtrip.  Currently I am using the ft_dipolefitting function to generate the coil locations from a section of MEG data. Before running ft_dipolefitting I do an fft on the data to measure the complex valued MEG topography for each coil frequency.  The topographies look great for each coil, you can definitely see where each dipole should be fitted, however when using ft_dipolefitting the locations I get back are incorrect.
> I believe this is due to the fact that ft_dipolefitting assumes an Equivalent Current Dipole, but the coils generate a Magnetic Dipole.  Anyway to tell ft_dipolefitting to fit a Magnetic Dipole rather than the ECD solution.
> Any information would be helpful.
> Thanks,
> Graham
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

More information about the fieldtrip mailing list