<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Fieldtrip users,<div><br></div><div>I am trying to apply a beamformer to simulated data to check whether my headmodels are correct. While ft_dipolefit localizes the dipole in the original position, the beamformer results in a source at a totally different position (see figure 1). I kept everything as similar as possible to the example scripts (forward simulation & dipole fit, forward simulation & beamformer) but used individual gradiometer positions, grid and volume of a single subject (CTF space) and plotted the source in a template grid (SPM space). If I run the dipolesimulation with the individual gradiometer structure and the template headmodel vol and template grid, the dipole and the source result in the same position, although the grad and vol are not in the same coordinate system (figure 2). And importantly, shouldn't the dipole be in the right hemisphere anyway with the coordinates 5/2/3? I appended the code below.</div><div><br></div><div>Could the different coordinate systems lead to the inconsistent results of dipolefitting and beamforming? Will the dipolesimulation be in the same coordinate system as the volume or gradiometer structure I feed in (CTF space, in my case)? How could I use the dipolesimulation, dipolefitting and beamforming to properly check my headmodels?</div><div><br></div><div>I tried so many things now but I couldn't find the error. Any help is very appreciated.</div><div><br></div><div>Best,</div><div>Kathrin</div><div><br></div><div><br></div><div><br></div><div>These are the variables I used:</div><div><br></div><div>vol = headmodel of individual subject in CTF space (cm)</div><div>data.grad = gradiometer structure of individual subject in CTF space (cm)</div><div>mnigrid = grid of individual subject in CTF space (cm)</div><div>template_grid = grid of template brain in SPM space (cm)</div><div>mri = spm8 template brain in SMP space</div><div><br></div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; color: rgb(57, 157, 43); ">%% compute forward simulated data + apply diplole fit</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg = [];</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg.vol = vol;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg.grad = data.grad;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg.channel = <span style="color: #b026f3">'MEG'</span>;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg.dip.pos = [5 2 3]; <span style="color: #399d2b">% pos of dipole in cm</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg.dip.mom = [1 0 0]';</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg.dip.frequency = 10;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg.ntrials = 20;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg.relnoise = 10;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">raw = ft_dipolesimulation(cfg);</div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"> <br class="webkit-block-placeholder"></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; color: rgb(57, 157, 43); ">% compute the data covariance matrix, which will capture the activity of</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; color: rgb(57, 157, 43); ">% the simulated dipole</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg = [];</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg.covariance = <span style="color: #b026f3">'yes'</span>;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">avg = ft_timelockanalysis(cfg, raw);</div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"> <br class="webkit-block-placeholder"></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; color: rgb(57, 157, 43); ">% apply dipolefit</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg = [];</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg.vol = vol;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg.grad = data.grad;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg.dip.pos = [0 0 0];</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg.gridsearch = <span style="color: #b026f3">'no'</span>;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">dip = ft_dipolefitting(cfg, avg);</div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"> <br class="webkit-block-placeholder"></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg = [];</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg.location = dip.dip.pos *10;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">figure, ft_sourceplot(cfg,mri)</div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; color: #399d2b; min-height: 14.0px"><br></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; color: #399d2b; min-height: 14.0px"> <br class="webkit-block-placeholder"></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; color: rgb(57, 157, 43); ">% do the beamformer source reconstuction on a 1 cm grid</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg = [];</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg.channel = <span style="color: #b026f3">'MEG'</span>;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg.vol = vol;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg.grad = data.grad;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg.grid = mnigrid;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; color: rgb(57, 157, 43); "><span class="Apple-style-span" style="color: rgb(0, 0, 0); ">cfg.method = </span><span class="Apple-style-span" style="color: rgb(0, 0, 0); "><span style="color: #b026f3">'lcmv'</span></span><span class="Apple-style-span" style="color: rgb(0, 0, 0); ">;</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; color: rgb(57, 157, 43); "><span class="Apple-style-span" style="color: rgb(0, 0, 0); ">cfg.projectnoise = <span style="color: #b026f3">'yes'</span>; </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">source = ft_sourceanalysis(cfg, avg);</div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"><br></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; color: rgb(57, 157, 43); ">% compute the neural activity index, i.e. projected power divided by</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; color: rgb(57, 157, 43); ">% projected noise</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg = [];</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; color: rgb(57, 157, 43); "><span style="color: #000000">cfg.powmethod = </span><span style="color: #b026f3">'none'</span><span style="color: #000000">; </span>% keep the power as estimated from the data covariance, i.e. the induced power</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">source = ft_sourcedescriptives(cfg, source);</div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"> <br class="webkit-block-placeholder"></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">interp = ft_sourceinterpolate([], source, mri);</div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"> <br class="webkit-block-placeholder"></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg = [];</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg.method = <span style="color: #b026f3">'ortho'</span>;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg.interactive = <span style="color: #b026f3">'yes'</span>;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg.funparameter = <span style="color: #b026f3">'nai'</span>;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; color: rgb(57, 157, 43); "><span style="color: #000000">cfg.funcolorlim = [1.5 4]; </span>% the voxel in the center of the volume conductor messes up the autoscaling</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">figure, ft_sourceplot(cfg, interp);</div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"> <br class="webkit-block-placeholder"></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"><br></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; min-height: 14px; "><span class="Apple-style-span" style="font-family: Helvetica; font-size: medium; "><img id="5ed88cf6-6c13-46f8-8163-7afebc801b7d" height="507" width="1149" apple-width="yes" apple-height="yes" src="cid:09291E28-5FFC-437D-A2F8-CC01EBF38569"></span></div></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; min-height: 14px; "><span class="Apple-style-span" style="font-family: Helvetica; font-size: medium; "><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; min-height: 14px; "><span class="Apple-style-span" style="font-family: Helvetica; font-size: medium; "><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; min-height: 14px; "><span class="Apple-style-span" style="font-family: Helvetica; font-size: medium; "><img id="194e3c68-1343-4452-927f-3bad298a15a9" height="506" width="1156" apple-width="yes" apple-height="yes" src="cid:5628C872-5927-4097-A6B5-E293E449717E"></span></div><br><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>_____________________________________</div><div>Kathrin Müsch</div><div><br></div><div><div>Dept. of Neurophysiology and Pathophysiology</div><div>University Medical Center Hamburg-Eppendorf</div><div>Martinistr. 52</div><div>20246 Hamburg</div><div>Germany</div><div>Phone: +49-40-7410-54680</div><div>Fax: +49-40-7410-57752</div><div>E-Mail: <a href="mailto:k.muesch@uke.uni-hamburg.de">k.muesch@uke.uni-hamburg.de</a></div><div><div>_____________________________________</div></div></div></div></span></div></span></div></span></div></span></div></span></div></span></div></span></div></span></span>
</div>
<br><font face="monospace"><br>
--<br>
Pflichtangaben gemäß Gesetz über elektronische Handelsregister und Genossenschaftsregister sowie das Unternehmensregister (EHUG):<br>
<br>
Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg<br>
<br>
Vorstandsmitglieder: Prof. Dr. Guido Sauter (Vertreter des Vorsitzenden), Dr. Alexander Kirstein, Joachim Prölß, Prof. Dr. Dr. Uwe Koch-Gromus </font></body></html>