Source analysis error

Philip C. Bikle pbikle at NIH.GOV
Thu Nov 3 22:19:16 CET 2005


I get the following error when attempting to source analysis:


Warning: cross-spectral density matrix is rank deficient
> In fieldtrip-20051027/private/beamformer at 253
  In sourceanalysis at 701
??? Error using ==> mtimes
Inner matrix dimensions must agree.

Error in ==> fieldtrip-20051027/private/beamformer at 365
          filt2 = pinv(lf2' * invCf * lf2) * lf2' * invCf;

Error in ==> sourceanalysis at 701
        dip(i) = beamformer(grid, sens, vol, [], squeeze(Cf(i,:,:)),
'method', 'dics', 'feedback', cfg.feedback, 'projectnoise',
cfg.projectnoise, 'keepfilter', cfg.keepfilter, 'supdip', cfg.supdip,
>>



Can any one tell me what I am doing wrong? I am attaching a script file
which is what I am using to examine coherence. The script errors at line 77
([source] = sourceanalysis(cfg, freq);).
-------------- next part --------------
%function docoh(subj, cond, pre, post, dip)


addpath /usr/local/fieldtrip-20051027/

ds = sprintf('/media/usbdisk/MEG/AC/test.ds');

subj='AC';
f = 10;
smo = 5.;
r = .7;
loc = 'RFus';
cond = 'FACES';
pre = 0.0;
post = 0.5;
dip = [-5.5,-3.7,-1.7]


cfg = [];
cfg.dataset = ds;
cfg.trialdef.eventtype = cond;
cfg.trialdef.prestim = pre;
cfg.trialdef.poststim = post;
[data] = preprocessing(cfg);

cfg = [];
cfg.method = 'fft';
cfg.output = 'powandcsd';
cfg.tapsmofrq = smo;
cfg.foilim = [f f];
cfg.keeptrials = 'yes';
cfg.sgncmb = channelcombination({'MEG' 'MEG'}, data.label);
[freq] = freqanalysis(cfg, data);

cfg = [];
%cfg.xgrid = -10:r:10;
%cfg.ygrid = -10:r:10;
%cfg.zgrid = -2:r:14;

cfg.xgrid = -12:1:12;
cfg.ygrid = -10:1:10;
cfg.zgrid = -3:1:14;


cfg.dim = [length(cfg.xgrid) length(cfg.ygrid) length(cfg.zgrid)];
N=prod(cfg.dim);
cfg.inside = 1:N;
cfg.outside = [];


cfg.hdmfile = strcat(ds, '/localSpheres.hdm');
[grid] = PREPARE_LEADFIELD(cfg, freq);
%[grid] = precompute_leadfield(cfg, freq);
%[grid] = source2sparse(grid);




cfg = [];
cfg.channel='MEG';
cfg.method = 'coh_refdip';
cfg.refdip = dip;
cfg.projectnoise = 'yes';
cfg.hdmfile = strcat(ds, '/localSpheres.hdm');
cfg.grid = grid;
%cfg.rawtrial = 'yes';
cfg.jacknife = 'yes';
cfg.frequency = f;
cfg.lambda = .000000000000000000000000001;
cfg.keepleadfield = 'no';
cfg.feedback = 'none';
[source] = sourceanalysis(cfg, freq);
[source] = sourcedescriptives([], source);
%[source] = source2full(source);

brikname = sprintf('%s-%s-%s-%gHz', subj, cond, loc, f);
[err, errmsg, info] = writesourcebrik(source, source.avg.coh, brikname);
if err
	disp(errmsg)
end

-------------- next part --------------
Warning: higher order synthetic gradiometer configuration
> In fieldtrip-20051027/private/prepare_vol_sens at 202
  In sourceanalysis at 442
2684 dipoles inside, 6766 dipoles outside brain
1 conditions, each with 3 data objects
constructing 14 jacknife replications
scanning repetition 1
Warning: cross-spectral density matrix is rank deficient
> In fieldtrip-20051027/private/beamformer at 253
  In sourceanalysis at 701
??? Error using ==> mtimes
Inner matrix dimensions must agree.

Error in ==> fieldtrip-20051027/private/beamformer at 365
          filt2 = pinv(lf2' * invCf * lf2) * lf2' * invCf;

Error in ==> sourceanalysis at 701
        dip(i) = beamformer(grid, sens, vol, [], squeeze(Cf(i,:,:)), 'method', 'dics', 'feedback', cfg.feedback, 'projectnoise', cfg.projectnoise, 'keepfilter', cfg.keepfilter, 'supdip', cfg.supdip,
>>


More information about the fieldtrip mailing list