Beamformer time course

Robert Oostenveld r.oostenveld at FCDONDERS.RU.NL
Wed May 24 20:26:43 CEST 2006

On 23 May 2006, at 17:09, Marie Smith wrote:
> I have tried the analysis as you suggest and although the analysis
> appears to run I cannot find the single trial time courses in the
> outcome of the second run of sourceanalysis.

Hi Marie,

Please try following demo, in which you have to replace the res4 and
hdm file with some that you have on your disk.

% read some data that is required to simulate MEG data, i.e. volume
% sensor positions and MRI (optional, only for plotting)
vol  = read_ctf_hdm('test_RO_005/Subject01.hdm');
hdr  = read_fcdc_header('test_RO_005/Subject01.ds/Subject01.res4');
grad = hdr.grad;

% construct the simulated MEG data
cfg               = [];
cfg.vol           = vol;
cfg.grad          = grad;
cfg.fsample       = 300;
cfg.ntrials       = 30;
cfg.triallength   = 1;
cfg.dip.pos       = [0 7 8];       = [1 0 0];
cfg.dip.signal    = sin(2*pi*10*(1:cfg.fsample)./cfg.fsample);
cfg.absnoise      = 1e-8;
rawA = dipolesimulation(cfg);

% compute ERF and covariance
cfg = [];
cfg.keeptrials = 'yes';
cfg.covariance = 'yes';
avgA = timelockanalysis(cfg, rawA);

% test each of the resampling strategies for LCMV
cfg = [];
cfg.method = 'lcmv';
cfg.lambda = 0;
cfg.resolution = 4;
cfg.hdmfile = 'test_RO_005/Subject01.hdm'; = 'no';
cfg.keepfilter = 'yes';
source1 = sourceanalysis(cfg, avgA);
cfg.grid = source2grid(source1);
cfg.rawtrial = 'yes';
source2 = sourceanalysis(cfg, avgA);

If you look in source2, you will see
 >> source2.trial
ans =
1x30 struct array with fields:

Each source2.trial(i).mom contain the virtual channel outputs in
trial i for each of the grid locations, i.e.
will plot the x, y, and z components of the dipole moment in the
first trial and on the first dipole location of the grid inside the

> Also, for information I am having some problems using the compiled
> mex files with matlab 7 under unix.

which unix?


More information about the fieldtrip mailing list