Cluster thresholding for statistical maps on the surface

Hi all,
I’m using nilearn to analyze some functional connectivity data on the surface and was wondering whether there’s a way to threshold a statistical map based on cluster size in addition to the stat value threshold. This works for volume images using nilearn.image.threshold_img, but I can’t find a parallel way to do the same on the surface (nor in the surface plotting functions). I found this thread from a couple of years ago but these functions don’t seem to exist either (Cluster extension threshold). Let me know if this is implemented somewhere, thanks!

Hi @mayay, the example from the thread you reference is updated in nilearn and you can see the nilearn function equivalents in this example: Nilearn: Statistical Analysis for NeuroImaging in Python — Machine learning for NeuroImaging

I think what you can do is threshold your map with image.threshold_stats_img and then use surface.vol_to_surf to extract the surface data from the thresholded image. Then you can use plotting.plot_surf_stat_map to visualize the thresholded image.

Thanks! But the issue is that my statistical image is in the surface space in the first place, not in volume. So what I’m looking for is either a surf_to_vol function (which I believe doesn’t exist yet in nilearn), or a way to apply the thresholding in the surface.

Ok thanks for clarifying. Indeed neither is possible with nilearn at the moment. If you wish, it might be worth starting a discussion about adding such functionality by opening an issue on github: Issues · nilearn/nilearn · GitHub.

It might also help to first take a look at these guidelines: