I am currently running a searchlight analysis using Nilearn (with 5 mm radius) and using SPM First level beta maps as input. While fitting my searchlight, I am getting the error; “These Spheres are empty: [list of spheres]” for some subjects which seems to be traced to nilearn/maskers/nifti_spheres_masker.py.
I saw someone else asked this question and their problem was solved but the user does not share how:
GetData is a self made class that returns a dictionary with the data files, labels and groups. Mask is the brain mask corresponding to the subject, radius is 5mm, estimator is lda, and cv is LeaveOneGroupOut().
I obtained the masks during fMRIprep preprocessing. I think this might have caused the issue. Initially I did everything from the bids conversion with heudiconv, then preprocessing with fMRIprep and then GLM with Nilearn. However, the previous researcher who acquired the data had “better” SPM (they had done preprocessing on SPM as well) first level results, so I ended up using their first level beta maps but kept the brain mask as my preprocessing derivatives. I carried out the preprocessing basically the way they did it on SPM but I will check now with the SPM mask.
Worth a double check indeed: SPM usually only runs the GLM on a subset of voxels and gives you a binary mask to tell you what voxels were included. It may very well be that the fmriprep mask and the SPM mask do not match. So it could be that for some points of your searchlight, there is no value because SPM did not estimate the GLM there.
FYI: there is a way to change the threshold SPM uses to include voxels in the GLM and also to pass it a mask to force it to run the GLM in. So if you wanted to only use the fmriprep mask, it can be done.