Add atlas to default anatomy

hello,
I would like to use brain atlas with higher parcellations,
I found atlas from Schaefer 2018 fit with fsaverage6,
I try to paste this file .annot in the folder label and re import anatomy but it doesn't load them,
I also try to load atlas after import anatomy but i think brainstorm want one whole brain file and the atlas (.annot) is only the hemispheric file (lh or rh).

They also give atlas in MNI space but i think is the problem

Do you have an idea how can i can do ?

thanks a lot,

V.

When using the menu or process "Import anatomy folder", it doesn't load all the atlases, but only the ones that are hardcoded in import_anatomy_fs.m:
https://github.com/brainstorm-tools/brainstorm3/blob/master/toolbox/io/import_anatomy_fs.m#L144

Two solutions:

  1. you load the FreeSurfer folder using the manual method described in the tutorials, and you load your extra .annot file: https://neuroimage.usc.edu/brainstorm/Tutorials/LabelFreeSurfer#Manual_import_of_the_anatomy
  2. you edit this function import_anatomy_fs.m locally to include your own .annot files

Thanks You !
That's work but i have to comment this loop to end the import process,and at the end the atlas are not merge.
in : tess_concatenate.m (ligne 157)
% Add the first letter of the surface comment to the scout name
if ~ismember(oldTess.Atlas(iAtlasOld).Scouts(iScout).Label(end), {'L', 'R'})
oldTess.Atlas(iAtlasOld).Scouts(iScout).Label =[oldTess.Atlas(iAtlasOld).Scouts(iScout).Label, scoutTag];

Indeed, there are probably other things to add here and there...
To be merged in tess_concatenate, the atlases must have the same name.
If you do a manual import, you can rename the atlases. If you edit import_anatomy_fs.m, you may need to add the atlas names for lh and rh in import_label:

Thanks,
I am sorry, I tried both manually and by modifying import_anatomy_fs.m as you suggested and in both case i have the same error :
Array indices must be positive integers or logical values.

Error in tess_concatenate (line 157)
if ~ismember(oldTess.Atlas(iAtlasOld).Scouts(iScout).Label(end), {'L', 'R'})

Error in tree_callbacks>SurfaceConcatenate (line 2979)
NewFile = tess_concatenate(TessFiles);

Error in tree_callbacks>@(h,ev)SurfaceConcatenate(GetAllFilenames(bstNodes)) (line 1056)
gui_component('MenuItem', jPopup, [], 'Merge surfaces', IconLoader.ICON_FUSION, [],
@(h,ev)SurfaceConcatenate(GetAllFilenames(bstNodes)));

thanks,

If you don't manage to do it from the code, try first with the manual import with the interface:
https://neuroimage.usc.edu/brainstorm/Tutorials/LabelFreeSurfer#Manual_import_of_the_anatomy

Hi francois,

I tried manually and also by changing the code,

and in the both case error occur then i try to merge surface,
at this step,
"10. Select lh.pial, rh.pial, right-click > Merge surfaces: Generates a surface cortex_250000V"

the atlas work and load on the surface but there is something during merge that's doesn't work,
Array indices must be positive integers or logical values.

Error in tess_concatenate (line 157)
if ~ismember(oldTess.Atlas(iAtlasOld).Scouts(iScout).Label(end), {'L', 'R'})

I attached you one of the atlas, may be that's come from my file ?

thanks again,

lh.Schaefer2018_300Parcels_7Networks_order.annot (327.4 KB)
rh.Schaefer2018_300Parcels_7Networks_order.annot (327.5 KB)

There is nothing wrong with your atlases, I could load them without any problem on the fsaverage6 brain with the procedure described here:
https://neuroimage.usc.edu/brainstorm/Tutorials/LabelFreeSurfer#Manual_import_of_the_anatomy

I just added a small fix to avoid having to rename the atlases (which is not indicated in the instructions). This caused the two hemispheres of the atlas not to be merged when merging the left+right surfaces. Update Brainstorm to get this fix.
Anatomy: Easier left+right merge of FreeSurfer atlases · brainstorm-tools/brainstorm3@fdefccb · GitHub

Note that this will not fix the error you reported. The previous version of the code was not causing any problem. Therefore there is a problem either with the procedure you use to load this anatomy (refer to the online instructions are ask in case of doubts), or with the surfaces you are trying to import.
Start by reproducing what I did with the fsaverage6 anatomy folder. If it works, you will know the problem comes from your anatomy folder.

Thanks Francois,
I found that's coming from my atlas, when i loaded them, sometimes (i don't know why) the central regions, the black one (around the sub cortical regions) has no label. So in the merge process brainstorm don't like it ! I can do it manually and that's work !
Thanks again,
V.