[FieldTrip] MATLAB crashes during ft_sourceanalysis

Kirandeep Kaur kkaur.aiims at gmail.com
Thu Jul 28 16:25:20 CEST 2022


Dear all, this is a query regarding implementation of LCMV beamformer.

I am using ft_sourceanalysis to compute the beamformer  virtual channels
and kurtosis for data collected from Elekta Neuromag 306 channels MEG
scanner. However, while scanning the grid (typically ranging from 12,000 -
15,000 points), my MATLAB (R2021a) simply shuts down without any error.
This also typically happens after the function has scanned >11,000 grid
points.

This problem is occurring for roughly 40% of my subjects. The sampling rate
is downsampled to 500Hz, and the duration of continuous MEG record for
which I am computing the beamformer is typically 10-12 minutes. I am using
the reconstructed MRI from Freesurfer (orig.magz) for constructing the head
model. A snapshot of the code I am using is given here :

----------------------------------------------------------------------

%% compute leadfield

cfg = [];

cfg.channel = 'MEG';

cfg.headmodel = headmodel;

cfg.sourcemodel = sourcemodel;

cfg.normalize = 'yes'; % normalisation avoids power bias towards centre of
head

cfg.reducerank = 2;

leadfield = ft_prepare_leadfield(cfg, cov_matrix);



save ('leadfield');



%% %plot svd of covariance matrix



[u,s,v] = svd(cov_matrix.cov);



figure;

semilogy(diag(s),'o-');

savefig (gcf, 'svd_covariance.fig', 'compact');

close all

%% compute the LCMV beamformer



cfg = [];

cfg.method = 'lcmv';

cfg.sourcemodel = leadfield;

cfg.headmodel = headmodel;

cfg.lcmv.keepfilter = 'yes';

cfg.lcmv.fixedori = 'yes'; % project on axis of max variance using SVD

cfg.lcmv.lambda = '5%';

cfg.lcmv.kappa = 69;

cfg.lcmv.projectmom = 'yes'; % project dipole time series in direction of
maximal power

cfg.lcmv.kurtosis = 'yes';

cfg.lcmv.keepmom = 'yes';

source = ft_sourceanalysis(cfg, cov_matrix);



save ('source');


-------------------------------------------------------




Any help regarding this would be very useful since I am not able to find a
solution to this problem.


Kind regards,


Kirandeep Kaur,

Research Fellow, Aston University,

Birmingham, UK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20220728/2a5b4bcb/attachment.htm>


More information about the fieldtrip mailing list