Cluster Statistics with ETAC

Hello, AFNI team,

I hope that this message finds you doing well!

I have a quick question related to the appropriate use of ETAC. I was successfully able to run 3dttest++ using ETAC with the below code. I have since tried to use 3dClusterize (as described in this post) to get the statistics related to the clusters, however, the table output does not seem to have thresholds related to the the peak voxel. Is it possible to get this information in the output of 3dClusterize?

Thanks so much for your time and consideration, and I look forward to hearing from you soon!

Warmest Regards,
Katie


3dttest++  -setA setlistA                                    \
             02 $dirA/NAV_002/NAV_002.results/NAV_002.results.incl-instruc.final/stats.NAV_002_REML+tlrc'[1]' \
             05 $dirA/NAV_005/NAV_005.results/NAV_005.results.incl-instruc.final/stats.NAV_005_REML+tlrc'[1]' \
             07 $dirA/NAV_007/NAV_007.results/NAV_007.results.incl-instruc.final/stats.NAV_007_REML+tlrc'[1]' \
             08 $dirA/NAV_008/NAV_008.results/NAV_008.results.incl-instruc.final/stats.NAV_008_REML+tlrc'[1]' \
             09 $dirA/NAV_009/NAV_009.results/NAV_009.results.incl-instruc.final/stats.NAV_009_REML+tlrc'[1]' \
             10 $dirA/NAV_010/NAV_010.results/NAV_010.results.incl-instruc.final/stats.NAV_010_REML+tlrc'[1]' \
             13 $dirA/NAV_013/NAV_013.results/NAV_013.results.incl-instruc.final/stats.NAV_013_REML+tlrc'[1]' \
             17 $dirA/NAV_017/NAV_017.results/NAV_017.results.incl-instruc.final/stats.NAV_017_REML+tlrc'[1]' \
             18 $dirA/NAV_018/NAV_018.results/NAV_018.results.incl-instruc.final/stats.NAV_018_REML+tlrc'[1]' \
             24 $dirA/NAV_024/NAV_024.results/NAV_024.results.incl-instruc.final/stats.NAV_024_REML+tlrc'[1]' \
             28 $dirA/NAV_028/NAV_028.results/NAV_028.results.incl-instruc.final/stats.NAV_028_REML+tlrc'[1]' \
             38 $dirA/NAV_038/NAV_038.results/NAV_038.results.incl-instruc.final/stats.NAV_038_REML+tlrc'[1]' \
             39 $dirA/NAV_039/NAV_039.results/NAV_039.results.incl-instruc.final/stats.NAV_039_REML+tlrc'[1]' \
             40 $dirA/NAV_040/NAV_040.results/NAV_040.results.incl-instruc.final/stats.NAV_040_REML+tlrc'[1]' \
             53 $dirA/NAV_053/NAV_053.results/NAV_053.results.incl-instruc.final/stats.NAV_053_REML+tlrc'[1]' \
             55 $dirA/NAV_055/NAV_055.results/NAV_055.results.incl-instruc.final/stats.NAV_055_REML+tlrc'[1]' \
             56 $dirA/NAV_056/NAV_056.results/NAV_056.results.incl-instruc.final/stats.NAV_056_REML+tlrc'[1]' \
             58 $dirA/NAV_058/NAV_058.results/NAV_058.results.incl-instruc.final/stats.NAV_058_REML+tlrc'[1]' \
             64 $dirA/NAV_064/NAV_064.results/NAV_064.results.incl-instruc.final/stats.NAV_064_REML+tlrc'[1]' \
             65 $dirA/NAV_065/NAV_065.results/NAV_065.results.incl-instruc.final/stats.NAV_065_REML+tlrc'[1]' \
             69 $dirA/NAV_069/NAV_069.results/NAV_069.results.incl-instruc.final/stats.NAV_069_REML+tlrc'[1]' \
             74 $dirA/NAV_074/NAV_074.results/NAV_074.results.incl-instruc.final/stats.NAV_074_REML+tlrc'[1]' \
          -mask $mask_dset                                  \
          -ETAC 16                                          \
          -ETAC_blur 0 3                                  \
          -ETAC_opt NN=2:sid=2:hpow=2:pthr=0.001:name=etac3 \


3dClusterize -ithr 1 -idat 1 -inset TTnew.etac3.ETACmaskALL.global.2sid.5perc_Nwarp.nii \
                     -NN 2 -1sided RIGHT_TAIL 0.5 -clust_nvox 2 \
                     -pref_map ETAC.clust.order.Nwarp_FINAL.nii.gz > ETAC.clust.order.Nwarp_FINAL.1D


Hi, Katie-

This seems like more of a 3dClusterize question, than one about ETAC.

I am not quite sure what “thresholds related to the the peak voxel” means. Can you please describe that?

Note that 3dClusterize’s table has the Max Int column, reporting “Maximum Intensity value for the volume cluster”.

–pt

Hi Paul,

Thank you so much for your rapid response! And yes, perhaps this is a question about properly using 3dClusterize!

I am wondering if there is a way to see statistics associated with the significance of a cluster, i.e., a t-value, after using 3dttest++ with ETAC.

When I run the 3dClusterize script below, I get the following output. Is there something that I am missing in order to have t-values output here as well? Or another way that I can look at t-values for each cluster?

Thank you so much for your help!

Warmest Regards,
Katie


3dClusterize -ithr 1 -idat 1 -inset TTnew.etac3.ETACmaskALL.global.2sid.5perc_Nwarp.nii \
                     -NN 2 -1sided RIGHT_TAIL 0.5 -clust_nvox 2 \
                     -pref_map ETAC.clust.order.Nwarp_FINAL.nii.gz > ETAC.clust.order.Nwarp_FINAL.1D

#
#  Cluster report 
#[ Dataset prefix      = TTnew.etac3.ETACmaskALL.global.2sid.5perc_Nwarp.nii ]
#[ Threshold vol       = [1] 'B3.0:p=0.0010' ]
#[ Supplement dat vol  = [1] 'B3.0:p=0.0010' ]
#[ Option summary      = 1sided,RIGHT_TAIL,0.5,clust_nvox,2,NN2 ]
#[ Threshold value(s)  = right-tail stat=0.500000 ]
#[ Aux. stat. info.    = not a stat! ]
#[ Nvoxel threshold    = 2;  Volume threshold = 6.750 ]
#[ Single voxel volume = 3.375 (microliters) ]
#[ Neighbor type, NN   = 2 ]
#[ Voxel datum type    = float ]
#[ Voxel dimensions    = 1.500 mm X 1.500 mm X 1.500 mm ]
#[ Coordinates Order   = RAI ]
# Mean and SEM based on absolute value of voxel intensities ]
#
#Volume  CM RL  CM AP  CM IS  minRL  maxRL  minAP  maxAP  minIS  maxIS    Mean     SEM    Max Int  MI RL  MI AP  MI IS
#------  -----  -----  -----  -----  -----  -----  -----  -----  -----  -------  -------  -------  -----  -----  -----
   1257   -2.5    4.5   53.9  -26.1    6.9  -12.6   27.9   30.8   71.3        4        0        4   -2.1    2.4   30.8 
   1213   -3.7   62.1   38.6  -20.1   12.9   45.9   77.4   11.3   56.3        4        0        4   -5.1   47.4   11.3 
    846  -40.5   68.4   42.5  -54.6  -29.1   54.9   80.4   27.8   59.3        4        0        4  -45.6   71.4   27.8 
    793  -19.3   90.2   12.1  -35.1   -8.1   77.4   98.4    2.3   24.8        4        0        4  -30.6   90.9    2.3 
    762  -54.8   21.2   33.2  -65.1  -41.1   11.4   33.9   14.3   48.8        4        0        4  -59.1   15.9   14.3 
    667   58.6   23.8   38.2   48.9   65.4    9.9   35.4   27.8   50.3        4        0        4   60.9   35.4   27.8 
    581   36.1   73.0   39.9   26.4   45.9   51.9   83.4   27.8   54.8        4        0        4   42.9   77.4   27.8 
    520   20.3   93.0    7.3    8.4   32.4   83.4  101.4   -2.2   21.8        4        0        4   27.9   92.4   -2.2 
    441  -35.9   29.4   61.3  -45.6  -23.1   15.9   42.9   54.8   69.8        4        0        4  -38.1   36.9   54.8 
    247   16.0   79.5  -21.9    9.9   23.4   69.9   87.9  -29.2  -12.7        4        0        4   11.4   81.9  -29.2 
    213  -22.2   39.7   67.6  -33.6   -9.6   32.4   45.9   59.3   74.3        4        0        4  -24.6   38.4   59.3 
    205   21.5   18.1   72.8   12.9   29.4    6.9   29.4   65.3   77.3        4        0        4   20.4   14.4   65.3 
    180  -33.2   -2.8    9.6  -41.1  -26.1   -9.6    3.9    2.3   15.8        4        0        4  -32.1   -8.1    2.3 
    169  -53.1    0.3   14.8  -59.1  -48.6   -6.6   11.4    6.8   29.3        4        0        4  -57.6   11.4    6.8 
    165   56.2   -4.7   34.5   53.4   59.4  -11.1    2.4   23.3   41.3        4        0        4   56.4  -11.1   23.3 
    155  -33.2   72.5  -35.6  -39.6  -27.6   65.4   78.9  -41.2  -30.7        4        0        4  -32.1   71.4  -41.2 
    155   34.7   70.2  -36.6   26.4   39.9   63.9   75.9  -41.2  -30.7        4        0        4   33.9   66.9  -41.2 
    149   55.1    2.5    9.2   50.4   59.4   -5.1    9.9    3.8   12.8        4        0        4   54.9    0.9    3.8 
    133  -25.3   45.0   -1.7  -29.1  -21.6   36.9   53.4   -8.2    5.3        4        0        4  -26.1   42.9   -8.2 
    127   42.1    8.7    6.1   38.4   47.4    0.9   18.9   -2.2   12.8        4        0        4   42.9    2.4   -2.2 
    114   60.2   26.2   22.9   53.4   65.4   20.4   33.9   18.8   26.3        4        0        4   57.9   33.9   18.8 
    105   31.0   18.5   63.4   20.4   39.9   12.9   24.9   60.8   66.8        4        0        4   24.9   20.4   60.8 
     99  -40.5   12.5   22.2  -45.6  -35.1    8.4   15.9   17.3   27.8        4        0        4  -41.1   15.9   17.3 
     88  -23.1  -24.3  -19.9  -29.1  -17.1  -30.6  -18.6  -21.7  -17.2        4        0        4  -18.6  -21.6  -21.7 
     72   62.6   41.2   -1.7   59.4   66.9   36.9   45.9   -9.7    3.8        4        0        4   62.4   38.4   -9.7 
     70  -43.1    9.1   53.4  -47.1  -38.1    2.4   14.4   48.8   57.8        4        0        4  -45.6    8.4   48.8 
     68   12.7   48.1    7.5    6.9   18.9   39.9   57.9    3.8   12.8        4        0        4   15.9   48.9    3.8 
     59  -45.1    0.5   -4.3  -48.6  -41.1   -6.6    5.4   -6.7   -0.7        4        0        4  -45.6    3.9   -6.7 
     57    2.0  -54.0   20.0   -0.6    3.9  -57.6  -50.1   15.8   24.8        4        0        4    2.4  -51.6   15.8 
     51   41.5   36.4   59.2   38.4   44.4   30.9   41.4   54.8   63.8        4        0        4   42.9   39.9   54.8 
     37  -52.8   -3.7    1.2  -56.1  -50.1   -6.6   -0.6   -3.7    5.3        4        0        4  -50.1   -6.6   -3.7 
      7   -7.3   -3.2   33.5   -8.1   -6.6   -3.6   -2.1   32.3   35.3        4        0        4   -6.6   -3.6   32.3 
      3   -8.6    6.9   39.8   -9.6   -8.1    6.9    6.9   38.3   41.3        4        0        4   -8.1    6.9   38.3 
      3   31.4   27.4   70.3   30.9   32.4   26.4   27.9   69.8   71.3        4        0        4   30.9   27.9   69.8 
      2   33.9   22.6    8.3   33.9   33.9   21.9   23.4    8.3    8.3        4        0        4   33.9   23.4    8.3 
      2  -53.1   -8.1   22.5  -53.1  -53.1   -8.1   -8.1   21.8   23.3        4        0        4  -53.1   -8.1   21.8 
#------  -----  -----  -----  -----  -----  -----  -----  -----  -----  -------  -------  -------  -----  -----  -----
#  9815   -3.3   42.4   31.4                                                  4        0                             

Hi, Katie-

taking a step back:
We often recommend showing beta weights (coefficient values) and using the statistics as a threshold, when appropriate; for example, if you have a t-stat volume, you should have a Coef volume in your statistical output, so you can do this (but the F-stat doesn’t have an accompanying Coef volume for this). Other practices in the field are to show the statistic AND use it to threshold. We feel this misses out important modeling information—details are here:
https://pubmed.ncbi.nlm.nih.gov/27729277/
… and ways to do this in the AFNI GUI are described in this AFNI Academy/Bootcamp video:
https://www.youtube.com/watch?v=VT77zJ0zGnA&list=PL_CD549H9kgqwHr0EDtvAU8hylsOj30OK&index=4

That is why 3dClusterize has both a “-ithr …” and and “-idat …” option: you can input both a data (=Coef) volume, and a stat volume. The stat will be used for thresholding, and you can output a map of the data volume with “-pref_dat …”. The “-pref_map …” volume is a map of the ROIs that survive your thresolding. If you want to see the statistics in each of these locations, you can use the PREF_MAP dset (yours is called “ETAC.clust.order.Nwarp_FINAL.nii.gz”) and the DSET_STAT (yours would be “TTnew.etac3.ETACmaskALL.global.2sid.5perc_Nwarp.nii[1]”, with quotes used in the command here):


3dcalc -a PREF_MAP -b DSET_STAT -expr 'step(a)*b' -prefix DSET_STAT_IN_ROIS

or, in your case here:


3dcalc  \
   -a  ETAC.clust.order.Nwarp_FINAL.nii.gz \
   -b "TTnew.etac3.ETACmaskALL.global.2sid.5perc_Nwarp.nii[1]"  \
    -expr 'step(a)*b'  \
    -prefix SOMETHING.nii

You can take an ROI map and a separate dset and find the mean/stdev/etc. values of that other dset, per ROI, using 3dROIstats. For example,


3dROIstats -mask PREF_MAP DSET_STAT

… would calculate the average value within DSET_STAT for each ROI in PREF_MAP, and report it on the command line. Rr, for your data:


3dROIstats \
    -mask ETAC.clust.order.Nwarp_FINAL.nii.gz \
   "TTnew.etac3.ETACmaskALL.global.2sid.5perc_Nwarp.nii[1]"

(you might want to try adding “-quiet”, too, to remove non-numerical text output.)

Lots of things can be calculated; here are a few from the program help:


-nzmean       Compute the mean using only non_zero voxels.  Implies
                 the opposite for the normal mean computed
  -nzsum        Compute the sum using only non_zero voxels.  
  -nzvoxels     Compute the number of non_zero voxels
  -nzvolume     Compute the volume of non-zero voxels
  -minmax       Compute the min/max of all voxels
  -nzminmax     Compute the min/max of non_zero voxels
  -sigma        Compute the standard deviation of all voxels
  -nzsigma      Compute the standard deviation of all non_zero voxels
  -median       Compute the median of all voxels.
  -nzmedian     Compute the median of non_zero voxels.

Another AFNI Academy video that discusses this (among other ROI tools) is:
https://www.youtube.com/watch?v=0mfTMu8whyg

–pt