Thresholding a statistical map


I have a map of t-statistics that I created outside the regular workflow (a searchlight similarity analysis). I’d now like to threshold it, but I’m not sure how that can be done. I can of course threshold at a specific t-value, but I’d like to run correction for multiple comparisons and set a specific p-value.

I thought to use the SPM Threshold function, but that requires an SPM.mat file. I checked the option of tweaking the code to input the relevant parameters from the SPM.mat file myself, but I’m not sure how to calculate some of them (particularly SPM.xX.erdf).

Does anyone happen to have helpful pointers?


It’s been years since I’ve used SPM so I may have some details wrong here but I think doing the whole analysis in SPM is the best way to do it.

If you’re doing pvalue correction in SPM I expect you’re trying to use random field theory which requires typically requires an estimation of your image smoothness from the residuals. There are ways around this but then why not just do it in SPM instead of reinventing everything?

I’m happy to hear non-SPM solutions as well. The analysis itself is outside the ‘standard’ SPM processing, I’m running a searchlight with a function I wrote, so in any case I’d need to find the right place to plug in the results.
Do you know of a way to threshold a stat map in nipype in general (not necessarily SPM)? (but using a desired p-value, not a t-value which would be very simple)


You may find nilearn useful, and the module would also handle the plotting easily. Check out their searchlight example, with p-values addressed at the bottom. They suggest using nilearn.mass_univariate.permuted_ols.


That should do the trick - thanks!