AFNI Message Board

Dear AFNI users-

We are very pleased to announce that the new AFNI Message Board framework is up! Please join us at:

https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ

History of AFNI updates  

|
October 10, 2018 08:09PM
Hi afni experts,

Our lab is currently trying to implement a cluster-wise correction method using preprocessed and analyses data in SPM8 with a combination of afni's 3dFWHMx & 3dClustSim and I wanted to ensure we are doing this correctly. Our current steps are:


1. We produce the residuals for each individual during estimation of the second level model in SPM12 (all our preprocessing and analyses have been done in SPM8)

2. Generate the smoothing estimates for each individual using 3dFWHM, eg 3dFWHMx -acf -mask mask.nii $subject1

Example output here is:
++ ACF 1D file [radius ACF mixed_model gaussian_NEWmodel] written to 3dFWHMx.1D
++ 1dplot: AFNI version=AFNI_18.2.19 (Sep 27 2018) [64-bit]
++ Authored by: RWC et al.
+ and 1dplot-ed to file 3dFWHMx.1D.png
++ 3dFWHMx: AFNI version=AFNI_18.2.19 (Sep 27 2018) [64-bit]
++ Authored by: The Bob
++ Number of voxels in mask = 282349
** AFNI converts NIFTI_datatype=64 (FLOAT64) in file Res_0009.nii to FLOAT32
Warnings of this type will be muted for this session.
Set AFNI_NIFTI_TYPE_WARN to YES to see them all, NO to see none.
++ start ACF calculations out to radius = 42.13 mm
+ ACF done (0.00 CPU s thus far)
** ERROR: (FAILED) attempt to over-write file 3dFWHMx.1D

I was wondering if at this stage it would be appropriate to replace the second-level generated mask (mask.nii) with a grey matter only or ROI mask and still get accurate smoothing estimates? I did test this out and it seems ok to me but as I'm still getting a handle on the theory of clusterwise thresholding I would appreciate any comments on the accuracy of doing this.For example, this is the output after using a 3477 mask of central executive network ROIs:

3dFWHMx -acf -mask /local/Isabella/marsbar_CCN_ROIs/CCN.nii $i >> ${secondlvl_path}/CCN_residuals/log_$j.txt

Output:
++ ACF 1D file [radius ACF mixed_model gaussian_NEWmodel] written to 3dFWHMx.1D
++ 1dplot: AFNI version=AFNI_18.2.19 (Sep 27 2018) [64-bit]
++ Authored by: RWC et al.
+ and 1dplot-ed to file 3dFWHMx.1D.png
++ 3dFWHMx: AFNI version=AFNI_18.2.19 (Sep 27 2018) [64-bit]
++ Authored by: The Bob
++ Number of voxels in mask = 3477
** AFNI converts NIFTI_datatype=64 (FLOAT64) in file Res_0019.nii to FLOAT32
Warnings of this type will be muted for this session.
Set AFNI_NIFTI_TYPE_WARN to YES to see them all, NO to see none.
++ start ACF calculations out to radius = 35.16 mm
+ ACF done (0.00 CPU s thus far)


3. Next we take the average of all the smoothing estimates for each individual in the second level analysis and use this as input for 3dclustsim, for example:

3dClustSim -mask mask.nii -acf 0.64939 10.17 20.888

And the output for this:

3dClustSim -mask mask.nii -acf 0.64939 10.17 20.884
++ 3dClustSim: AFNI version=AFNI_18.2.19 (Sep 27 2018) [64-bit]
++ Authored by: RW Cox and BD Ward
++ 282349 voxels in mask (31.28% of total)
++ Kernel function radius = 59.81 mm
++ ACF(0.65,10.17,20.88) => FWHM=24.91 => 91x109x91 pads to 160x192x160
+ Kernel image dimensions 43 x 52 x 27
++ Startup clock time = 0.7 s
++ Using 15 OpenMP threads

Simulating:0123456789.0123456789.0123456789.0123456789.01234567!
++ Clock time now = 266.7 s
# 3dClustSim -mask mask.nii -acf 0.64939 10.17 20.884
# 1-sided thresholding
# Grid: 91x109x91 2.00x2.00x2.00 mm^3 (282349 voxels in mask)

# CLUSTER SIZE THRESHOLD(pthr,alpha) in Voxels
# -NN 3 | alpha = Prob(Cluster >= given size)
# pthr | .10000 .05000 .02000 .01000
# ------ | ------ ------ ------ ------
0.050000 4662.0 5646.0 6974.0 7958.0
0.020000 1990.5 2432.0 2990.0 3414.0
0.010000 1191.7 1473.3 1847.5 2081.0
0.005000 759.3 943.7 1200.0 1370.0
0.002000 438.7 560.7 710.3 831.0
0.001000 291.1 380.2 497.7 594.0
0.000500 190.8 260.0 349.8 418.2
0.000200 105.6 152.4 218.5 275.0
0.000100 63.6 99.0 152.0 201.7

So for whole brain at athr of 0.05 and pthr of 0.001 our k value would be 380 voxels

When I repeat this using a smaller ROI mask my smoothing estimates are similar - 0.8530 7.3738 16.9450 - however opening each individuals files I have found that the C values varied from about 0.56 and goes up to 30+ depending on the individuals, is this normal?

The output for this small mask is:

3dClustSim -mask /local/Isabella/marsbar_CCN_ROIs/CCN.nii -acf 0.8530 7.3738 16.9450
++ 3dClustSim: AFNI version=AFNI_18.2.19 (Sep 27 2018) [64-bit]
++ Authored by: RW Cox and BD Ward
++ 3477 voxels in mask (0.39% of total)
++ Kernel function radius = 33.82 mm
++ ACF(0.85,7.37,16.94) => FWHM=17.76 => 91x109x91 pads to 128x160x128
+ Kernel image dimensions 42 x 53 x 27
++ Startup clock time = 0.4 s
++ Using 15 OpenMP threads
Simulating:0123456789.0123456789.0123456789.0123456789.01234567!
++ Clock time now = 193.8 s
*+ WARNING: pthr=0.000200 ; desired alpha=0.100000 -- but max simulated alpha=0.068100]
*+ WARNING: pthr=0.000100 ; desired alpha=0.100000 -- but max simulated alpha=0.040500]
+ [further messages about alpha are suppressed]
# 3dClustSim -mask /local/Isabella/marsbar_CCN_ROIs/CCN.nii -acf 0.8530 7.3738 16.9450
# 1-sided thresholding
# Grid: 91x109x91 2.00x2.00x2.00 mm^3 (3477 voxels in mask)
...
#
# CLUSTER SIZE THRESHOLD(pthr,alpha) in Voxels
# -NN 3 | alpha = Prob(Cluster >= given size)
# pthr | .10000 .05000 .02000 .01000
# ------ | ------ ------ ------ ------
0.050000 195.7 244.2 302.0 341.5
0.020000 113.6 149.2 197.0 231.7
0.010000 70.7 100.7 141.3 167.7
0.005000 41.4 65.4 98.0 123.4
0.002000 19.0 34.0 57.6 77.0
0.001000 9.0 18.6 37.2 52.2
0.000500 3.2 9.2 22.2 35.3
0.000200 1.0 2.7 10.1 17.4
0.000100 1.0 1.0 4.2 9.7

This results in a cluster-threshold of 19 at pthr 0.001 and athr 0.05.

To summarize my question is ultimately is this method appropriate and is it working as expected on a whole brain level as well as with small ROI masks?

Thank you so much for your help.

Isabella
Subject Author Posted

Using 3dFWHMx & 3dClustSim for clusterwise correction in SPM

ibreukelaar October 10, 2018 08:09PM

Re: Using 3dFWHMx & 3dClustSim for clusterwise correction in SPM

gang October 11, 2018 02:25PM

Re: Using 3dFWHMx & 3dClustSim for clusterwise correction in SPM

ibreukelaar October 11, 2018 07:14PM

Re: Using 3dFWHMx & 3dClustSim for clusterwise correction in SPM

gang October 11, 2018 08:12PM

Re: Using 3dFWHMx & 3dClustSim for clusterwise correction in SPM

ibreukelaar October 11, 2018 09:35PM