Go to atlas location

Dear Colleagues,

Hi. I have a problem with the “Go to atlas location” AFNI feature. Please correct any statements that are misunderstandings along the way.

At first, I had no environment variables set. I would use
as my underlay and
as my overlay. Fun. Great. If I wanted to use “Go to atlas location,” I could use the default TT_Daemon to roughly go somewhere, and it worked.

I then learned that
is sort of depreciated. Logical because it is not listed anywhere in this
file. I should instead use this
dataset. I say sort of because the macrolabels are the same (Re: Atlas TT N27 EZ ML in AFNI directory). My first problem was I still needed to use the depreciated file because the macrolabels would not appear in AFNI when clicking on the region. This
(base) picchionid@raid ~> 3dinfo -labeltable /misc/prog/afni/current.x86_64/TT_caez_ml_18+tlrc.HEAD
is consistent with that potential problem.

I then added
to my .afnirc file because in
CA_N27_ML is the atlas name for that dataset. Now I use
as the overlay. This solved the problem where macrolabels would not appear in AFNI when clicking on the region. However, when I now try to use “Go to atlas location,” all the coordinates are 0, 0, 0 as show in the attached screenshot. What happened?



That atlas is missing the center locations (see 3dinfo -atlas_points). I can add them with the following script. Try out the resulting dataset with the script and setting AFNI_ATLAS_COLORS to this “session atlas” for now ( setenv AFNI_ATLAS_COLORS TT_caez_ml_1.8 ). If it looks alright, I can update the standard distribution version. The atlas making script uses 3dCM to compute centers. Here it’s using the internal center, the voxel location inside the region that is closest to the center of mass.

mkdir tempml18_update
cd tempml18_update

copy the old atlas

3dcopy ~/abin/TT_caez_ml_18+tlrc. TT_caez_ml_18_relabel.nii.gz

get the labels by themselves

3dinfo -atlas_points ~/abin/TT_caez_ml_18+tlrc. | grep “STRUCT=” | awk -F= ‘{print $2}’ > mllabelsonly.txt

rm ml_index_label.txt

get the index for that label

set nl = wc -l mllabelsonly.txt
foreach labeli (count 1 $nl[1])
set label = head -$labeli mllabelsonly.txt|tail -1
set index = 3dinfo -atlas_points ~/abin/TT_caez_ml_18+tlrc. | grep -A 1 "$label" | grep VAL= | awk -F= '{print $2}' | tr -d \"

replace the spaces with underscores

set label = echo $label| tr " " "_"
echo $index $label >> ml_index_label.txt

make atlas

@Atlasize -lab_file ml_index_label.txt 1 0 -lab_file_delim "
-atlas_type S -atlas_name TT_caez_ml_1.8
-atlas_description “Updated Eickhoff-Zilles Macrolabel atlas”
-dset TT_caez_ml_18_relabel.nii.gz -centers -centertype Icent -skip_novoxels

try out the atlas in AFNI

setenv AFNI_ATLAS_COLORS TT_caez_ml_1.8
afni -D AFNI_ATLAS_COLORS=TT_caez_ml_1.8

1 Like


Hi. This looks very alright to me. Thanks, friend.



You’re very welcome, of course. Thanks for noticing this and letting me know this worked out.

1 Like

I’ve updated the various versions of this atlas - TT, MNI and MNIa versions of the macrolabel atlas.

1 Like