Reading material¶
[KGB06]: first fMRI searchlight paper. [OWD+10]: surface based searchlight (outside the scope of this exercise).
Write a searchlight function that computes a generic dataset measure¶
Volume based searchlight analysis proceeds by defining a local neighborhood of voxels around each voxel in the brain volume. This subset of voxels can be thought of as a mini dataset, where the mask that defines the voxels included in the dataset is the searchlight sphere. Because we can treat each searchlight as a dataset, we can build a searchlight function that will compute any dataset measure that we specify. This allows us to reuse code, and run searchlights for different purposes.
We have provided a couple of helper functions that do some of the heavy lifting involved defining the sets of neighborhood voxels. For this, use cosmo spherical neighborhood that was presented in the previous exercise.
With the help of these functions, write a generic searchlight function that satisfies the following definition:
function results_map = cosmo_searchlight(ds, nbrhood, measure, varargin)
Hint: cosmo searchlight skl
Solution: cosmo searchlight