[FieldTrip] Creating Leadfield using BEM
B.Mouthaan at neuro.umcn.nl
B.Mouthaan at neuro.umcn.nl
Wed Oct 26 12:08:55 CEST 2011
Dear Fieldtrippers,
I am trying to compute a beamform localisation using a BEM-model of the head. When I call ft_sourceanalysis i receive to following error.
??? Error using ==> svd
Input to SVD must not contain NaN or Inf.
Error in ==> beamformer_lcmv>pinv at 367
[U,S,V] = svd(A,0);
Error in ==> beamformer_lcmv at 255
filt = pinv(lf' * invCy * lf) * lf' * invCy; % van Veen eqn. 23, use PINV/SVD to cover rank deficient leadfield
Error in ==> ft_sourceanalysis at 818
dip(i) = beamformer_lcmv(grid, sens, vol, squeeze(avg(i,:,:)), squeeze(Cy(i,:,:)), optarg{:});
I noticed that my leadfieldgrid containend NaN values. I think this could be the cause, but I don't know how to fix this problem. Does anyone have an idea?
My script is as follows
vol=ft_read_vol('standard_vol.mat')
elec=ft_read_sens('standard_1005.elc') % reading the 1005 systeem because the experiment used of 32 electrodes
cfg=[]
cfg.showlabels= 'yes'
cfg.layout='EEG1010.lay'
cfg.interactive= 'yes'
% Reref
load (['C:\Users\Brian\Documents\MATLAB\AnalysisM\differencewave0' Subject])
cfg=[]
cfg.reref='yes' % referring the
cfg.refchannel= 'all' % commonaverage reference
diff=ft_preprocessing(cfg,diffwav)
%% Creating LEADFIELD
cfg = [];
cfg.elec = elec;
cfg.vol = vol;
cfg.reducerank = 3;
cfg.channel = 'all';
cfg.grid.resolution = 10; % use a 3-D grid with a 10 mm resolution
[grid] = ft_prepare_leadfield(cfg);
save('AnalysisM\Grid_10mm', 'grid')
%%
cfg = [];
cfg.covariance = 'yes';
cfg.covariancewindow = [0 .75];
cfg.removemean = 'no';
tlckavgpst = ft_timelockanalysis(cfg, diff);
cfg.covariancewindow = [-0.25 0];
tlckavgpre = ft_timelockanalysis(cfg, diff);
%%
cfg = [];
cfg.method = 'lcmv';
cfg.vol = vol;
cfg.elec = elec
cfg.lambda = '5%';
sourcepst = ft_sourceanalysis(cfg, tlckavgpst);
sourcepre = ft_sourceanalysis(cfg, tlckavgpre);
sourcepst.avg.nai = sourcepst.avg.pow./sourcepre.avg.pow;
Thanks in advance!
Brian
Het UMC St Radboud staat geregistreerd bij de Kamer van Koophandel in het handelsregister onder nummer 41055629.
The Radboud University Nijmegen Medical Centre is listed in the Commercial Register of the Chamber of Commerce under file number 41055629.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20111026/cc846df0/attachment-0001.html>
More information about the fieldtrip
mailing list