Package topo :: Package coordmapper :: Module basic
[hide private]
[frames] | no frames]

Module basic

source code

Functions for mapping from one 2D Cartesian coordinate system to another.

These are useful for defining projections with nonlinear magnifications, reductions, or other transformations of the input coordinate system.

Generally, these function objects should work for an arbitrary (x,y) pair, returning new, remapped (x,y), although some classes of mappers may define their range and domain, with undesirable or undefined behavior outside those regions. It is best if such objects raise a suitable exception in those circumstances.

$Id: basic.py 11296 2010-07-27 14:39:42Z ceball $


Version: $Revision: 11296 $

Classes [hide private]
  CoordinateMapperFn
Abstract base class for functions mapping from a 2D coordinate into another one.
  IdentityMF
Return the x coordinate of the given coordinate.
  ConstantMapper
Map all values to the same constant, pre-specified coordinates.
  Pipeline
Applies a sequence of coordmappers, left to right.
  Jitter
Additively modifies calculated x,y coordinates, e.g.
  NormalJitter
Additively modifies calculated x,y coordinates with Gaussian random noise.
  Grid
Divides the 2D area into a grid, where all points within each grid element map to the same location.
  Polar2Cartesian
Map from polar (radius,angle) to Cartesian (x,y) coordinates.
  Cartesian2Polar
Maps from Cartesian (x,y) to polar (radius,angle).
  AffineTransform
Remaps the input with an affine transform.
  Translate2d
Translate the input by xoff,yoff.
  Rotate2d
Rotate the input around the origin by an angle in radians.
  Scale2d
Scale the input along the x and y axes by sx and sy, respectively.
  SingleDimensionMapper
Coordinate Mapper that uses an origin-centered 1-D mapping function.
  MagnifyingMapper
Exponential (magnifying) mapping function.
  ReducingMapper
Provides a mapping that reduces the center of the activity.
  OttesSCMapper
Abstract class for superior colliculus mappings.
  OttesSCMotorMapper
Efferent superior colliculus mapping.
  OttesSCSenseMapper
Afferent superior colliculus mapping.
Functions [hide private]
 
Translate2dMat(xoff, yoff)
Return an affine transformation matrix that translates points by the offset (xoff,yoff).
source code
 
Rotate2dMat(t)
Return an affine transformation matrix that rotates the points around the origin by t radians.
source code
 
Scale2dMat(sx, sy)
Return an affine translation matrix that scales the points toward/away from the origin by a factor of sx on x-axis and sy on the y-axis.
source code
 
ottes_mapping(R, phi, A, Bu, Bv)
The efferent mapping function from Ottes et al.
source code
 
ottes_inverse_mapping(u, v, A, Bu, Bv)
Approximate inverse of ottes_mapping(), using the inverse function provided in the appendix of Ottes et al.
source code
 
test_ottes_inverse() source code
Variables [hide private]
  pi = 3.14159265359
  exp = <ufunc 'exp'>
  log = <ufunc 'log'>
  sqrt = <ufunc 'sqrt'>
  sin = <ufunc 'sin'>
  cos = <ufunc 'cos'>
  __package__ = 'topo.coordmapper'
  k = 'CoordinateMapperFn'
Function Details [hide private]

ottes_mapping(R, phi, A, Bu, Bv)

source code 

The efferent mapping function from Ottes et al. (1986) Vision Research 26:857-873.

Takes saccade with amplitude R (in degrees) and direction phi (in degrees), and returns a location u,v on the colliculus in mm, where the u axis is rostral/caudal, and the v axis is medial/lateral.

ottes_inverse_mapping(u, v, A, Bu, Bv)

source code 

Approximate inverse of ottes_mapping(), using the inverse function provided in the appendix of Ottes et al. (1986) Vision Research 26:857-873

Takes takes a location u,v on the colliculus in mm and maps to a retinal eccentricity R and direction phi, in degrees. Inverse is approximate, with increasing error as positions near the edges of the collicular sheet. (I.e. with high absolute v value).