mvpa2.misc.surfing.surf_voxel_selection.run_voxel_selection¶
-
mvpa2.misc.surfing.surf_voxel_selection.
run_voxel_selection
(radius, volume, white_surf, pial_surf, source_surf=None, source_surf_nodes=None, volume_mask=None, distance_metric='dijkstra', start_mm=0, stop_mm=0, start_fr=0.0, stop_fr=1.0, nsteps=10, eta_step=1, nproc=None, outside_node_margin=None, results_backend=None, tmp_prefix='tmpvoxsel', node_voxel_mapping='maximal')¶ Voxel selection wrapper for multiple center nodes on the surface
Parameters: radius: int or float
Size of searchlight. If an integer, then it indicates the number of voxels. If a float, then it indicates the radius of the disc
volume: Dataset or NiftiImage or volgeom.Volgeom
Volume in which voxels are selected.
white_surf: str of surf.Surface
Surface of white-matter to grey-matter boundary, or filename of file containing such a surface.
pial_surf: str of surf.Surface
Surface of grey-matter to pial-matter boundary, or filename of file containing such a surface.
source_surf: surf.Surface or None
Surface used to compute distance between nodes. If omitted, it is the average of the gray and white surfaces.
source_surf_nodes: list of int or numpy array or None
Indices of nodes in source_surf that serve as searchlight center. By default every node serves as a searchlight center.
volume_mask: None (default) or False or int
Mask from volume to apply from voxel selection results. By default no mask is applied. If volume_mask is an integer k, then the k-th volume from volume is used to mask the data. If volume is a Dataset and has a property volume.fa.voxel_indices, then these indices are used to mask the data, unless volume_mask is False or an integer.
distance_metric: str
Distance metric between nodes. ‘euclidean’ or ‘dijksta’ (default)
start_fr: float (default: 0)
Relative start position of line in gray matter, 0.=white surface, 1.=pial surface
stop_fr: float (default: 1)
Relative stop position of line (as in see start)
start_mm: float (default: 0)
Absolute start position offset (as in start_fr)
stop_mm: float (default: 0)
Absolute start position offset (as in start_fr)
nsteps: int (default: 10)
Number of steps from white to pial surface
eta_step: int (default: 1)
After how many searchlights an estimate should be printed of the remaining time until completion of all searchlights
nproc: int or None
Number of parallel threads. None means as many threads as the system supports. The pprocess is required for parallel threads; if it cannot be used, then a single thread is used.
outside_node_margin: float or None (default)
By default nodes outside the volume are skipped; using this parameter allows for a marign. If this value is a float (possibly np.inf), then all nodes within outside_node_margin Dijkstra distance from any node within the volume are still assigned associated voxels. If outside_node_margin is True, then a node is always assigned voxels regardless of its position in the volume.
results_backend : ‘native’ or ‘hdf5’ or None (default).
Specifies the way results are provided back from a processing block in case of nproc > 1. ‘native’ is pickling/unpickling of results by pprocess, while ‘hdf5’ would use h5save/h5load functionality. ‘hdf5’ might be more time and memory efficient in some cases. If None, then ‘hdf5’ if used if available, else ‘native’.
tmp_prefix : str, optional
If specified – serves as a prefix for temporary files storage if results_backend == ‘hdf5’. Thus can specify the directory to use (trailing file path separator is not added automagically).
node_voxel_mapping: ‘minimal’ or ‘maximal’ or ‘minimal_lowres’
If ‘minimal’ then each voxel is associated with at most one node. If ‘maximal’ it is associated with as many nodes that contain the voxel (default: ‘maximal’). If ‘minimal_lowres’ then each voxel is associated with at most one node, and each node that is mapped onto has a corresponding node (at the same spatial location) in source_surf.
Returns: sel: volume_mask_dict.VolumeMaskDictionary
Voxel selection results, that associates, which each node, the indices of the surrounding voxels.