mvpa2.algorithms.searchlight_hyperalignment.SurfaceVerticesQueryEngine¶
-
class
mvpa2.algorithms.searchlight_hyperalignment.
SurfaceVerticesQueryEngine
(voxsel, space='voxel_indices', add_fa=None)¶ Query-engine that maps center nodes to indices of features (voxels) that are near each center node.
In a typical use case such an instance is generated using the function ‘disc_surface_queryengine’
This class is for mappings from surface to voxel features; for mappings from surface to surface features, use SurfaceQueryEngine.
Attributes
add_fa
ids
Methods
__call__
(\*\*kwargs)feature_id2linear_voxel_ids
(feature_id)feature_id2nearest_vertex_id
(feature_id[, ...])Compute the index of the vertex nearest to a given voxel. get_masked_nifti_image
([center_ids])Return a NIfTI image binary mask with voxels covered by searchlights linear_voxel_id2feature_id
(linear_voxel_id)query
(\*\*kwargs)query_byid
(vertexid)Given a vertex ID give us indices of dataset features (voxels) train
(dataset)Train the query engine on a dataset untrain
()vertex_id2nearest_feature_id
(vertex_id)Compute the index of the voxel nearest to a given vertex. Makes a new SurfaceVerticesQueryEngine
Parameters: voxsel: volume_mask_dict.VolumeMaskDictionary
mapping from center node indices to indices of voxels in a searchlight
space: str (default: ‘voxel_indices’)
defines by which space voxels are indexed.
add_fa: list of str
additional feature attributes that should be returned when this instance is called with a center node id.
Attributes
add_fa
ids
Methods
__call__
(\*\*kwargs)feature_id2linear_voxel_ids
(feature_id)feature_id2nearest_vertex_id
(feature_id[, ...])Compute the index of the vertex nearest to a given voxel. get_masked_nifti_image
([center_ids])Return a NIfTI image binary mask with voxels covered by searchlights linear_voxel_id2feature_id
(linear_voxel_id)query
(\*\*kwargs)query_byid
(vertexid)Given a vertex ID give us indices of dataset features (voxels) train
(dataset)Train the query engine on a dataset untrain
()vertex_id2nearest_feature_id
(vertex_id)Compute the index of the voxel nearest to a given vertex. -
add_fa
¶
-
feature_id2linear_voxel_ids
(feature_id)¶
-
feature_id2nearest_vertex_id
(feature_id, fallback_euclidean_distance=False)¶ Compute the index of the vertex nearest to a given voxel.
Parameters: feature_id: int
Feature index (referring to a voxel).
fallback_euclidean_distance: bool (default: False)
If the voxel indexed by feature_id was not selected by any searchlight, then None is returned if fallback_euclidean_distance is False, but vertex_id with the nearest Euclidean distance is returned if True.
Returns: vertex_id: int
Vertex index of vertex nearest to the feature with id feature_id. By default this function only considers vertices that are in one or more searchlights
-
get_masked_nifti_image
(center_ids=None)¶ Return a NIfTI image binary mask with voxels covered by searchlights
Parameters: center_ids: list or None
Indices of center ids for which the associated masks must be used. If None, all center_ids are used.
Returns: img: nibabel.Nifti1Image
Nifti image with value zero for voxels that we not selected, and non-zero values for selected voxels.
Notes
When using surface-based searchlights, a use case of this function is to get the voxels that were associated with the searchlights in a subset of all nodes on a cortical surface.
-
ids
¶
-
linear_voxel_id2feature_id
(linear_voxel_id)¶
-
query
(**kwargs)¶
-
query_byid
(vertexid)¶ Given a vertex ID give us indices of dataset features (voxels)
Parameters: vertexid: int
Index of searchlight center vertex on the surface. This value should be an element in self.ids
Returns: voxel_ids: list of int or AttrDataset
The linear indices of voxels near the vertex with index vertexid. If the instance was constructed with add_fa=None, then voxel_ids is a list; otherwise it is a AttrDataset with additional feature attributes stored in voxel_ids.fa.
-
train
(dataset)¶ Train the query engine on a dataset
-
untrain
()¶
-
vertex_id2nearest_feature_id
(vertex_id)¶ Compute the index of the voxel nearest to a given vertex.
Parameters: vertex_id: int
Vertex id (referring to a node on the surface).
Returns: feature_id: int
Index of feature nearest to the vertex with id vertex_id.
Notes
This function only considers feature ids that are selected by at least one vertex_id..
-