[FieldTrip] Creating Leadfield using BEM

"Jörn M. Horschig" jm.horschig at donders.ru.nl
Wed Oct 26 13:04:53 CEST 2011


Dear Brian,

I got the same error a while ago, which was caused by a wrong 
segementation/triangulation of the volume (it was a bug in FieldTrip). 
Are you using the newest version of FieldTrip? It should be solved there.
In any case, it would be wise to check your segmentation and 
triangulation. You can do so with ft_plot_vol and ft_plot_mesh, e.g.:
/        figure;hold on;
         ft_plot_vol(hdm, 'edgecolor', 'none');alpha 0.5;camlight
         ft_plot_mesh(hdm.bnd); /

Hope it helps!
Best,
Jörn

On 10/26/2011 12:08 PM, B.Mouthaan at neuro.umcn.nl wrote:
>
> 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.
>
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip


-- 
Jörn M. Horschig
PhD Student
Donders Institute for Brain, Cognition and Behaviour
Centre for Cognitive Neuroimaging
Radboud University Nijmegen
Neuronal Oscillations Group

P.O. Box 9101
NL-6500 HB Nijmegen
The Netherlands

Contact:
E-Mail: jm.horschig at donders.ru.nl
Tel:    +31-(0)24-36-68493
Web: http://www.ru.nl/donders

Visiting address:
Trigon, room 2.30
Kapittelweg 29
NL-6525 EN Nijmegen
The Netherlands

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20111026/531037dc/attachment-0002.html>


More information about the fieldtrip mailing list