AFNI Class Notes 12/15/17:

Imposing blur

3dBlurToFWHM iteratively blur inside a mask to global FWHM
3dBlurInMask will blur a dataset inside a mask without measuring FWHM
3dmerge
-1blur_fwhm will blur data by blur function

Calculating blur

3dFWHMx calculates Gaussian and autocorrelation function

3dLocalstat -stat FWHM

3dLocalACF -stat ACF

3dFWHM totally superseded by 3dFWHMx

Using blur for calculations:

3dClustSim
AlphaSim
mostly superseded by 3dClustSim
cdf calculate p to t/F levels

Where to cluster? A paper by Tor Wager's Group
Why do we care about FWHM v. ACF? A paper by Knutsson

As Imposing blur was discussed in afni_proc.py we will start the discussion with calculating blur.

While 3dLocalstat provides a voxel based calculation of blur it uses only Gaussian based on 3dFWHM which is outdated. Thus 3dFWHMx is strongly suggested.

3dFWHMx This function provides important information regarding spatial smoothness of data in preparation for cluster based thresholding of data.
  -input                               
Dataset to calculate blur. You can use either:
                                                            Raw data going into 3dDeconvolve—use detrend in this case

                                                            Error data coming out of 3dDeconvolve—don’t use detrend in this case
  -detrend [q]                    Suggested: removes polynomial trends [Default = off; default q=length/30]
                                             Definitely use for time series data such as data prior to deconvolution
  -demed                             Same as detrend 0 [Default = off]
  -unif                                   Makes time series variance uniform [Default = off; used in detrend]
  -automask                       Mask data based on 3dAutomask [Default = use all voxels]
  -mask mmm                     Provide planned mask
  -detprefix d                      Save the detrended file  for datachecking
  -geom/-arith                   Provide mean per subbrik      }= If the input dataset has more than one sub-brick,
  -combine                          x y z into one value
  -out ttt                              Write output to file 'ttt' [3 columns of numbers; ttt= - sends to stdout]
  -ACF [anam]                    Computes autocorrelation function for data as well as Gaussian
                                             ACF(r) = a * exp(-r*r/(2*b*b)) + (1-a)*exp(-r/c)
  -acf [anam]                      same as ACF but comments “#” are removed

Example:
 3dFWHMx -acf acf.test  -detrend -automask pb05.CAJe_110.r01.scale+tlrc.
Output (stdout):
 4.62998  4.51046  4.29648     4.47683
 0.86879  2.49856  17.8253     6.1694
   this gives FWHM in first row (x/y/z/global) and acf in second row (a/b/c/approx fwhm).
Output (png): acf.text.png

3dClustSim Estimates the probability of false positive (noise-only) clusters.
-mask mset                         Provide explicit mask for size, shape, dimensions
-nxyz n1 n2 n3                    Size of 3D grid to use for simulation [Default values = 64 64 32]
-dxyz d1 d2 d3                    Voxel dimensions [Default values = 3.5 3.5 3.5]
-BALL                                    Treat grid as describing a sphere not a box
-inset iset [iset ...]              Use to do multiple ROIs
-acf a b c                             
3 autocorrelation values
-fwhm s                               single Gaussian filter width                      
-fwhmxyz sx sy sz               3 dimensional Gaussian
-pthr p1 .. pn                      voxel thresholds
                                             [default = 0.05 0.02 0.01 0.005 0.002 0.001 0.0005 0.0002 0.0001]
-athr a1 .. an                      
cluster thresholds [default = 0.10 0.05 0.02 0.01]
-LOTS                                   same as using '-pthr LOTS -athr LOTS'
-MEGA                                 more than LOTS

-iter n                                  number of Monte Carlo simulations [default = 10000]
-seed S                                 random number seed [default seed = 123456789; use 0 for quasi-randomized]
-prefix ppp                          Write output for NN method #k to file 'ppp.NNk_Xsided.1D',

3dClustSim does 3 different types of thresholding: as X in file name
1-sided                 as above
2-sided                 where positive and negative values are clustered together
bi-sided                where positive values and negative are clustered SEPARATELY

3dClustSim does 3 different NN methods are: as k in file name
1                            Use first-nearest neighbor clustering= faces touch
2                            Use second-nearest neighbor clustering= faces OR edges touch
3                            Use third-nearest neighbor clustering= faces OR edges OR corners touc

-cmd ccc                              Write command in file (ccc)
-quiet

Example:
  3dClustSim -acf 0.86879  2.49856  17.8253 -iter 10000 -pthr .05 .01 .005 .001 -athr .05 .01 .005 .001 -mask mask_epi_extents+tlrc. -prefix ClustOutput

Output: ClustOutput.NN1_bisided.1D

pthr\athr

0.05

0.01

0.005

0.001

0.05

50.8

69.7

79.8

112.0

0.01

13.0

17.1

19.0

24.6

0.005

8.9

11.5

12.6

16.0

0.001

4.7

6.0

6.7

8.1