Map coordinates to atlas


I’m using get_clusters_table function from nilearn. I outputs cluster coordinates in xyz. Do you know any python packages/functions that can take this coordinates and output a corresponding atlas label (e.g. Talairach Brodmann areas)?
I saw that one can do it in MRIcro manually, but I would really like to find a more automatizw solution.


1 Like

If anybody would look for the answer.
I found several packages that can do it:

  1. matlab mni2atlas GitHub - dmascali/mni2atlas: FSL Anatomical Labels for MNI Vector/ROI
  2. matlab atlas_labeler GitHub - tcama/atlas_labeler: This tool takes in MNI coordinate files and outputs atlas labels. It was originally design for localizing electrode contacts in epilepsy patients.
  3. GitHub - ezPsycho/brainSpy-cli: A CLI client for brainSpy database.
  4. R label4MRI GitHub - yunshiuan/label4MRI: Label the brain MNI coordinate by AAL/BA system

I personally decided to use the last option in Python via rpy2

1 Like

An alternative approach that may interest you is to create z-maps (stat images) rather than cluster tables, and then use atlasreader to obtain coordinates + atlas labels.

1 Like

AFNI has whereami in the GUI and on the command line for this purpose. You can feed it tables of coordinates for a particular template space and for atlas or multiple atlases. See video link below.

whereami -coord_file xx.1D -space MNI -atlas MNI_Glasser_HCP_v1.0

1 Like

you can simply transform coordinates to voxel indices by multiplying the coordinates by the inverse affine, and then index the atlas image with the result