Public API

Data structure

class front.Front(entity_name, algo_name, xyz, radius, path_length, order)

Bases: object

Key component of NeuroMac. A Front is a phenomenological growth cone with a dual character:

  • A Front is a point in space with a radius. When connected to another Front, a frustrum (or cylinder) is created.
  • A Front is a phenomenological growth cone that contains a set of growth rules.

Each Front its own set of rules expressed in a Python file that listed in the algo_name variable. Initially, a neuronal structure consists of one Front but later, when a structure develops by simultaneous expanding of multiple front, each front can contain different growth-rules.

Warning

This code is not to be changed and is directly called by NeuroMaC

Methods

extend_front(seed, constellation[, ...]) Main function.
entity_name = None

The name given to and entity This name is to be used to query the substrate

algo_name = None

Growth-rules to use

xyz = None

3D location

radius = None

Radius of the front Consecutive fronts form a frustrum or cylinder

path_length = None

Not directly set. Attrribute set by growth_procs.prepare_next_front()

order = None

Not directly set. Attrribute set by growth_procs.prepare_next_front()

swc_type = None

SWC-type as define in Cannon et al 1998

extend_front(seed, constellation, virtual_substrate={})

Main function. Outsources the execution to the actual growth-rules specified in the configuration file (cell_type_x > algorithm).

See Recording synapse locations

Note

This function is not to be modified and is only used by framework code (Subvolume.py)

Parameters:

seed : int

constellation : dict of list of np.array

virtual_substrate : dict of list

Returns:

front : Front

List of fronts that are the “extension” of the current front. By convention, an empty list of None represents a terminating front. A list with one or two entries represents an elongating = or a branching front, respectively. One exception can be the soma from which multiple new fronts can sprout.

Front implementation helper functions

growth_procs.compute_exp_decay_factor(i, d, x)
growth_procs.unit_sample_on_sphere()

Sample a random point on a sphere with

Returns:

v : np.array

Unit-length vector originating from [0,0,0]

growth_procs.get_entity(entity_name, constellation)

Search for all entities with a specific name.

Warning

Does not yield desired results when searching for “own” entities, that is, all other components of the same entity.

Parameters:

entity_name : string

Name of the entity. Searching is done by string.startswith(string), which acts as some sort of wild card

constellation : dict of list of np.array

A “point-only” constellation. That is, entries in this dict are lists of 3D np.array vectors

Returns:

entities : list

List contains 3D positions

growth_procs.get_eigen_entity(front, constellation, ancestry_limit=25, common_ancestry_limit=10)

Search for all entity components of a structure. For instance, if you want to implement self-repulsion you have to use this method.

It is implemented in such way that direct siblings and parent structures are ignored. If this would not be the case, sel-repulsion would always direct away from the parent structure and result in a straight line.

Parameters:

front : front.Front

constellation : dict of list of np.array

A “point-only” constellation. That is, entries in this dict are lists of 3D np.array vectors

Returns:

entities : list of np.array

List contains 3D positions

growth_procs.prepare_next_front(front, new_pos, radius_factor=None, set_radius=None, add_order=False)

Wrapper function to prepare a new front based on a new positions. This function takes care of the internal variables (path_length) and order of the new front to be created.

Parameters:

front : front.Front

new_pos : np.array

New position in 3D space

radius_factor : float

If the radius is not set, a radius_factor can be given. Then, the radius value is simply multiplied by this factor.

set_radius : float

New radius

add_order : boolean

Set to True of this front is the first of a branch (as well as at the soma, whose order=0 per NeuroMac convention while intial neurites have order=1)

Returns:

new_front : front.Front

growth_procs.normalize_length(vec, norm_L)

Scale a direction vector to a given length

Parameters:

vec : np.array

Direction vector to scale

norm_L : float

New length of the vector

Returns:

new_vec : np.array

growth_procs.direction_to(front, list_of_others, what='average')

Compute the direction vector towards some other entities.

Parameters:

front : front.Front

Front to be used as the origin (starting point) of the direction vector

list_of_others : list

List created by *get_enity* LINK

what : string

String options:

  • ‘nearest’: compute the direction vector to the nearest point in the list_of_others.
  • ‘average’: default. TODO. Currently returns a list of direction vectors
  • ‘all’: Return a list of all direction vectors
growth_procs.gradient_to(front, list_of_others, strength, decay_factor, what='average', cutoff=0.01)

Determines the weighted vector towards some other entities. The length of the direction vectors is scaled according to the distance towards the “other entity”, a constant weight and its distance-dependent decay constant. Decay is exponential, hence large decay factors (close to 1) behave as constant/linear decay while smaller ones (<< 1) have a strong decay.

Parameters:

front : front.Front

Front to be used as the origin (starting point) of the direction vector

list_of_others : list

List created by *get_enity* LINK

strength : float

initial weight

decay_factor : float

Exponent with which the strength decays (or increases if > 1)

what : string

String options:

  • ‘nearest’: compute the direction vector to the nearest point in the list_of_others.
  • ‘average’: default. TODO. Currently returns a list of direction vectors
  • ‘all’: Return a list of all direction vectors

cutoff : float

Minimal direction vector length. Vectors that are smaller after are discarded.

growth_procs.compute_soma_rep_vec(front, strength=1.0, decay=1.0)

Compute the respulsive vector directed away from the soma given a provided reference position. The resultant vector is AB, with A=[0,0,0] and B the returned array

Table Of Contents

Previous topic

NeuroMaC examples

This Page