[FieldTrip] Combining left/right hemisphere atlases from Freesurfer output

Schoffelen, J.M. (Jan Mathijs) janmathijs.schoffelen at donders.ru.nl
Tue Feb 27 10:18:11 CET 2024


Hi Michael,

You’d need to adjust the vertex indices as specified in the hemisphere specific triangulations (in fieldtrip this is the ’tri’ field, in generic matlab these are the so-called ‘faces’ of a mesh).

if you do cat(1, atlas.tri, atlas_right.tri), the numbers in the second part of this resulting matrix (running from 1:N2, where N2 is the number of rows in atlas_right.pos), should point to the (N1+1):(N1+N2) rows in atlas.pos (where N1 is the number of rows in atlas_left.pos). Currently, the numbers range from 1:N2, which points to a bunch of left-hemispheric points.

Solution: atlas.tri = cat(1,atlas.tri, atlas_right.tri+size(atlas_left.pos,1));

Good luck and best wishes,
Jan-Mathijs

PS: I would recommend to update your fieldtrip version to a more recent one. At some point addressing questions inspired by behavior of 5-year old code might not be worth our while.



On 26 Feb 2024, at 21:17, Michael Houston via fieldtrip <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>> wrote:

Hello,

I ran the ft_readatlas function on a surface based atlas as follows for later parcellation:

atlas_left = ft_read_atlas({'lh.aparc.DKTatlas.annot','lh.white'}, 'format', 'freesurfer_aparc');
atlas_right = ft_read_atlas({'rh.aparc.DKTatlas.annot','rh.white'}, 'format', 'freesurfer_aparc');
atlas_right.aparc = atlas_right.aparc + 36;

atlas = atlas_left;
atlas.pos = cat(1,atlas.pos,atlas_right.pos);
atlas.tri = cat(1,atlas.tri,atlas_right.tri);
atlas.aparc = cat(1,atlas.aparc,atlas_right.aparc);
atlas.aparclabel = cat(1,atlas.aparclabel,atlas_right.aparclabel);
atlas.rgba = cat(1,atlas.rgba,atlas_right.rgba);
save('dkt_test','atlas')

I combined both outputs together to visualize both parcellated hemispheres in the same plot, but what I end up with is a messy superimposition of both hemispheres within each other. What is the more appropriate way to go about merging both left/right atlases together into one? I could not find a Fieldtrip function that does so (I am running the 2019 version).

Thanks,
Michael
--
mjhouston2 at uh.edu<mailto:mjhouston2 at uh.edu>
MSBE '20, University of Houston
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Ca80379fd8041435ca42e08dc377504e9%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638446222941750902%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=I8nAYI9bdaEPitgcX%2BGlFT6hVlIu6DCvpBTofP7FVbA%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20240227/94a93541/attachment.htm>


More information about the fieldtrip mailing list