mapBrain’s API

class brainSimulator

class mapBrain.SphericalBrainMapping(resolution=1, deformation=0.0, ithreshold=0, nlayers=1)[source]

Performs a Spherical Brain Mapping of a 3D Brain Image

Parameters:
  • resolution (int, float) – Angle resolution at which each mapping vector is computed (default 1 degree)
  • deformation (float) – Rate of unequally distributed mapping vectors, to be used when the surface to be mapped is not spherical but ellipsoid (in the range 0-1, with 0 meaning a perfect sphere)
  • ithreshold (float) – Intensity threshold (\(I_{th}\)) for the projections needing it (default 0)
  • nlayers (int) – Nummber of equally distributed layers (default 1)
computeTexture(p, imag, origin, distances=1)[source]

Computes the texture around vector p

Parameters:
  • p – The mapping or rojecting vector \(\mathbf{v}_{{\theta},{\varphi}}\)
  • imag (3D numpy array) – Three-dimensional intensity array corresponding to a 3D registered brain image.
  • origin (3D coordinates in numpy array) – Specifies the position of the origin of mapping vectors. If not specified, defaults to the geometrical center of the image.
  • distances (integer or list of integers) – It helds the distances at which the GLCM is going to be computed.
doSBM(image, measure='average', show=True, origin=None)[source]

Performs the SBM on the selected image and using the specified measure

Parameters:
  • image (3D numpy array) – Three-dimensional intensity array corresponding to a 3D registered brain image.
  • measure (string) – SBM measure to be computed
  • show (bool) – Specifies whether to show the computed map (True) or not (False)
  • origin (3D coordinates in numpy array) – Specifies the position of the origin of mapping vectors. If not specified, defaults to the geometrical center of the image.
showMap(map, measure, cmap='gray')[source]

Shows the computed maps in a window using pyplot

Parameters:
  • map (numpy ndarray) – map or array of maps to be shown
  • measure (string) – SBM measure to be computed
  • cmap (string with valid matplotlib colormap) – Colormap to use in representation
sph2cart(theta, phi, r)[source]

Returns the corresponding spherical coordinates given the elevation, azimuth and radius

Parameters:
  • theta (float) – Azimuth angle (radians)
  • phi (float) – Elevation angle (radians)
  • rad (float) – Radius
vsetIThreshold(ithreshold=0)[source]

Sets the intensity threshold to be used in SBM.

Parameters:ithreshold (float) – Intensity threshold ($I_{th}$) for the projections needing it (default 0)