Generate DSMs in a searchlight pattern on MNE-Python source estimates.
DSMs are computed using a patch surrounding each source point. Source
estimate objects can be either defined along a cortical surface
(SourceEstimate
objects) or volumetric (VolSourceEstimate
objects).
For surface source estimates, distances between vertices are measured in 2D
space, namely as the length of the path along the surface from one vertex
to another. For volume source estimates, distances are measured in 3D space
as a straight line from one voxel to another.
For each item, a source estimate for the brain activity.
The source space used by the source estimates specified in the stcs parameter.
The spatial radius of the searchlight patch in meters. All source points within this radius will belong to the searchlight patch. Set to None to only perform the searchlight over time, flattening across sensors. Defaults to 0.04.
The temporal radius of the searchlight patch in seconds. Set to None to only perform the searchlight over sensors, flattening across time. Defaults to 0.1.
The metric to use to compute the DSM for the source estimates. This can
be any metric supported by the scipy.distance.pdist function. See also
the stc_dsm_params
parameter to specify and additional parameter
for the distance function. Defaults to ‘sqeuclidean’.
Extra arguments for the distance metric used to compute the DSMs.
Refer to scipy.spatial.distance
for a list of all other metrics
and their arguments. Defaults to an empty dictionary.
For each source estimate, a number indicating the item to which it
belongs. When None
, each source estimate is assumed to belong to a
different item. Defaults to None
.
Number of cross-validation folds to use when computing the distance
metric. Folds are created based on the y
parameter. Specify
None
to use the maximum number of folds possible, given the data.
Alternatively, you can pass a Scikit-Learn cross validator object (e.g.
sklearn.model_selection.KFold
) to assert fine-grained control over
how folds are created.
Defaults to 1 (no cross-validation).
When set, searchlight patches will only be generated for the subset of
vertices/voxels with the given indices. Defaults to None
, in which
case patches for all vertices/voxels are generated.
When set, searchlight patches will only be generated from subsequent
time points starting from this time point. This value is given in
seconds. Defaults to None
, in which case patches are generated
starting from the first time point.
When set, searchlight patches will only be generated up to and
including this time point. This value is given in seconds. Defaults to
None
, in which case patches are generated up to and including the
last time point.
The number of processes (=number of CPU cores) to use for the source-to-source distance computation. Specify -1 to use all available cores. Defaults to 1.
A DSM for each searchlight patch.