Checking for sufficient ROI coverage in nilearn

Hi all,
Attempting to learn how to use Nilearn. I’m using a dataset of individuals with Alzheimer’s Disease. I was planning to do ROI-to-ROI analyses (using the Schaefer 200 atlas, for now anyway) but I wanted to check the extent to which the signal in the ROIs actually exists (i.e., does a temporal pole ROI have missing signal in > 50% of the voxels because of disease).

I understand the code for computing the number of voxels in the ROI, but haven’t figured out how to do this part of it. I’m sure that there is a simple way to do this. I’m using fMRIPrep’d outputs in MNI space.

Thanks for any help anyone can be.

Hi Adam,
This example from Nilearn demonstrates how to extract a signal and plot it from desired coordinates. If you are not tied to Schaefer200 then perhaps this could help you?

You need to find a statistical way to characterise voxels with missing values: low mean, low variance, or something of that kind.

for instance, you can compute the mean image using
mean_img_ = nilearn.img.mean_img

than simply threshold it at some level that seems right for you
binary_img = nilearn.image.threshold_img(mean_img_, threhsold)

and finally use the NiftiLabelsMasker initiated with Schaefer atlas to get the mean of the binary maps:
region_mean = masker.transform(binary_img)

if regions_mean is <.5, this means that more than half of the voxels in the corresponding region have been tagged as 0 in binary_img


That’s perfect and definitely what I was looking for. Thanks @bthirion