scot.eegtopo package

Submodules

scot.eegtopo.eegpos3d module

Module to generate 3d EEG locations

scot.eegtopo.eegpos3d.construct_1020_easycap(variant=0)
scot.eegtopo.eegpos3d.intersection(a, b, expr=<function <lambda>>)

scot.eegtopo.geo_euclidean module

Euclidean geometry support module

class scot.eegtopo.geo_euclidean.Vector(x=0.0, y=0.0, z=0.0)

Bases: object

3D-Vector class

close(other, epsilon=1e-10)
copy()

return a copy of this vector

cross(other)

Cross product with another vector

dot(other)

Dot product with another vector

classmethod fromiterable(itr)

Initialize from iterable

classmethod fromvector(v)

Copy another vector

norm()

Length of the vector

norm2()

Squared norm of the vector

normalize()

Normalize vector to length 1

normalized()

Return normalized vector, but don’t change original

rotate(l, u)

rotate l radians around axis u

rotated(l, u)

rotate l radians around axis, but don’t change original

scot.eegtopo.geo_spherical module

Spherical geometry support module

class scot.eegtopo.geo_spherical.Circle(a, b, c=None)

Bases: object

Arbitrary circle on the spherical surface

angle(p)
distance(p)
get_point(l)
get_radius()
class scot.eegtopo.geo_spherical.Construct

Bases: object

Collection of methods for geometric construction on a sphere

static circle_intersect_circle(a, b)
static line_intersect_circle(line, circle)
static line_intersect_line(k, l)
static midpoint(a, b)

Point exactly between a and b

class scot.eegtopo.geo_spherical.Line(a, b)

Bases: object

Line on the spherical surface (also known as grand circle)

distance(p)
get_point(l)
class scot.eegtopo.geo_spherical.Point(x=None, y=None, z=None)

Bases: object

Point on the surface of a sphere

distance(other)

Distance to another point on the sphere

distances(points)

Distance to other points on the sphere

classmethod fromvector(v)

Initialize from euclidean vector

property list

position in 3d space

property vector

position in 3d space

scot.eegtopo.projections module

scot.eegtopo.projections.array_project_radial_to2d(points_3d)
scot.eegtopo.projections.array_project_radial_to3d(points_2d)
scot.eegtopo.projections.project_radial_to2d(point_3d)
scot.eegtopo.projections.project_radial_to3d(point_2d)

scot.eegtopo.tools module

class scot.eegtopo.tools.Struct(content=None)

Bases: object

keys()

scot.eegtopo.topoplot module

class scot.eegtopo.topoplot.Topoplot(m=4, num_lterms=10, headcolor=[0, 0, 0, 1], clipping='head', electrodescale=1, interpolationrange=2.356194490192345, head_radius=2.356194490192345)

Bases: object

Creates 2D scalp maps.

calc_g(x)
calc_gmap(pixels)
static calc_legendre_factors(m, num_lterms)
create_map(pixels=32)
get_map()
plot_circles(radius, axes=None, offset=(0, 0))
plot_head(axes=None, offset=(0, 0))
plot_locations(axes=None, offset=(0, 0), fmt='k.', alpha=0.5)
plot_map(axes=None, crange=None, offset=(0, 0))
set_locations(locations)
set_map(img)
set_values(z)
scot.eegtopo.topoplot.topoplot(values, locations, axes=None, offset=(0, 0), plot_locations=True, plot_head=True, **kwargs)

Wrapper function for :class:`Topoplot.

scot.eegtopo.warp_layout module

Summary

Provides functions to warp electrode layouts.

scot.eegtopo.warp_layout.warp_locations(locations, y_center=None, return_ellipsoid=False, verbose=False)

Warp EEG electrode locations to spherical layout.

EEG Electrodes are warped to a spherical layout in three steps:
  1. An ellipsoid is least-squares-fitted to the electrode locations.

  2. Electrodes are displaced to the nearest point on the ellipsoid’s surface.

  3. The ellipsoid is transformed to a sphere, causing the new locations to lie exactly on a spherical surface with unit radius.

This procedure intends to minimize electrode displacement in the original coordinate space. Simply projecting electrodes on a sphere (e.g. by normalizing the x/y/z coordinates) typically gives much larger displacements.

Parameters:
locationsarray-like, shape = [n_electrodes, 3]

Eeach row of locations corresponds to the location of an EEG electrode in cartesian x/y/z coordinates.

y_centerfloat, optional

Fix the y-coordinate of the ellipsoid’s center to this value (optional). This is useful to align the ellipsoid with the central electrodes.

return_ellipsoidbool, optional

If true center and radii of the ellipsoid are returned.

Returns:
newlocsarray-like, shape = [n_electrodes, 3]

Electrode locations on unit sphere.

carray-like, shape = [3], (only returned if return_ellipsoid evaluates to True)

Center of the ellipsoid in the original location’s coordinate space.

rarray-like, shape = [3], (only returned if return_ellipsoid evaluates to True)

Radii (x, y, z) of the ellipsoid in the original location’s coordinate space.

Module contents