<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>
<div>
<div>Hi Stan,</div>
<div>Thank you for your suggestions. I’m definitely a fan of yours :)</div>
<div> </div>
<div>So indeed the mistake was that for some reason my mri_realign_mni was not in mni space. So be careful checking that the space is correctly defined in your input mri:</div>
<div>mri_realign = coordsys: 'ctf' and mri_realign_mni = coordsys: 'spm'</div>
<div> </div>
<div>Then you can follow the described protocol:</div>
<div>mri_realign = ft_volumerealign(cfg, mri_orig);</div>
<div>mri_realign_mni=ft_volumenormalise([],mri_realign)</div>
<div> </div>
<div>% Forward warping of coordinates 'pos' work like this:</div>
<div>mnipos=ft_warp_apply(mri_realign_mni.params,ft_warp_apply(mri_realign_mni.initial, ctfpos),'individual2sn')</div>
<div> </div>
<div>% Inverse warping returns coordinates of mnipos in subject space (ctfpos):</div>
<div>posback=ft_warp_apply(mri_realign_mni.params,mnipos,'sn2individual')</div>
<div>ctfpos= ft_warp_apply(pinv(mri_realign_mni.initial),posback)</div>
<div> </div>
<div>% ctf-space</div>
<div>cfg=[];</div>
<div>cfg.location=ctfpos;</div>
<div>cfg.locationcoordinates='head';</div>
<div>ft_sourceplot(cfg,mri_realign)</div>
<div> </div>
<div>% MNI-space:</div>
<div>cfg=[];</div>
<div> cfg.location=mnipos;</div>
<div> cfg.locationcoordinates='head';</div>
<div> ft_sourceplot(cfg,mri_realign_mni)</div>
<div> </div>
<div> </div>
<div>Thanks again!</div>
<div>Barbara</div>
<div name="quote" style="margin: 10px 5px 5px 10px; padding: 10px 0px 10px 10px; border-left-color: rgb(195, 217, 229); border-left-width: 2px; border-left-style: solid; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin: 0px 0px 10px;"><b>Gesendet:</b> Dienstag, 19. Mai 2015 um 11:09 Uhr<br/>
<b>Von:</b> "Pelt, S. van (Stan)" <stan.vanpelt@donders.ru.nl><br/>
<b>An:</b> "FieldTrip discussion list" <fieldtrip@science.ru.nl><br/>
<b>Betreff:</b> Re: [FieldTrip] leadfields MNI-coordinates</div>
<div name="quoted-content"><!--p.MsoNormal, li.MsoNormal, div.MsoNormal {
margin: 0.0cm;
font-size: 12.0pt;
font-family: "Times New Roman" , serif;
}
a:link, span.MsoHyperlink {
color: blue;
text-decoration: underline;
}
a:visited, span.MsoHyperlinkFollowed {
color: purple;
text-decoration: underline;
}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph {
margin-top: 0.0cm;
margin-right: 0.0cm;
margin-bottom: 0.0cm;
margin-left: 36.0pt;
font-size: 12.0pt;
font-family: "Times New Roman" , serif;
}
span.EmailStyle17 {
font-family: Calibri , sans-serif;
color: rgb(31,73,125);
}
*.MsoChpDefault {
font-size: 10.0pt;
}
div.WordSection1 {
page: WordSection1;
}
ol {
margin-bottom: 0.0cm;
}
ul {
margin-bottom: 0.0cm;
}
-->
<div>
<div class="WordSection1">
<p class="MsoNormal"><span style="color: rgb(31, 73, 125); font-family: Calibri , sans-serif; font-size: 11pt;">Hi Barbara,</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125); font-family: Calibri , sans-serif; font-size: 11pt;"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125); font-family: Calibri , sans-serif; font-size: 11pt;">Your code actually looks fine to me. Some things that I could think of:</span></p>
<p class="MsoListParagraph" style="margin-left: 18pt;"><span style="color: rgb(31, 73, 125); font-family: Calibri , sans-serif; font-size: 11pt;"> </span></p>
<p class="MsoListParagraph" style="text-indent: -18pt; margin-left: 18pt;"><span style="color: rgb(31, 73, 125); font-family: Calibri , sans-serif; font-size: 11pt;"><span>1.<span style="font: 7pt/normal "Times New Roman"; font-size-adjust: none; font-stretch: normal;"> </span></span></span><span style="color: rgb(31, 73, 125); font-family: Calibri , sans-serif; font-size: 11pt;">Did you specify cfg.coordinates=’mni’ before applying ft_volumenormalise?</span></p>
<p class="MsoListParagraph" style="margin-left: 18pt;"><span style="color: rgb(31, 73, 125); font-family: Calibri , sans-serif; font-size: 11pt;"> </span></p>
<p class="MsoListParagraph" style="text-indent: -18pt; margin-left: 18pt;"><span style="color: rgb(31, 73, 125); font-family: Calibri , sans-serif; font-size: 11pt;"><span>2.<span style="font: 7pt/normal "Times New Roman"; font-size-adjust: none; font-stretch: normal;"> </span></span></span><span style="color: rgb(31, 73, 125); font-family: Calibri , sans-serif; font-size: 11pt;">Did you select the right volumes for plotting? So</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125); font-family: Calibri , sans-serif; font-size: 11pt;"> </span></p>
<p class="MsoListParagraph" style="text-indent: -18pt; margin-left: 54pt;"><span style="color: rgb(31, 73, 125); font-family: Calibri , sans-serif; font-size: 11pt;"><span>a.<span style="font: 7pt/normal "Times New Roman"; font-size-adjust: none; font-stretch: normal;"> </span></span></span><span style="color: rgb(31, 73, 125); font-family: Calibri , sans-serif; font-size: 11pt;"> For CTF head space: </span></p>
<p class="MsoNormal" style="margin-left: 36pt;"><span style="color: rgb(31, 73, 125); font-family: Calibri , sans-serif; font-size: 11pt;"> % make a figure of the single subject headmodel</span></p>
<p class="MsoNormal" style="margin-left: 36pt;"><span style="color: rgb(31, 73, 125); font-family: Calibri , sans-serif; font-size: 11pt;"> cfg=[];</span></p>
<p class="MsoNormal" style="margin-left: 36pt;"><span style="color: rgb(31, 73, 125); font-family: Calibri , sans-serif; font-size: 11pt;"> cfg.location=ctfpos(i,:);</span></p>
<p class="MsoNormal" style="margin-left: 36pt;"><span style="color: rgb(31, 73, 125); font-family: Calibri , sans-serif; font-size: 11pt;"> cfg.locationcoordinates='head';</span></p>
<p class="MsoNormal" style="margin-left: 36pt;"><span style="color: rgb(31, 73, 125); font-family: Calibri , sans-serif; font-size: 11pt;"> ft_sourceplot(cfg,mri_realign)</span></p>
<p class="MsoNormal" style="margin-left: 36pt;"><span style="color: rgb(31, 73, 125); font-family: Calibri , sans-serif; font-size: 11pt;"> </span></p>
<p class="MsoListParagraph" style="text-indent: -18pt; margin-left: 54pt;"><span style="color: rgb(31, 73, 125); font-family: Calibri , sans-serif; font-size: 11pt;"><span>b.<span style="font: 7pt/normal "Times New Roman"; font-size-adjust: none; font-stretch: normal;"> </span></span></span><span style="color: rgb(31, 73, 125); font-family: Calibri , sans-serif; font-size: 11pt;">And for MNI-space:</span></p>
<p class="MsoNormal" style="text-indent: 18pt; margin-left: 36pt;"><span style="color: rgb(31, 73, 125); font-family: Calibri , sans-serif; font-size: 11pt;">cfg=[];</span></p>
<p class="MsoNormal" style="text-indent: 18pt; margin-left: 36pt;"><span style="color: rgb(31, 73, 125); font-family: Calibri , sans-serif; font-size: 11pt;">cfg.location=targets(i,:);</span></p>
<p class="MsoNormal" style="text-indent: 18pt; margin-left: 36pt;"><span style="color: rgb(31, 73, 125); font-family: Calibri , sans-serif; font-size: 11pt;">cfg.locationcoordinates='head';</span></p>
<p class="MsoNormal" style="text-indent: 18pt; margin-left: 36pt;"><span style="color: rgb(31, 73, 125); font-family: Calibri , sans-serif; font-size: 11pt;">ft_sourceplot(cfg,mri_realign_mni)</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125); font-family: Calibri , sans-serif; font-size: 11pt;"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125); font-family: Calibri , sans-serif; font-size: 11pt;">This should lead to the same anatomical locations.</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125); font-family: Calibri , sans-serif; font-size: 11pt;"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125); font-family: Calibri , sans-serif; font-size: 11pt;">Hope this helps!</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125); font-family: Calibri , sans-serif; font-size: 11pt;"> </span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125); font-family: Calibri , sans-serif; font-size: 11pt;">Stan</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125); font-family: Calibri , sans-serif; font-size: 11pt;"> </span></p>
<div>
<div style="border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) currentColor currentColor; padding: 3pt 0cm 0cm;">
<p class="MsoNormal"><b><span style="font-family: Tahoma , sans-serif; font-size: 10pt;">From:</span></b><span style="font-family: Tahoma , sans-serif; font-size: 10pt;"> fieldtrip-bounces@science.ru.nl [mailto:fieldtrip-bounces@science.ru.nl] <b>On Behalf Of </b>Barbara Haendel<br/>
<b>Sent:</b> vrijdag 15 mei 2015 10:27<br/>
<b>To:</b> fieldtrip@science.ru.nl<br/>
<b>Subject:</b> [FieldTrip] leadfields MNI-coordinates</span></p>
</div>
</div>
<p class="MsoNormal"> </p>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-family: Verdana , sans-serif; font-size: 9pt;">Hi there,</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: Verdana , sans-serif; font-size: 9pt;">I found this very nice thread on warping between spm and ctf space (thanks Jan-Mathijs and Stan) and at first sight it seems to work fine (numbers match after applying warping back and forth) but when I try to navigate to the spot in the plotted figure the point of interest seems not to be the same.</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: Verdana , sans-serif; font-size: 9pt;"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: Verdana , sans-serif; font-size: 9pt;">mri_realign_mni=ft_volumenormalise([],mri_realign)</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: Verdana , sans-serif; font-size: 9pt;">% Inverse warping</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: Verdana , sans-serif; font-size: 9pt;">mnipos=[-48 -75 8]; % [46 -78 6]; MT</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: Verdana , sans-serif; font-size: 9pt;">posback=ft_warp_apply(mri_realign_mni.params,mnipos,'sn2individual')</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: Verdana , sans-serif; font-size: 9pt;">ctfpos= ft_warp_apply(pinv(mri_realign_mni.initial),posback)</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: Verdana , sans-serif; font-size: 9pt;"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: Verdana , sans-serif; font-size: 9pt;"> -8.6110 55.6190 50.0473</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: Verdana , sans-serif; font-size: 9pt;"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: Verdana , sans-serif; font-size: 9pt;">I plotted either (see .jpg)</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: Verdana , sans-serif; font-size: 9pt;"> </span></p>
</div>
<p class="MsoNormal" style="text-indent: -18pt; margin-left: 36pt;"><span style="font-family: Verdana , sans-serif; font-size: 9pt;"><span>A.<span style="font: 7pt/normal "Times New Roman"; font-size-adjust: none; font-stretch: normal;"> </span></span></span><span style="font-family: Verdana , sans-serif; font-size: 9pt;">the source (source = ft_sourceanalysis(cfg, freq));</span></p>
<p class="MsoNormal" style="text-indent: -18pt; margin-left: 36pt;"><span style="font-family: Verdana , sans-serif; font-size: 9pt;"><span>B.<span style="font: 7pt/normal "Times New Roman"; font-size-adjust: none; font-stretch: normal;"> </span></span></span><span style="font-family: Verdana , sans-serif; font-size: 9pt;">the interpolated source (sourceInt = ft_sourceinterpolate(cfg, source , mri_realign);</span></p>
<p class="MsoNormal" style="text-indent: -18pt; margin-left: 36pt;"><span style="font-family: Verdana , sans-serif; font-size: 9pt;"><span>C.<span style="font: 7pt/normal "Times New Roman"; font-size-adjust: none; font-stretch: normal;"> </span></span></span><span style="font-family: Verdana , sans-serif; font-size: 9pt;">the normalized source (sourceIntNorm = ft_volumenormalise(cfg, sourceInt);</span></p>
<div>
<p class="MsoNormal"><span style="font-family: Verdana , sans-serif; font-size: 9pt;"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: Verdana , sans-serif; font-size: 9pt;">and manually navigated to the respective coordinates. While for the normalized source the location makes sense (area MT) the location for A and B seems different.</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: Verdana , sans-serif; font-size: 9pt;"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: Verdana , sans-serif; font-size: 9pt;">Is there any obvious mistake I’m overlooking?</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: Verdana , sans-serif; font-size: 9pt;"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: Verdana , sans-serif; font-size: 9pt;">Thanks a lot!</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: Verdana , sans-serif; font-size: 9pt;">Barbara</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: Verdana , sans-serif; font-size: 9pt;"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: Verdana , sans-serif; font-size: 9pt;"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family: Verdana , sans-serif; font-size: 9pt;"> </span></p>
</div>
</div>
</div>
</div>
_______________________________________________ fieldtrip mailing list fieldtrip@donders.ru.nl <a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></div>
</div>
</div>
</div>
</div></div></body></html>