<div dir="ltr"><p class="MsoNormal">Dear Fieldtrip members,<br><br>I’m dealing with source analysis and I have a big problem that I can’t resolve…<br><br>Filedtrip gives me an error after launching of ft_sourceanalysis:<br><br>??? Error using ==> svd<br><br>Input to SVD must not contain NaN or Inf.<br><br>Error in ==> rank at 15<br><br>s = svd(A);<br><br>Error in ==> ft_eloreta at 132<br><br> rank_lf(i) = rank(dip.leadfield{i});<br><br>Error in ==> ft_sourceanalysis at 850<br><br> dip(i) = ft_eloreta(grid, sens, vol, squeeze(avg(i,:,:)), squeeze(Cy(i,:,:)),<br><br> optarg{:});<br><br>In my leadfield computation there are in fact many NaN points. I report my script below because I can’t find where the error can be. I used standard_mri template to prepare head model.<br><br>%% 1. PREPARING HEAD MODEL<br><br>%METHOD 1<br><br>%if you have a structural mri and you want to create headmodel<br><br> <br><br>%load headmodel – mri<br><br>load ('C:\Users\DorianaNote\Documents\MATLAB\fieldtrip-20140424\fieldtrip-20140424\template\headmodel\standard_mri');<br><br>cfg = [];<br><br>cfg.output = {'brain','skull','scalp'};<br><br>template_seg = ft_volumesegment(cfg, mri);<br><br> <br><br>cfg = [];<br><br>cfg.method = 'bemcp';<br><br>template_vol = ft_prepare_headmodel(cfg, template_seg);<br><br> <br><br>elec = ft_read_sens('GSN-HydroCel-128.sfp');<br><br>template_vol = ft_convert_units(template_vol, elec.unit);<br><br> <br><br>cfg = [];<br><br>cfg.method = 'interactive';<br><br>cfg.elec = elec;<br><br>cfg.headshape = template_vol.bnd(3);<br><br>elec_aligned = ft_electroderealign(cfg);<br><br> <br><br>cfg = [];<br><br>cfg.grid.unit = template_vol.unit;<br><br>cfg.elec = elec_aligned;<br><br>cfg.mri = mri;<br><br>cfg.vol = template_vol;<br><br>grid = ft_prepare_sourcemodel(cfg)<br><br> <br><br>cfg = [];<br><br>cfg.elec = elec_aligned;<br><br>cfg.vol = template_vol;<br><br>cfg.reducerank = 3;<br><br>cfg.grid = grid;<br><br>cfg.channel = {'all'};<br><br>cfg.grid.unit = 'cm';<br><br>[grid] = ft_prepare_leadfield(cfg, data);<br><br> <br><br>cfg = [];<br><br>cfg.method = 'eloreta';<br><br>cfg.grid = grid;<br><br>cfg.elec = elec_aligned;<br><br>cfg.vol = template_vol;<br><br>source = ft_sourceanalysis(cfg, data);<br><br> <br><br>I’m trying to analyze component data in order to localize comp.topo parameter. I used the function comp2timelocked to transform data in a timelock-like structure... I don’t know if it can be a problem.<br><br><br>I sincerely hope someone of you can help me<br><br>Many thanks<br><br> ----------------<br><br>Doriana De Marco, Ph.D. Student<br><br></p>
</div>