FDR for all local maxima of a t-map

Hello AFNI experts,

I would like to compute the FDR for only the local maxima (26-connected neighborhood) of a t-statistic map, similar to the default afni_proc.py using 3dFDR, but restricted to those local maxima voxels. Is there a way that I can do this on stats.*REML+orig.BRIK using AFNI functions? It seems 3dExtrema does not generate a mask containing local maxima. Thank you very much.

Hi, Zhengchen-

I'm not quite sure I understand. Is the set of steps:

  • find a local maximum (1 voxel)
  • inflate that voxel in all directions, making a 3x3x3 voxel neighborhood with it at the middle
  • run 3dFDR to adjust p-values in that neighborhood

? Please let me know if I am not picturing the steps correctly.

--pt

Hi Paul,

Thank you for the prompt response, and sorry for the confusion. What I am looking for is an FDR threshold computed within the Random Field Theory framework. After thresholding the map at t>3.1, we extract all local maxima within the 3D brain mask. A matlab verion of local maxima function can be found here. It is just a 3x3x3 sliding box over the whole brain and a voxel is assigned as local maxima if its value are larger than all neighbors. We then use the t-values of these maxima to derive the RFT-based FDR cutoff, so that we can determine which peaks remain significant after correction.

Hi, Zhengchen-

OK, so if I understand new description, the input is a t-stat dataset, and you want to:

  • threshold the dataset at t=3.1.
  • pass a 3x3x3 filter over the thresholded dataset, which behaves to:
    • put a 1 at a voxel if it is the maximum within a 3x3x3 neighborhood centered on it (including being tied for max value), else put a 0 there.
  • multiply the original stats dset by that newly created mask
  • run 3dFDR on that final (and maybe sparse) stats dset

?

--pt

Hi Paul,

Yes, exactly. I tried 3dExtrema but I do not know how to get a mask of local maxima. If there is a way to generate the local maxima mask, I could just feed it into 3dFDR.

Hi, Zhengchen-

OK. Note that I had a conversation with the inimitable @rickr about this a bit. He noticed that the Matlab function actually has more complicated behavior than what I described. It has a pretty involved behavior of looking for looking for patches of constant values and checking if those are local maxima. That way, the full "flat" region of 22s or 33s all get painted in, for example, without a hole in the middle, and the full flat regions of 10s don't get filled in.

I initially thought it might be possible to do this with 3dLocalstat, but the patchy aspect means that it wouldn't. Hmm....

--pt

Hi Paul,

Thank you very much for looking into this. I guess then I will just read the stats brick in matlab and compute this FDR.