Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AAL3 Atlas #8

Open
MatthieuJoulot opened this issue Aug 3, 2021 · 17 comments
Open

AAL3 Atlas #8

MatthieuJoulot opened this issue Aug 3, 2021 · 17 comments

Comments

@MatthieuJoulot
Copy link

Hi @faskowit.
The tool you have made is quite impressive.
I would like to work with FreeSurfer and with the AAL3 atlas (https://www.gin.cnrs.fr/fr/outils/aal/). I was wondering if you had planned on adding this atlas to the list of atlas that you already have converted to be used with FreeSurfer ?
If not, can you tell me how to convert it ? I don't fully understand how you converted the other atlases. Since you have converted AAL and that the data is organised the same way, the method should be the same ?
I'd really any help you can provide.
Have a good day !

@faskowit
Copy link
Owner

faskowit commented Aug 3, 2021

Hi @MatthieuJoulot

Thanks for your interest in the maTT app! At the current moment, I don't have time / plans to add the AAL3 parcellation. The AAL that is part of this package I actually didn't convert to surface space myself -- it was part of a previous project actually. To get the AAL3 in surface space (which is needed for maTT), I'd recommend this fantastic tool from the Yeo lab: Wu2017_RegistrationFusion. After that projection to fsaverage space, you need to write out a FreeSurfer .annot file for the left and right hemispheres of the AAL3 surface. After that, you could just make a new directory in the atlas_data directory for AAL3 and follow the file naming patter that is used for the other atlases. And then you'd be able to run the maTT1 workflow. Running the maTT2 workflow would involve a number of other steps...so at this stage, I wouldn't suggest it. Also of note -- the way maTT is written... it would not be useful for the subcortical nodes of the AAL3 atlas. For subcortical nodes, the FreeSurfer anatomical segmentation is used.

Cheers,
Josh

@MatthieuJoulot
Copy link
Author

Thanks for your reply !

If I understand right, in atlas_data the directory AAL3 should have in it:

  • 2 .nii.gz files, one for each hemisphere, obtained by processing the initial AAl3 atlas in .nii format
  • 2 .annot files, one for each hemisphere, that I have to write manually, in which there should be the names of the different segmented zones of the atlas. And where do I get the names of theses zones ? Looking at the .annot file from AAL, I cannot match them to the data downloaded.
    And from the data in this folder, I can run maTT1 to obtain the .gcs files.
    Did I get it right ?

And about the subcortical nodes: do you mean I would need to use, the FreeSurfer anatomical segmentation afterwards, or that I would not need to do anything after running maTT1 since FreeSurfer takes care of the subcortical nodes in its workflows anyway ?

@faskowit
Copy link
Owner

faskowit commented Aug 4, 2021

Actually, to run maTT1, all you need is the lh and rh .annot files. That's it -- the colortable and the LUT should be generated by the maTT1 scripts. Yes, when you use the Yeo lab tool, it will give you the label number of the AAL3 projected onto each of the vertices of the fsaverage surface (I think there are like >130k verticies). Then it would be up to you to use the FreeSurfer matlab function, write_annotation.m to write the label numbers to annotation files for the left and right hemispheres. The tricky part of the write_annotation.m process is making sure you provide a good colortable and region names that correspond to the AAL3 regions. The way I learned about this formatting was to use FreeSurfer's read_annotation.m to read in an already valid .annot file, and learn from that. When you are populating the colortable, you also might want to use the AAL3 colors provided by the authors.

The maTT1 process will give you an *rmap.nii.gz volume for each subject... it will not make .gcs files though. Making a gcs files is a more involved process that requires having the Mindboggle 101 subjects run through FreeSurfer and stuff.

Regarding the subcortical regions... I see that the AAL3 has subcorical regions in it. The .annot files that maTT is based on only cover the cortex. To obtain subcortical regions, I have scripted it as such that 14 subcortical regions from FreeSurfer's aseg are used automaticaly. Therefore, the subcortical regions from AAL3 will not be reproduced using these maTT tools -- instead, there will be FreeSurfer's subcortical regions.

@MatthieuJoulot
Copy link
Author

Okay ! That's clear for the .annot files !

However, I am confused about the generation of the .gcs. From what I understand of your last message, I cannot generate them through this process, and I do need them to have a 'complete' FreeSurfer version of the atlas, and be able to work with it. Is that right ?

Understood for the cortical regions, thanks for the indication, I will be mindful of this !

@faskowit
Copy link
Owner

faskowit commented Aug 5, 2021

To generate gcs files in the manner that I did previously for the atlases present here, you'll need need to go through many extra steps (like running the Mindboggle 101 through recon-all). However, gcs files are not necessarily needed for the end goal of fitting the AAL3 parcellation to individual subjects. The maTT1 workflow will work with just the left and right hemisphere annot files in fsaverage space. It is only the maTT2 workflow that needs the gcs files. But the results of maTT1 looks pretty similar to maTT2 (just my observation), however the maTT1 takes longer to run for each subject.

@MatthieuJoulot
Copy link
Author

Hi ! Sorry for the lack of answer, I was away.
What I want is to get the .gcs files, that way I could use the atlas easily with FreeSurfer, in our pipelines. Could you please describe the whole process of making those or link me a page that describes the process ?

@faskowit
Copy link
Owner

faskowit commented Sep 8, 2021

Hi! Ahh ya, the .gcs processes is a bit more involved. To learn how to do this, I recommend reading these pages: cortical parcellation, and then mris_ca_train is the acutal function you use, and then checkout the example script I have here: example script. You'll need to run recon-all on all the training subjects you intend to use. A couple of major notes about .gcs file creation: you will be making a spatial atlas based on FreeSurfer's mapping of the cortex, rather that optimizing the function that was used to create the initial version of any atlas (this applies to all the atlases used in maTT). Also, the original FreeSurfer atlases are trained on manually inspected individual surface-level data. These input annot files are assumed to be "corrected" before submission to the training function. In maTT, I did not do this, and instead did a light QC to make sure the subjects in general looked good. I just wanted to be clear about the original FreeSurfer intentions for this function use, as opposed to how I used it.

@MatthieuJoulot
Copy link
Author

Okay !
So, to be sure I fully understand: I need to use mris_ca_train the same way you did in your script and that will generate the .gcs.
To use this function, I need to have:

  • a colortab file, which I should have downloaded with the original version of the atlas.
  • a sphere.reg that was generated for each subject when running recon-all.
  • an annotation file, which it seems you generate using maTT_labelTrnsfr.sh to generate those, in your example script. Or are you using the method you were mentioning further above ?
  • a subject list(which has been through recon-all).

Is this right ?

@faskowit
Copy link
Owner

faskowit commented Sep 9, 2021

yes that sounds correct to me! I used ~100 training subjects... but I think you can do ~30 and be fine. You might have to mess with the colortable a little bit, if the colors are in the right FreeSurfer format, or if you want to get rid of the 'background' parcel. Up to you!

@MatthieuJoulot
Copy link
Author

Okay !
And for the annotation files that are needed ? did you use the script maTT_labelTrnsfr.sh or did you use the method you were mentioning above, as in "use write_annotation.m"
And thanks for the tip, it will be faster with 30 training subjects to start with !

@faskowit
Copy link
Owner

faskowit commented Sep 9, 2021

ya, you need to use the maTT_labelTrnsfr.sh to render an .annot file in each subject space. And this is the part of the process that is relevant to what I warned about previously, about how this fitting method probably won't be optimizing the same objective function as the original atlas intended. This is particularly true for functional atlases (like the Yeo, or Schaefer), which were fit using functional data, but here, we create a .gcs file using the anatomical fits from FreeSurfer's spherical registration. I'm not 100% if AAL3 considers any functional data or not. But even so, if I understand correctly, usually AAL is fit with SPM/dartell... so this would be a different process.

@faskowit
Copy link
Owner

faskowit commented Sep 9, 2021

Ahhh but you know what I realized... does AAL3 even have an .annot file in FreeSurfer average space available? You'll need that, as input to the label transfer script

@MatthieuJoulot
Copy link
Author

Nope ! AAL3 does not have any .annot file in FreeSurfer average space available. That's why I was confused, since the maTT_labelTrnsfr.sh seems to have an .annot file as an input. So I guess I can't use this script ?
And if not, how can I make this '.annot' file ?

@faskowit
Copy link
Owner

faskowit commented Sep 9, 2021

well... this is the problem. AAL3 appears to be a 'volumetric' atlas... but all the maTT tools are focused on surface data. So you'll have to get creative. I have somewhat of a solution/suggestion: Get the AAL3 in MNI space. Then use this toolbox: CBIG registration fusion to get the data in fsaverage space. Then you'll have to write you own fsaverage .annot files for AAL3 based on this data. This would be an 'unofficial' AAL3 in fsaverage space... I think it would be good, but hard to say how it would compare with the original AAL3

@MatthieuJoulot
Copy link
Author

Okay, so after I registered AAL3 with MNI space, I can convert it to surface so to say. That's about clear.
What I'm not clear on, is when you say "write your own fsaverage .annot files for AAL3 based on this data." What I'm not clear on, is the how ,to be specific. Do I need to use a function to write it manually using the data obtained from the data in fsaverage space, or do I need to use a function to generate it from the data in fsaverage space ? And what functions am I to use ? The ones you were mentioning before, as in write_annotation.m and read_annotation.m ?

@faskowit
Copy link
Owner

faskowit commented Sep 9, 2021

yes indeed, you'll need to use the matlab function write_annotation.m to write the lh and rh annot files to the disk.

@MatthieuJoulot
Copy link
Author

Okay ! Thank you for all the help you've provided !
I would like to know, can we redistribute as part of Clinica all the atlas that are linked here: https://doi.org/10.6084/m9.figshare.5998583 ?
We would be happy to credit your work, is there any publication linked to it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants