Open JohannesWiesner opened 2 weeks ago
Hi Johannes, thanks for your question.
The spatial null models currently implemented in neuromaps fall into two categories: spatial permutation nulls ("spin test") and parameterized null models. The spatial permutation nulls involve projecting cortical data to a sphere and rotating this sphere. This is the version where the values of the original vector can be perfectly preserved ("perfect permutations"), although there are also "imperfect" versions of this null that can result in duplicated or missing values from the original array. (Note that by "imperfect" I don't mean that these nulls are inferior.)
However, spin tests can only be used on cortical surfaces. In your case, since you're generating a spatial null for a volumetric image that includes noncortical regions, you are limited to the parameterized nulls (e.g. burt2018, burt2020, moran). These nulls use different methods but ultimately are all "generating" new brain maps that approximate the spatial autocorrelation of the original brain map (e.g. burt2020 is optimizing the variogram fit between null and empirical; moran is using the eigenvectors of the distance matrix to generate null data with identical Moran's I). So all this to say, no you should not expect the same values in the null map for these methods.
Some useful resources for learning more about spatial nulls: Markello & Misic 2021 NeuroImage, and here is a recorded educational workshop on spatial nulls from OHBM.
All the best, Justine
@justinehansen : Thanks so much for the answer, that explains a lot! Alright, then I know that nothing "wrong happens".
It still leaves me with this issue (because you can not use the same threshold as in the original image) but this is another issue. Maybe interesting though for @jbburt because of this comment:
what if you simply generated surrogate maps prior to binarization? ie, permute the original map (using brainsmash) with the "resample" parameter set to True (ie, perform an SA-invariant permutation), then (using the same threshold as before) binarize your surrogate map to get your ROI mask, then use these surrogate ROI masks to generate samples from your null distribution?
Issue summary
I want to create null models for my parcellated volumetric statistical image (which includes cortical and subcortical regions). I have tried to use all three available functions (burt2020, burt2018, moran). My intuitive understanding when creating null models is that the original values of the brain regions are “shuffled” across the brain, preserving spatial autocorrelation. Therefore, I assumed that the columns in the output matrix would be the same values as my input values, just in a different order. But this does not seem to be the case? Is this behavior normal or is it a bug?
Detailed issue description
Here's the input data inputs.zip
Steps to reproduce issue
Here's some code to reproduce the problem:
Software version
3.9.20 | packaged by conda-forge | (main, Sep 30 2024, 17:49:10) [GCC 13.3.0] 0.0.5+27.ga89b699
Code of Conduct
neuromaps
Code of Conduct