Importing merged Desikan Killiany using MATLAB script

HI @a13,

Keep in mind that this modified Desikan-Killiany atlas is only valid for the save surface that contain the original Desikan-Killiany that was merged.

The process (copying, modifying the DK atlas and adding the modified-DK atlas) depends on the anatomy that is used for each of the Subjects in the Protocol.

  1. For Subjects using the Default Anatomy: the process only needs to be done for the Default-Anatomy Cortex.

  2. For Subjects not using the Default Anatomy, the process needs to be done for each of the Subjects, as their DK atlases are not the same vertex by vertex.

The simplest way would do to modify directly the Atlases for the Subject's Cortex:

  1. Load the surface for that
  2. Get the Desikan-Killiany atlas
  3. Modify (merge) it
  4. Add the modified atlas to the surface strucutre
  5. Save surface file
SubjectName = 'Subject01';
AtlasName   = 'Desikan-Killiany';

% Get subject definition
sSubject = bst_get('Subject', SubjectName);
% Get default cortex file
CortexFile = sSubject.Surface(sSubject.iCortex).FileName;
% 1. Load cortex file
sCortex = in_tess_bst(CortexFile);
% 2. Get DK Atlas
iAtlas = find(strcmp(AtlasName, {sCortex.Atlas.Name}));
sAtlas =  sCortex.Atlas(iAtlas);
% 3. Modify Atlas, change Name and keep only first Scout
sAtlasMod = sAtlas;
sAtlasMod.Name   = ['Modified ' sAtlasMod.Name];
sAtlasMod.Scouts = sAtlasMod.Scouts(1);
% 4. Add modified Atlas
sCortex.Atlas(end + 1) = sAtlasMod;
% Save cortex file
bst_save(file_fullpath(CortexFile), sCortex, 'v7');

More info on the Atlas and Scout structures:
https://neuroimage.usc.edu/brainstorm/Tutorials/Scouts#On_the_hard_drive

Best,
Raymundo