murraylab / brainsmash

Brain Surrogate Maps with Autocorrelated Spatial Heterogeneity
GNU General Public License v3.0
41 stars 11 forks source link

Create surrogate maps for binary images? #34

Open JohannesWiesner opened 7 months ago

JohannesWiesner commented 7 months ago

Thanks for this great toolbox! I would be interested in creating surrogate maps that can handle a binary input image (which includes cortical + sub-cortical regions, but this seems to be another issue already described in #22 and #24 ). Is it possible to do this with Brainsmash? The idea is that I have a binary image that represents ROIs vs rest. I can already show that I can find brain-behavior relationships when I correlate the values of my ROIs with behavioral variables. Now I want to show that this relationship is specific and create n surrogate maps that have the same spatial autocorrelation, repeat my brain-behavior analysis and compute a "spatial p-value".

jbburt commented 7 months ago

Hi Johannes, a few thoughts:

Josh

JohannesWiesner commented 1 month ago

Hi Josh,

following your comments here:

1.) "If I remember correctly, it is not possible to generate whole-brain surrogate maps in a single go, unless perhaps you have the entire brain represented in voxel space"

My ROI image is in fact in voxel-space + parcellated using 360 parcels from a combined Glasser atlas for the cortical regions and the 16 subcortical regions from the Tian-Atlas. So some of these parcels have the value of 1 assigned to them others the value 0.

  1. "that the combinatoric space of possible permutations is significantly smaller when the map has only two unique values"

Yes, I already had the same thought. The question here would be how many unique surrogate maps could be generated to have a sufficient number null-models to generate a trustworthy p-value. But it makes absolutely sense that with binary images the number of potential results is much smaller.

3.) "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?"

Absolutely correct, I could probably also do that, but it would be computationally very expensive. On top, I also have a case where I only have the ROI image, but not the original data, so here I would not be able to do that (i.e. I don't have access to the original map).

"I don't fully understand the analysis you want to do (which "ROI values" and behavioral variables are you correlating, exactly?)"

This applies to my second case. Here, I have a ROI mask based on an earlier study. Now I have a second dataset where I use this ROI mask to select a subset of brain parcels. I then correlate this subset of brain parcels with behavioral variables. In order to show that this brain-behavior relationship is specific to the ROIS I would need to create binary surrogate maps to repeat the correlation n-times but everytime selecting a different set of ROIs (but preserving spatial autocorrelation to have "fair" competition).

I think my question can be also phrased like this:

Is it possible to create surrogate maps with brainsmash were my input map has the following qualities?

1.) It is voxel-based (not surface based) 2.) It is parcellated (voxels belonging to the same parcels have the same value) 3.) It contains ortical and subcortical regions 4.) It can have floating point values or - special case - boolean values (the latter one I call a ROI mask)