[FieldTrip] Optimizing leadfield computation

Schoffelen, J.M. (Jan Mathijs) jan.schoffelen at donders.ru.nl
Fri Aug 12 14:16:17 CEST 2016


Hi Bruno,

I don’t know about the low-level details of the computation in meg_forward, but I’d take your word on that it allows for multiple positions simultaneously.

With respect to the leadfield calculation as such, we typically recommend to pre-compute them once (and store them for later use), and input a source-model with these pre-computed leadfields in ft_sourceanalysis. This typically works if you keep the signal subspace for which you computed your leadfields consistent with the signal subspace of the sensor-data.

We are aware that apart from this FT's beamformer code is relatively slow (even with precomputed leadfields), but at some point in the past we decided to go for code clarity and correctness, rather than to go for computational speed. Doing all computations vectorized will make the code quite opaque (and moreover is not really straightforward if one would like to stay flexible with respect to location specific dimensions of vector leadfields (e.g. regional sources). Given all other steps in typical data processing pipelines, the beamformer step is usually not the time limiting one.  

Best,
Jan-Mathijs

> On 12 Aug 2016, at 13:52, Bruno L. Giordano <brungio at gmail.com> wrote:
> 
> Hi,
> 
> I wonder whether the leadfield computation (singleshell) can be made faster by avoiding loops through the dipoles (e.g., avoiding dipole loops makes the beamformer >20 times faster).
> 
> It seems like the most time consuming part of the leadfield computation is meg_forward.m Am I correct in concluding that this function accepts multiple dipoles in input?
> 
> Thank you,
> 
> 	Bruno
> 
> 
> -- 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Bruno L. Giordano, PhD
> Institute of Neuroscience and Psychology
> 58 Hillhead Street, University of Glasgow
> Glasgow, G12 8QB, Scotland
> T +44 (0) 141 330 5484
> Www: http://www.brunolgiordano.net
> Email charter: http://www.emailcharter.org/
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip





More information about the fieldtrip mailing list