<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">
<div style="direction: ltr;"><span style="font-size: 10pt;">Dear all, </span>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;">I am trying SAM beamformer on EEG data, but the results I get are strange. I found out that my BEM model is probably the cause of this, because the leadfields obtained by the model look
 scattered, see figure. (Black dot is one dipole location, around the head are 60 EEG electrodes with leadfield value for that dipole.) This is the optimum leadfield at optimum orientation as calculated in beamformer_sam. The three original orientations look
 scattered as well.</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;">When I make a similar figure with concentric spheres, the leadfield looks like a dipolar field, as expected. When I make the figure for the simultaneously measured MEG, with the same BEM,
 the leadfield also looks good. (Probably because MEG doesn't care so much about the headmodel.)</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;">I have created my BEM with OpenMEEG (in Windows), BEMcp gives similar results. The meshes look fine to me, and changing the number of vertices to [3000 3000 3000] does not help. Does anyone
 have an idea what could be the problem here?</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;">Thanks in advance,</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;">Kind regards,</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;">Nicole</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;">Some code:</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;">%make headmodel</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;">
<div>cfg                = [];</div>
<div>cfg.output         = {'brain' 'skull' 'scalp'};</div>
<div>seg = ft_volumesegment(cfg, MRI);</div>
</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;">
<div>%create mesh</div>
<div>cfg        = [];</div>
<div>cfg.method = 'projectmesh';</div>
<div>cfg.numvertices     = [1000 1500 3000];</div>
<div>cfg.tissue          = {'scalp','skull','brain'};</div>
<div>mesh = ft_prepare_mesh(cfg,segi);</div>
</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;">
<div>% compute the subject's headmodel/volume conductor model</div>
<div>cfg                = [];</div>
<div>cfg.method         = 'openmeeg'; </div>
<div>cfg.tissue          = {'brain' 'skull' 'scalp'};</div>
<div>vol                = ft_prepare_headmodel(cfg, mesh);</div>
</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><span style="font-size:10pt">vol = ft_convert_units(vol,'cm');</span></div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;">
<div><br>
</div>
<div>%create grid</div>
<div>cfg                 = [];</div>
<div>cfg.grid.pos        = load([ptfile filesep pts]);  % predetermined grid positions in mm</div>
<div>cfg.grid.pos        = cfg.grid.pos./10; %make unit = cm</div>
<div>cfg.headmodel       = vol;</div>
<div>cfg.moveinward      = 0.01; %check if all grid points are inside the brain</div>
<div>grid = ft_prepare_sourcemodel(cfg);</div>
</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;">
<div>% Create leadfields </div>
<div>hdr                  = ft_read_header('data.fif');</div>
<div>cfg                  = [];</div>
<div>cfg.elec             = hdr.elec;  % electrode positions</div>
<div>cfg.headmodel        = vol;   </div>
<div>cfg.grid             = grid;  </div>
<div>cfg.channel          = {'EEG', '-EEG043', '-EEG036'}; </div>
<div>cfg.normalize        = 'column'; </div>
<div>lf                   = ft_prepare_leadfield(cfg); </div>
<div><br>
</div>
<div>% beamformer</div>
</div>
<div>
<div>cfg=[];</div>
<div>cfg.method = 'sam';</div>
<div>cfg.senstype = 'EEG';</div>
<div>cfg.grid = lf; </div>
<div>cfg.headmodel = vol; </div>
<div>cfg.sam.lambda = '5%'; </div>
<div>cfg.sam.meansphereorigin = 1; %unused but necessary to not crash the script</div>
<div>cfg.sam.fixedori = 'robert'; </div>
<div>source = ft_sourceanalysis(cfg, timelock); </div>
</div>
</div>
</div>
<hr>

<p><font size="-2" face="arial" color="black"><i>
De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is
uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht
ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct
te informeren door het bericht te retourneren. Het Universitair Medisch
Centrum Utrecht is een publiekrechtelijke rechtspersoon in de zin van de W.H.W.
(Wet Hoger Onderwijs en Wetenschappelijk Onderzoek) en staat geregistreerd bij
de Kamer van Koophandel voor Midden-Nederland onder nr. 30244197.
</i></font></p>

<p><font size="-2" face="arial"  color="green"><i>
Denk s.v.p aan het milieu voor u deze e-mail afdrukt.
</i></font></p>

<hr>

<p><font size="-2"  face="arial" color="black"><i>
This message may contain confidential information and is intended
exclusively for the addressee. If you receive this message
unintentionally, please do not use the contents but notify the sender
immediately by return e-mail. University Medical Center Utrecht is a legal
person by public law and is registered at the Chamber of Commerce for
Midden-Nederland under no. 30244197.
</i></font></p>

<p><font size="-2"  face="arial" color="green"><i>
Please consider the environment before printing this e-mail.
</i></font></p>
</body>
</html>