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  

|
February 21, 2023 09:15AM
There is some stochasticity in these calculations, so they will be likely to vary a litttle bit across runs. 3dClustSim calcs are also generally intended to be run in more spherical, whole-brain masklike masks, as well. Having a mask that is composed of set of linear-ish structures with complicated boundaries can affect some of convergence, I would guess. I mention this because from your filenames, I think you are running this in a gray matter only mask, which will be relatively filamentary rather than blobby/spherical-ish.

That being said, I generated a practice GM-only mask on the same dimensions of template you are using, using the GM mask from the MNI152 template resampled onto the 91x109x91, 2mm iso MNI_avg152T1+tlrc brain (see attached image):
3dresample -prefix TMP_RES.nii.gz -master MNI_avg152T1+tlrc. -input MNI152_2009_template_SSW.nii.gz'[4]' -rmode NN
This gave me a GM mask that is approximately the same size as yours:
3dROIstats -nomeanout -quiet -nzvoxels -mask TMP_RES.nii.gz TMP_RES.nii.gz
... shows that this mask is 178964 voxels, and yours was 160,742 (just a 10% diff). NB: this might not be the best mask for your template specifically- I did grab this one from a different MNI152 just for testing purposes, so you should verify that whatever you are using is a good GM map. The MNI_avg152T1+tlrc. template itself is relatively low-resolution and low-contrast, so distinct GM-WM boundaries are difficult to tell, anyways.

Then I ran 3 runs of your 3dClustSim command, using the same ACF parameters (note that I let the whole output tables be produced, rather than just one pvalue and one FWE value):
3dClustSim -mask TMP_RES.nii.gz -acf 0.5128 3.8451 11.3839 -nodec -prefix TMP_RES_CLUST
3dClustSim -mask TMP_RES.nii.gz -acf 0.5128 3.8451 11.3839 -nodec -prefix TMP_RES_CLUST2
3dClustSim -mask TMP_RES.nii.gz -acf 0.5128 3.8451 11.3839 -nodec -prefix TMP_RES_CLUST3
... and the pthr=0.001 with alpha=0.05 are quite similar in all cases: 46, 46, 47. The full output tables are below, just for reference.

So, I am not seeing a huge amount of variability. Would you mind posting an image of your GM mask, perhaps that might help show some relative difference? The GM one used here doesn't have a lot of sharp structure, it should be noted. It is possible that with a mask that has a complicated structure and boundary, more iterations would be necessary for convergence. The default is 10000 iterations, and you could try increasing it: "-iter 20000" or "-iter 30000", perhaps. Those would be my main suggestions (checking the GM mask for complicatedness, as a reason why convergence might be more complicated, and then increasing the number of iterations to see if that suggests better converge.)

--pt

# 3dClustSim -mask TMP_RES.nii.gz -acf 0.5128 3.8451 11.3839 -nodec -prefix TMP_RES_CLUST
# bi-sided thresholding
# Grid: 91x109x91 2.00x2.00x2.00 mm^3 (178964 voxels in mask)
#
# CLUSTER SIZE THRESHOLD(pthr,alpha) in Voxels
# -NN 2  | alpha = Prob(Cluster >= given size)
#  pthr  | .10000 .05000 .02000 .01000
# ------ | ------ ------ ------ ------
 0.050000     757    910   1135   1325
 0.020000     294    362    452    539
 0.010000     165    202    256    296
 0.005000     100    121    154    185
 0.002000      56     68     88    103
 0.001000      38     46     61     71
 0.000500      26     32     42     50
 0.000200      16     21     27     33
 0.000100      11     15     20     24


# 3dClustSim -mask TMP_RES.nii.gz -acf 0.5128 3.8451 11.3839 -nodec -prefix TMP_RES_CLUST
# bi-sided thresholding
# Grid: 91x109x91 2.00x2.00x2.00 mm^3 (178964 voxels in mask)
#
# CLUSTER SIZE THRESHOLD(pthr,alpha) in Voxels
# -NN 2  | alpha = Prob(Cluster >= given size)
#  pthr  | .10000 .05000 .02000 .01000
# ------ | ------ ------ ------ ------
 0.050000     757    910   1135   1325
 0.020000     294    362    452    539
 0.010000     165    202    256    296
 0.005000     100    121    154    185
 0.002000      56     68     88    103
 0.001000      38     46     61     71
 0.000500      26     32     42     50
 0.000200      16     21     27     33
 0.000100      11     15     20     24


# 3dClustSim -mask TMP_RES.nii.gz -acf 0.5128 3.8451 11.3839 -nodec -prefix TMP_RES_CLUST3
# bi-sided thresholding
# Grid: 91x109x91 2.00x2.00x2.00 mm^3 (178964 voxels in mask)
#
# CLUSTER SIZE THRESHOLD(pthr,alpha) in Voxels
# -NN 2  | alpha = Prob(Cluster >= given size)
#  pthr  | .10000 .05000 .02000 .01000
# ------ | ------ ------ ------ ------
 0.050000     763    922   1140   1300
 0.020000     291    355    449    513
 0.010000     166    201    248    290
 0.005000     100    123    156    182
 0.002000      56     70     89    104
 0.001000      38     47     61     71
 0.000500      26     33     43     50
 0.000200      16     21     28     34
 0.000100      11     15     20     25



Edited 1 time(s). Last edit at 02/21/2023 09:17AM by ptaylor.
Attachments:
open | download - img_gm_mni152_t1.jpg (175.6 KB)
Subject Author Posted

3dClustSim Attachments

Sahithyan February 21, 2023 12:41AM

Re: 3dClustSim Attachments

ptaylor February 21, 2023 09:15AM

Re: 3dClustSim

Sahithyan February 21, 2023 01:32PM

Re: 3dClustSim Attachments

ptaylor February 21, 2023 05:01PM

Re: 3dClustSim

Sahithyan February 22, 2023 12:41AM

Re: 3dClustSim

ptaylor February 22, 2023 06:03AM