mvpa2.misc.surfing.surf_voxel_selection.VoxelSelector

Inheritance diagram of VoxelSelector
class mvpa2.misc.surfing.surf_voxel_selection.VoxelSelector(radius, distance_surf, n2v, distance_metric='dijkstra', outside_node_margin=None)

Voxel selection for surface-based searchlights

Methods

disc_voxel_attributes(src) Voxel selection for single center node
disc_voxel_indices_and_attributes(src) For now this is a wrapper
nodes2voxel_attributes(n2d, n2v[, ...]) Computes voxel distances

Voxel selection using cortical surfaces.

Parameters:

radius: int or float

Searchlight radius. If the type is int, then this set the number of voxels in each searchlight (with variable size of the disc across searchlights). If the type is float, then this sets the disc radius in metric distance (with variable number of voxels across searchlights). In the latter case, the distance unit is usually in milimeters (which is the unit used for FreeSurfer surfaces). If radius is zero then only the center node itself is considered.

distance_surf: surf.Surface

A surface to be used for distance measurement. Usually this is the intermediate distance constructed by taking the node-wise average of the pial and white surface.

n2v: dict

Mapping from center nodes to surrounding voxels (and their distances). Usually this is the output from volsurf.node2voxels.

distance_metric: str

Distance measure used to define distances between nodes on the surface. Currently supports ‘dijkstra’ and ‘euclidean’

outside_node_margin: float or True 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.

Methods

disc_voxel_attributes(src) Voxel selection for single center node
disc_voxel_indices_and_attributes(src) For now this is a wrapper
nodes2voxel_attributes(n2d, n2v[, ...]) Computes voxel distances
disc_voxel_attributes(src)

Voxel selection for single center node

Parameters:

src: int

Index of center node to be used as searchlight center

Returns:

voxprops: dict

Various voxel properties, where voxprops[key] is a list with voxprops[key][i] property key for voxel i. Has at least a key ‘distances’. Each of voxprops[key] should be list-like of equal length.

disc_voxel_indices_and_attributes(src)

For now this is a wrapper TODO integrate with calling function

nodes2voxel_attributes(n2d, n2v, distancesummary=<built-in function min>)

Computes voxel distances

Parameters:

n2d: dict

A mapping from node indices to distances (to a center node) Usually this is the output from surf.circlearound_n2d and thus only contains voldata for voxels surrounding a single center node

n2v: dict

A mapping from nodes to surrounding voxel indices and distances. n2v[i]=v2d is a dict mapping node i to a dict v2d, which in turn maps voxel indices to distances to the center node (i.e. v2d[j]=d means that the distance from voxel with linear index j to the node with index i is d

distancesummary: function

This is by default the min function. It is used to summarize cases where a single voxels has multiple distances (and nodes) associated with it. By default we take the minimum distance, and the node that gives rise to this distance, as a representative for the distance.

Returns:

voxelprops: dict

Mapping from keys to lists that contain voxel properties. Each list should have the same length It has at least a key sparse_volmasks._VOXIDXSLABEL which maps to the linear voxel indices. It may also have ‘distances’ (distance from center node along the cortex) and ‘gmpositions’ (relative position in the gray matter)