<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
span.E-mailStlus17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-GB link="#0563C1" vlink="#954F72" style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal>Dear FieldTrippers,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I came across an issue when atlasing the source-level measures and the sourcemodel was estimated using FreeSurfer cortical sheet.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The typical code to read the corresponding FreeSurfer annotation uses <i>ft_read_atlas</i>:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><i> atlaslh = ft_read_atlas({‘label/lh.aparc.DKTatlas’,’surf/lh.pial’ },'format','freesurfer_aparc');<o:p></o:p></i></p><p class=MsoNormal><i> atlasrh = ft_read_atlas({‘label/rh.aparc.DKTatlas’,’surf/rh.pial’ },'format','freesurfer_aparc');<o:p></o:p></i></p><p class=MsoNormal><i> sourceatlas = rmfield(atlaslh,'rgba');<o:p></o:p></i></p><p class=MsoNormal><i> sourceatlas.pos = vertcat(atlaslh.pos, atlasrh.pos);<o:p></o:p></i></p><p class=MsoNormal><i> sourceatlas.tri = vertcat(atlaslh.tri, atlasrh.tri+size(atlaslh.pos,1));<o:p></o:p></i></p><p class=MsoNormal><i> sourceatlas.aparclabel = vertcat(spm_file(atlaslh.aparclabel,'prefix','lh_'),spm_file(atlaslh.aparclabel,'prefix','rh_'));<o:p></o:p></i></p><p class=MsoNormal><i> sourceatlas.aparc = vertcat(atlaslh.aparc, atlasrh.aparc+numel(atlaslh.aparclabel));<o:p></o:p></i></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The issue, however, is that the positions do not correspond to those of the sourcemodel. It is not a FieldTrip issue, but a more generic one. E.g. FSL: <a href="https://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=fsl;19c45d5b.1803">JISCMail - FSL Archives</a>. FSL solves the issue by asking for a reference image (typically a volume from the same FreeSurfer processing). Based on the FSL codes for <a href="https://open.win.ox.ac.uk/pages/fsl/fsleyes/fsleyes/apidoc/_modules/fsleyes/displaycontext/meshopts.html">fsleyes</a> and <a href="https://git.fmrib.ox.ac.uk/fsl/fslpy/-/blob/master/fsl/data/mghimage.py">fsl.data.mghimage</a>, I managed to implement something similar in MATLAB:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><i> fsmri = MRIread(‘mri/T1.mgz’);<o:p></o:p></i></p><p class=MsoNormal><i> sourceatlas = ft_transform_geometry(fsmri.vox2ras/fsmri.tkrvox2ras, sourceatlas);<o:p></o:p></i></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>After transformation, the sourceatlas will be aligned to the sourcemodel.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Kind regards,<o:p></o:p></p><p class=MsoNormal><span style='mso-fareast-language:EN-GB'>Tibor </span><span lang=HU style='mso-fareast-language:EN-GB'><o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-GB'> </span><span lang=HU style='mso-fareast-language:EN-GB'><o:p></o:p></span></p><p class=MsoNormal><b><span style='color:#222A35;mso-fareast-language:EN-GB'>Auer, Tibor M.D. Ph.D.</span></b><span lang=HU style='mso-fareast-language:EN-GB'><o:p></o:p></span></p><p class=MsoNormal><b><span style='color:#0066FF;mso-fareast-language:EN-GB'>Research Fellow</span></b><span lang=HU style='mso-fareast-language:EN-GB'><o:p></o:p></span></p><p class=MsoNormal><b><span style='color:#0066FF;mso-fareast-language:EN-GB'>School of Psychology, Faculty of Health and Medical Sciences</span></b><span lang=HU style='mso-fareast-language:EN-GB'><o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-GB'>University of Surrey, Guildford GU2 7XH</span><span lang=HU style='mso-fareast-language:EN-GB'><o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-GB'><a href="mailto:T.Auer@surrey.ac.uk"><span style='color:#0563C1'>T.Auer@surrey.ac.uk</span></a></span><span lang=HU style='mso-fareast-language:EN-GB'><o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-GB'><a href="https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2FTiborAuer&data=04%7C01%7Ct.auer%40surrey.ac.uk%7C5f32dba325f5422f5c5a08d8becc029f%7C6b902693107440aa9e21d89446a2ebb5%7C0%7C0%7C637469131016806177%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=wkpejqTmmo%2Fe4JA9QIaA6Z3%2BzipbFY%2FCEmRXC9UvKJs%3D&reserved=0"><span style='color:#0563C1'>@TiborAuer</span></a></span><span lang=HU style='mso-fareast-language:EN-GB'><o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>