pulse2percept.topography.neuropythy
Classes
|
- class pulse2percept.topography.neuropythy.NeuropythyMap(subject='fsaverage', cache_dir=None, **params)[source]
-
- load_meshes(subject)[source]
Predicts retinotopy and loads submeshes for the given subject. Adapted from code courtesy of Noah Benson
- dva_to_cortex(x, y, region='v1', hemi=None, surface='midgray')[source]
Gives the cortex position(s) of the visual field point(s) (x,y).
- Parameters:
x (float or array_like) – The x and y-coordinate(s) of the visual field point(s) to look up (in dva).
y (float or array_like) – The x and y-coordinate(s) of the visual field point(s) to look up (in dva).
region (str) – The visual field map to look up the point(s) in. Valid options are ‘v1’, ‘v2’, and ‘v3’. Default is ‘v1’.
hemi (str) – The hemisphere to look up the point(s) in. Valid options are ‘lh’ and ‘rh’.
surface (str) – The surface to look up the point(s) on. Default is ‘midgray’. Other common options include ‘pial’ and ‘white’.
- Returns:
cortex_pts (array_like) – cortical addresses of the visual field points (cortical addresses provide the face containing a point and the barycentric coordinates of the point within that face).
Adapted from code courtesy of Noah Benson
- dva_to_v1(x, y, surface='midgray')[source]
Gives the 3D cortex position(s) of the visual field point(s) (x,y) in v1.
- Parameters:
x (float or array_like) – The x and y-coordinate(s) of the visual field point(s) to look up (in dva).
y (float or array_like) – The x and y-coordinate(s) of the visual field point(s) to look up (in dva).
surface (str) – The surface to look up the point(s) on. Default is ‘midgray’. Other common options include ‘pial’ and ‘white’.
- dva_to_v2(x, y, surface='midgray')[source]
Gives the 3D cortex position(s) of the visual field point(s) (x,y) in v2.
- Parameters:
x (float or array_like) – The x and y-coordinate(s) of the visual field point(s) to look up (in dva).
y (float or array_like) – The x and y-coordinate(s) of the visual field point(s) to look up (in dva).
surface (str) – The surface to look up the point(s) on. Default is ‘midgray’. Other common options include ‘pial’ and ‘white’.
- dva_to_v3(x, y, surface='midgray')[source]
Gives the 3D cortex position(s) of the visual field point(s) (x,y) in v3.
- Parameters:
x (float or array_like) – The x and y-coordinate(s) of the visual field point(s) to look up (in dva).
y (float or array_like) – The x and y-coordinate(s) of the visual field point(s) to look up (in dva).
surface (str) – The surface to look up the point(s) on. Default is ‘midgray’. Other common options include ‘pial’ and ‘white’.
- cortex_to_dva(xc, yc, zc)[source]
Gives the visual field position(s) of the cortex point(s) (xc,yc,zc).
- Parameters:
- Returns:
x, y – The x and y-coordinate(s) of the visual field point(s) (in dva). Both have the same shape as the input. Points that cannot be mapped are NaN: either because the input was NaN, or because no mesh vertex lies within
cort_nn_threshof them.- Return type:
array_like
- v1_to_dva(xv1, yv1, zv1)[source]
Convert points in v1 to dva. Uses the mean of the 5 nearest neighbors in the cortical mesh, weighted by 1/distance, to interpolate dva. Any points that are more than self.cort_nn_thresh um from the nearest neighbor will be set to nan.
- Parameters:
- Returns:
x, y – The x and y-coordinate(s) of the visual field point(s) (in dva).
- Return type:
array_like
- v2_to_dva(xv2, yv2, zv2)[source]
Convert points in v2 to dva. Uses the mean of the 5 nearest neighbors in the cortical mesh, weighted by 1/distance, to interpolate dva. Any points that are more than self.cort_nn_thresh um from the nearest neighbor will be set to nan.
- Parameters:
- Returns:
x, y – The x and y-coordinate(s) of the visual field point(s) (in dva).
- Return type:
array_like
- v3_to_dva(xv3, yv3, zv3)[source]
Convert points in v3 to dva. Uses the mean of the 5 nearest neighbors in the cortical mesh, weighted by 1/distance, to interpolate dva. Any points that are more than self.cort_nn_thresh um from the nearest neighbor will be set to nan.
- Parameters:
- Returns:
x, y – The x and y-coordinate(s) of the visual field point(s) (in dva).
- Return type:
array_like
- from_dva()[source]
Returns a dict containing the region(s) that this visuotopy maps to, and the corresponding mapping function(s).