[FieldTrip] ft_sourceanalysis using LCMV beamformer and grid from ft_prepare_leadfield

Tyler Grummett tyler.grummett at flinders.edu.au
Tue Apr 8 04:48:08 CEST 2014


Hello fieldtrip,


I am trying to perform an LCMV beamformer on timelockanalysis data.


timelock =

       avg: [124x20517 double]
       var: [124x20517 double]
      time: [1x20517 double]
       dof: [124x20517 double]
     label: {1x124 cell}
    dimord: 'chan_time'
       cov: [124x124 double]
      elec: [1x1 struct]
       cfg: [1x1 struct]

I first run ft_prepare_leadfield

            cfg                 = [];
            cfg.elec            = timelock.elec;
            cfg.vol             = vol;
            cfg.grid.resolution = 1;   % use a 3-D grid with a 1 cm resolution
            cfg.grid.unit       = 'cm';
            cfg.normalize       = 'yes'; % if you are not contrasting the activity of interest again another condition or baseline time-window
            grid = ft_prepare_leadfield( cfg);

grid =
        xgrid: [-5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8]
        ygrid: [-6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7]
        zgrid: [0 1 2 3 4 5 6 7 8 9 10 11 12]
          dim: [14 14 13]
          pos: [2548x3 double]
         unit: 'cm'
       inside: [1x1409 double]
      outside: [1x1139 double]
          cfg: [1x1 struct]
    leadfield: {1x2548 cell}

I then try to run the ft_sourceanalysis code:

            cfg              = [];
            cfg.channel = timelock.label;
            cfg.method       = 'lcmv';
            cfg.grid = grid;
            cfg.vol          = vol;
            cfg.keepfilter = 'yes';
            source = ft_sourceanalysis( cfg, timelock);


And it crashes with the error message:

Error using  *
Inner matrix dimensions must agree.

Error in beamformer_lcmv (line 268)
    filt = pinv(lf' * invCy * lf) * lf' * invCy;              % van Veen eqn. 23, use PINV/SVD to
    cover rank deficient leadfield

Error in ft_sourceanalysis (line 794)
      dip(i) = beamformer_lcmv(grid, sens, vol, squeeze_avg, squeeze(Cy(i,:,:)), optarg{:});



However, the code does work if it is:

            cfg              = [];
            cfg.channel = timelock.label;
            cfg.method       = 'lcmv';
            cfg.grid.inside = grid.inside;
            cfg.vol          = vol;
            cfg.keepfilter = 'yes';
            source = ft_sourceanalysis( cfg, timelock);

However, I run the sourceplot code produces something that looks like the picture attached.

What is interesting is that when I run the interp code:

    the input is source data with 16777216 positions on a [256 256 256] grid
    not plotting anatomy

But when you run the same code from sourcePost_nocon from the beamformer tutorial,  you get the following when you run the code:

    the input is source data with 3042 positions on a [18 13 13] grid
    the input is volume data with dimensions [256 256 256]

I have used the same mri file for both.
?
Please help, I cant work out the issue.

Tyler



*************************

Tyler Grummett ( BBSc, BSc(Hons I))
PhD Candidate
Brain Signals Laboratory
Flinders University
Rm 5A301
Ext 66124
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/8fdaa46e/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sourceplot_example.png
Type: image/png
Size: 15766 bytes
Desc: sourceplot_example.png
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/8fdaa46e/attachment-0001.png>


More information about the fieldtrip mailing list