mvpa2.misc.surfing.volsurf.VolSurfMapping

Inheritance diagram of VolSurfMapping
class mvpa2.misc.surfing.volsurf.VolSurfMapping(vg, white, pial, intermediate=None, nsteps=10, start_fr=0.0, stop_fr=1.0, start_mm=0, stop_mm=0)

General mapping between volume and surface.

Subclasses have to implement node2voxels

Attributes

intermediate_surface Returns the node-wise average of the pial and white surface
pial_surface Returns the pial surface
volgeom Returns the volume geometry
white_surface Returns the white surface

Methods

coordinates_to_grey_distance_mm(nodes, xyz) Computes the grey position of coordinates in metric units
get_node2voxels_mapping()
Returns:
get_parameter_dict() Returns a dictionary with the most important parameters
surf_project_nodewise(xyz) Projects coordinates on lines connecting pial and white matter.
surf_project_weights(nodes, xyz) Computes relative position of xyz on lines from pial to white matter.
surf_project_weights_nodewise(xyz) Computes relative position of xyz on lines from pial to white matter.
surf_unproject_weights_nodewise(weights) Maps relative positions in grey matter to coordinates
voxel_count_nifti_image() Returns a NIFTI image indicating how often each voxel is selected.
Parameters:

volgeom: volgeom.VolGeom

Volume geometry

white: surf.Surface

Surface representing white-grey matter boundary

pial: surf.Surface

Surface representing pial-grey matter boundary

intermediate: surf.Surface (default: None).

Surface representing intermediate surface. If omitted it is the node-wise average of white and pial.

nsteps: int (default: 10)

Number of steps from white to pial surface

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).

Notes

‘pial’ and ‘white’ should have the same topology.

Attributes

intermediate_surface Returns the node-wise average of the pial and white surface
pial_surface Returns the pial surface
volgeom Returns the volume geometry
white_surface Returns the white surface

Methods

coordinates_to_grey_distance_mm(nodes, xyz) Computes the grey position of coordinates in metric units
get_node2voxels_mapping()
Returns:
get_parameter_dict() Returns a dictionary with the most important parameters
surf_project_nodewise(xyz) Projects coordinates on lines connecting pial and white matter.
surf_project_weights(nodes, xyz) Computes relative position of xyz on lines from pial to white matter.
surf_project_weights_nodewise(xyz) Computes relative position of xyz on lines from pial to white matter.
surf_unproject_weights_nodewise(weights) Maps relative positions in grey matter to coordinates
voxel_count_nifti_image() Returns a NIFTI image indicating how often each voxel is selected.
get_node2voxels_mapping()
Returns:

n2v: dict

A mapping from node indices to voxels. In this mapping, the

‘i’-th node is associated with ‘n2v[i]=v2p’ which contains the

mapping from linear voxel indices to grey matter positions. In

other words, ‘n2v[i][idx]=v2p[idx]=pos’ means that the voxel with

linear index ‘idx’ is associated with node ‘i’ and has has

relative position ‘pos’ in the gray matter.

If node ‘i’ is outside the volume, then ‘n2v[i]=None’.

Notes

The typical use case is selecting voxels in the grey matter. The rationale of this method is that (assuming a sufficient dense cortical surface mesh, combined with a sufficient number of nsteps, the grey matter is sampled dense enough so that ‘no voxels are left out’.

get_parameter_dict()

Returns a dictionary with the most important parameters of this instance

voxel_count_nifti_image()

Returns a NIFTI image indicating how often each voxel is selected.

Parameters:

n2v: dict

Node to voxel mapping, typically from node2voxels. If omitted then the output from node2voxels() is used.

Returns:

img: nifti.Nifti1Image

Image where the value in each voxel indicates how often each voxel was selected by n2v.