3dClusterize and regions indentified in the clusters

AFNI version info (afni -ver): AFNI_24.0.17

Hi! I'm using 3dClusterize to create clusters from t-maps, resulting in a map that includes the clusters and a summary of these clusters dumped into a text file.

Is there a way to obtain information (in a text file) about the anatomical location of these clusters using an atlas as a reference? For example, the first cluster identified by 3dClusterize is approximately 5000 voxels in size. Is it possible to output a list of the regions covered by this significant cluster into a text file?



Hi, Nicola-

Suuuuure, we can help with that. In fact, this applies really nicely with a better way to report cluster results, as we recommended in this section of "Highlight, Don't Hide...". Very happy to see interest in this, grazie!

I have shared the script used to make Table 2 in this post, starting with "To make the table in the above Highlight paper". Hmm, looking at this perhaps this is something I should formalize more nicely, so users don't have to edit the script... let me know how it goes, but I work on that if I get some time in the near future.

And actually you can use @chauffeur_afni to both do this and make the cluster table for you if you use the options described here, using -clusterize ... and -clusterize_wami ....


1 Like

Thanks for the useful links and references Paul!

I ended up using @chauffeur_afni, since I've used "driving AFNI" in the past and I've found a certain degree of overlap between these functions.

One last (and related) question: How do I get the labels corresponding to every region included in an atlas?
I 3dcopy MNI_caez_ml_18_relabel.nii.gz into a text file and got the numbers corresponding to the regions (0, 1...116), but how do I get the labels corresponding to these numbers? In the attached example, I see that region 31 is the Left_Anterior_Cingulate_C. How do I get the full list out of it?


Hi, Nicola-

I will write back shortly about command that still might make your life easier.

About getting the numbers+associated labels, that file has a labeltable attached, so you can do:

3dinfo -labeltable MNIa_caez_ml_18_relabel.nii.gz

to see the relational output. With some additional shell fanciness, you can remove the quotes around the numbers/labels, skip the first few lines of header info and the last one of non-label info via:

3dinfo -labeltable MNIa_caez_ml_18_relabel.nii.gz \
    | tr -d '"' | tail -n +4 | head -n -1


1 Like

Hi, Nicola-

Just to note, we have just added a new program called gen_cluster_table that will be useful for you. It will be available in the next build (so afni -vnum >= AFNI_24.1.01), but you can also get it now if you would like it. You would have to download 2 scripts (gen_cluster_table and adjunct_atlas_points_to_labeltable), put those into your AFNI binary directory (for default installations, into ~/abin/), and change the permissions to be executable (chmod 755 ... each file). After that, you could run something like this to make the table:

gen_cluster_table                           \
    -input_map   DSET_CLUST                 \
    -input_atlas DSET_ATLAS                 \
    -prefix      table_cluster_olap.txt