neurots.generate.soma

NeuroTS class: Soma.

Classes

Soma(center, radius[, points])

NeuroTS soma data structure.

SomaGrower(soma[, context, rng])

Soma class.

class neurots.generate.soma.Soma(center, radius, points=None)

Bases: object

NeuroTS soma data structure.

It contains the soma points and radius.

Parameters:
  • center (numpy.ndarray) – The center of the soma.

  • radius (float) – The radius of the soma.

  • points (list[list[float]], optional) – An iterable of 3D points.

property center

Get the center.

contour_point(point)

Create a contour point from a given point.

Keeps the x-y coordinates of the input point but replaces the third (z) coordinate with the equivalent soma-z in order to create a contour at the soma level.

orientation_from_point(point)

Return the orientation from the soma center to a point on the soma surface.

point_from_trunk_direction(phi, theta)

Return the coordinates of a point on the soma surface from the given theta, phi angles.

Parameters:
  • phi (list[float]) – The polar angle (i.e. on the z-axis).

  • theta (list[float]) – The azimuthal angle (i.e. on the x-y plane).

property points

Return the points list.

class neurots.generate.soma.SomaGrower(soma, context=None, rng=numpy.random)

Bases: object

Soma class.

Parameters:
  • soma (Soma) – The soma that will grow.

  • context (Any) – The context used for the section.

  • rng (numpy.random.Generator) – The random number generator to use.

_contour_soma()

Generate a contour soma, that consists of all soma points.

The contour must contain at least three points.

Returns:

The points and diameters of the built soma.

Return type:

tuple[list[float], list[float]]

_one_point_soma()

Generate a single point soma.

This kind of soma is represented by a sphere including the center and the diameter.

Returns:

The points and diameters of the built soma.

Return type:

tuple[list[float], list[float]]

_original_soma()

Returns the original soma points.

Returns:

The points and diameters of the built soma.

Return type:

tuple[list[float], list[float]]

add_points_from_orientations(vectors)

Generate points on the soma surface from a list of unit vectors.

Parameters:

vectors (list[list[float]]) – The list of orientations.

Returns:

The new points.

Return type:

list[list[float]]

add_points_from_trunk_absolute_orientation(orientation, trunk_absolute_angles, z_angles)

Generate points on the soma surface from a direction and a list of angles.

Parameters:
  • orientation (list[float]) – The trunk orientation.

  • trunk_absolute_angles (list[float]) – The polar angles (phi in spherical coordinates).

  • z_angles (list[float]) – The azimuthal angles (theta in spherical coordinates).

Returns:

The new points.

Return type:

list[list[float]]

add_points_from_trunk_angles(trunk_angles, z_angles, phi_interval=None)

Generate points on the soma surface from a list of angles.

Parameters:
  • trunk_angles (list[float]) – The polar angles (phi in spherical coordinates).

  • z_angles (list[float]) – The azimuthal angles (theta in spherical coordinates).

  • phi_interval (tuple[float, float]) – The interval in which the trunks should be added.

Returns:

The new points.

Return type:

list[list[float]]

build(method='contour')

Generates a soma, depending on the method used.

The points will be saved into the neuron object and consist the first section of the cell. If interpolation is selected points will be generated until the expected number of soma points is reached.

Parameters:

method (str) – The method used to build the soma.

Returns:

The points and diameters of the built soma.

Return type:

tuple[list[float], list[float]]

interpolate(points, interpolation=10)

Return the interpolation points on the convex hull.

Finds the convex hull from a list of points and returns a number of interpolation points that belong on this convex hull.

Parameters:
  • points (list[float]) – Initial set of points.

  • interpolation (int) – The the minimum number of points to be generated.

Returns:

The list of interpolated points.

Return type:

list[list[float]]