How to know whether the fMRI data were smoothed

Dear afni experts and users
I am trying to preprocess my fMRI data. Is there any code in afni that i can use to test whether my data were smoothed, e.g., FWHM=6 mm?
Thanks.
best.
rujing

Hi, Rujing-

If you do your processing within AFNI, the history of processing of datasets is stored in the header in what is called the history. So, if you type “3dinfo DATASET” or more specifically “3dinfo -history DATASET”. The history accumulates as the processing proceeds, so the n-th step in processing should have n processing commands stored in it. Note that this is just something AFNI does, and using a different software program would lead to the history not appearing at all in the new file.

To estimate the average spatial smoothness in a dataset, you can use 3dFWHMx. Note that this is pretty different than knowing the blur applied to the dataset, because the data has inherent spatial correlation/smoothness. Blurring/smoothing during processing adds to this pre-existing smoothness.

Note that estimating the smoothness is again different than asking about what spatial blur was applied because applied blurs are typically specifically Gaussian in form, while the inherent smoothness/spatial autocorrelation within a dataset is typically different. For many, many years, essentially all smoothness-estimation programs in the field use the assumption that the blurriness in the data was approximately Gaussian; Eklund et al. 2016 usefully pointed out that this was not a very good/general approximation. In response to that, AFNI adopted a more generalized autocorrelation function (ACF) form, and this is what 3dFWHMx now uses: “3dFWHMx -acf …” gives you the “mixed ACF” smoothness result, described here:

  • Cox RW, Chen G, Glen DR, Reynolds RC, Taylor PA (2017). fMRI clustering and false-positive rates. Proc Natl Acad Sci USA. 114(17):E3370-E3371. doi:10.1073/pnas.1614961114
    https://pubmed.ncbi.nlm.nih.gov/28420798/
  • Cox RW, Chen G, Glen DR, Reynolds RC, Taylor PA (2017). FMRI Clustering in AFNI: False-Positive Rates Redux. Brain Connect 7(3):152-171. doi: 10.1089/brain.2016.0475.
    https://pubmed.ncbi.nlm.nih.gov/28398812/
    … while “3dFWHMx -classic …” would provide the Gaussian smoothness approximation. Note that the Gaussian smoothness approximation should probably not really ever be used for clustering and things, but for reverse engineering or detective work it might be useful.

I guess in general having a processing script to provide a record of processing is the best way to go, for longer term code remembrance and sharing. Is this dataset something you have already inherited in pre-processed form? Do you have data that you know is “raw”, against which you could compare? In many cases, we might suggest processing from the start (e.g., with afni_proc.py if it is FMRI data) rather than having to guess what might have been done.

–pt

ps: and congrats on being the first post of 2023—Happy New Year.

Hi Paul,

I read your post and got curious about the default smoothing operation in afni_proc.py. It is my understanding that a ‘blur’ block in afni_proc invokes 3dmerge to conduct a Gaussian FWHM blur at a specified level. But from your post above it would seem that this is a sub-par way to blur. If that’s the case, is there a way to implement ACF smoothing in afni_proc?

  • Brady

Hi, Brady-

I think the question is whether one is applying blurring to data or estimating smoothness in data.

For estimating the smoothness in data, one wants to estimate more smoothly than a Gaussian approximation, because there will be inherent smoothness (=spatial structure of correlation) from the data itself, in combination with any further applied smoothing.

For applying blurring, using a Gaussian seems perfectly reasonable and appropriate, and that is what happens in AP with default.
Note that it is also possible to apply a (Gaussian) blur that is non-constant across space, to get all locations to apprximately the same smoothness. That could be useful because, as noted above, there is already some spatial structure in the data. That could be signalled in AP by using this option:


-blur_to_fwhm           : blur TO the blur size (not add a blur size)

    This option changes the program used to blur the data.  Instead of
    using 3dmerge, this applies 3dBlurToFWHM.  So instead of adding a
    blur of size -blur_size (with 3dmerge), the data is blurred TO the
    FWHM of the -blur_size.

    Note that 3dBlurToFWHM should be run with a mask.  So either:
        o  put the 'mask' block before the 'blur' block, or
        o  use -blur_in_automask
    It is not appropriate to include non-brain in the blur estimate.

    Note that extra options can be added via -blur_opts_B2FW.

    Please see '3dBlurToFWHM -help' for more information.
    See also -blur_size, -blur_in_automask, -blur_opts_B2FW.

–pt

That is very useful to know! I’m glad the option is easily available in afni_proc. Thanks, Paul.