first steps using lcmv

Robert Oostenveld r.oostenveld at FCDONDERS.RU.NL
Mon Mar 5 17:56:33 CET 2007

Hi Nathan,

On 2 Mar 2007, at 18:40, Nathan Weisz wrote:
> in order to explore the usage of the lcmv option of sourceanalysis
> i'm using eeg data (35 electrodes)  with an auditory N1. topography
> is attached. within fieldtrip i did a dipolefit, and the output
> looks relatively sensible (perhaps a little deep and posterior, but
> overall not bad for EEG :-)). however when i run lcmv
> sourceanalysis, plotting the "neural activation index" gives me
> something really terrible (also attached). since the "solution"
> appears relatively clear in this case, i guess i have done
> something stupid at some point.

Given that you do not report explicit errors, I suspect problems with
different coordinates

The topography looks ok, and the source from DIPOLEFITTING seems to
match. I don't know whether the small number of electrodes would be a
problem for beaming  the data.

> cfg=[];
> cfg.latency=[.09 .12]; %latency of my N1
> cfg.covariance='yes';
> cfg.keeptrials='yes';
> datTest=timelockanalysis(cfg,dat);

You may want to specify cfg.covariancewindow as well. Please read the
emails on the list from last week between Marie and me for an
explanation on te hcomputation of the covariance. Marie has some
meaningfull ideas here (I visited her last Friday and we were able to
discuss this directly), but they have not yet been implemented in FT.

> cfg=[];
> cfg.vol=vol;
> cfg.grid.xgrid='auto';
> cfg.grid.ygrid='auto';
> cfg.grid.zgrid='auto';
> [grid] = prepare_leadfield(cfg, datTest); %the same LF-matrix used
> for 'good' dipole fit

Are the dipoles (grid.pos) in mm? It should be in mm, just as your
head model. Note that beamforming is much more sensitive to head
model misspecification than plain dipolefitting, so you may want to
use a (standard) BEM model instead of a spherical model.

> cfg=[];
> cfg.grid=source2sparse(grid);
> cfg.method='lcmv';
> cfg.vol=vol;
> cfg.projectnoise='yes';
> [sourceN1] = sourceanalysis(cfg, datTest);

I would expect a problem here for you, since the default noise
estimate in case of EEG should be zero. The noise (for the
projection) is estimated by taking the smallest singular value of the
covariance matrix, and given that the ata is supposed to be avg-
referenced, the smallest singular value should be zero. I.e. it
should give a warning about the matrix being rank-deficient. The
solution to that is to explicitely noise regularize using cfg.lambda.

> cfg=[];
> cfg.powmethod='none'; %only option that works
> [sourcenai] = sourcedescriptives(cfg, sourceN1);

Since you have not specified anything fancy in the lcmv beamformer,
you indeed do not have to post-process your power here (that requires

> cfg =[];
> cfg.funparameter  = 'nai';
> sourceN1F=source2full(sourcenai);
> [interp]=sourceinterpolate(cfg,sourceN1F,mri);

I suspect the problem here: please explicitely specyfy
cfg.sourceunits and cfg.mriunits.

> sliceinterp(cfg,interp)

please use sourceplot with cfg.method='slice' instead (sliceinterp is

> I'd really appreciate pointers of what I may be doing wrong.

Not related to the reported problem, but very important in general is
the referencing: please ensure that your data is averaged referenced
before computing the covariance. The options cfg.preproc.refef='yes'
and cfg.preproc.refchan='all' in timelockanalysis should do that for
you. You can easily check by summing the potential over all channels:
the sum should be zero at every sample.

I hope this helps,

More information about the fieldtrip mailing list